585 questions
Advice
0
votes
1
replies
43
views
Proof of Partition Stability upon Termination of Hopcroft’s DFA Minimization Algorithm
I've gotten an assignment to proof the Lemma in the title as part of my Formal methods in Software Engineering class, but I do not have anywhere to start in regards to the Proof.
All of the literature ...
1
vote
0
answers
131
views
python trying to plot a DFA with networkx and matplotlib
Hi I was trying to implement a plot function for a DFA class, using networkx in python.
def plot(self):
G = nx.MultiDiGraph()
nodes = self.collect_nodes()
for n in nodes:
...
1
vote
1
answer
137
views
How to build DFA with subset construction algorithm when NFA contain `.` condition
such as .*ab
For this regex, I can build an NFA using the Thompson algorithm like:
When I try to use the subset construction algorithm to change it to a DFA, I find the result is weird.
the DFA ...
0
votes
1
answer
66
views
Designing a DFA for a Lexer: Shared vs. Separate Character Nodes
When building the DFA for the lexer of my programming language, should each character (e.g., n, i, f) appear as a single shared node across all token paths, or should I allow duplicate nodes for the ...
0
votes
0
answers
52
views
Feasibility of using product DFA to show two sets are disjoint
I have two finite sets of strings S_1, S_2 that are described by DFAs (e.g. these sets are regular languages, but I want to emphasize the fact that they are finite of known maximum length).
I need to ...
3
votes
1
answer
83
views
Applying simplification rules to a DFA to derive a regular expression for it [closed]
I'm given this deterministic finite automaton (DFA):
I have to construct a regular expression for it. I do not understand one thing in the method described in my handbook.
First of all, we have to ...
0
votes
0
answers
62
views
Regex Derivative DFA: This Should Work, But It's Breaking in Unexpected Ways
I’m working on a DFA-based lexer using regex derivatives for tokenizing lexemes. I've built a setup that, theoretically, should handle regex simplification and DFA transitions accurately. For the most ...
1
vote
1
answer
231
views
Regex to DFA question, don't understand why it is this way
I've been dealing with problem 10 on Leetcode (Regular expression matching), where you are supposed to write a program that matches strings to a given regex.I wrote a solution in C that had passed 308 ...
-3
votes
1
answer
186
views
Are my DFA's correct? (arbitrary long sequence of 0's and 1's) [closed]
For my exercise I'm supposed to create two DFA's.
The task specifically is:
Construct a DFA over the alphabet Σ={1,0} accepting the following regular languages.
a) An arbitrary long sequence of zeros ...
0
votes
1
answer
523
views
Create a DFA that contains "11" or ends with "10"
I'm trying to construct a DFA (binary only) that contains "11" or ends with "10".
I tried to do the following:
$q2$ and $q3$ are accepting states
State
0
1
$q0$
$q0$
$q1$
$q1$
$q3$
...
0
votes
1
answer
64
views
How do I restrict the allow keys of an object with Typescript generics?
I want to only allow one type of object as function parameter. Object keys must start with $, only contain alphabetical characters, and its values must be of type Test. Under "example 1" ...
0
votes
1
answer
518
views
Regular expression of "odd number of a and odd number of b"
I want to create a regular expression of odd lengths of a and b. I found this solution on Stack Overflow:
((a+aaa)*(b+bbb)*(a+aaa)*(b+bbb)*(a+aaa)*)*(ab+ba).........
I found it to be correct from ...
0
votes
1
answer
69
views
Theory of Comp Sci - State Diagrams NFAs
I have been given this theorem and example that goes with it:
Theorem 1.49
The class of regular languages is closed under the star operation.
PROOF IDEA We have a regular language 𝐴1 and want to ...
0
votes
1
answer
122
views
Theory of computer science problems
I am working on theory of computer science problems but cannot get these to work:
a. Give an NFA recognizing the language (01 ∪ 001 ∪ 010)*
b. Convert this NFA to an equivalent DFA. Give only the ...
1
vote
1
answer
302
views
a challenging finite automata - what is the language?
I have this finite automata (FA) and want to write its language. I think its
L={x E {0,1} | {x with subset of 00 and ends in 1} and it would help to know what the type of FA it is.
I think it's a DFA ...