finite-automata

how to draw an automaton diagram?

痞子三分冷 提交于 2019-12-12 01:23:23
问题 I used graphviz based on the recommendation given to me by many people but I ran into a problem. I want to write a dot in ocaml using the Format.module and I have a record with five fields that define an automaton including the transitions which are represented by a list of int*char*int and final states which are represented by an int list. The first field is the initial state which is one int . I also defined a function member that takes a parameter and tests if it is a member of a given

Understanding (and forming) the regular expression of this finite automaton

萝らか妹 提交于 2019-12-11 03:49:23
问题 For the above automaton, the regular expression that has been given in my textbook is the following : a*(a*ba*ba*ba*)*(a+a*ba*ba*ba*) I am having trouble deriving this...the following is my attempt at it : aa* + aa*(ba*ba*ba*)* + ba*ba*ba* + ba*ba*ba*(ba*ba*ba*)* Either I am wrong or I am not being able to simplify it into the form given in the book. Can someone please guide me here, point out the mistake or explain it to me step-by-step? I'd really really thankful and appreciate that. 回答1:

Automata theory : Conversion of a Context free grammar to a DFA

泪湿孤枕 提交于 2019-12-11 02:06:24
问题 How to convert a Context Free Grammar to a DFA? This is easy if we have transitions like A->a B. But when we have the transitions as A->a B c. Then how should we represent it as a DFA 回答1: First, you should convert your language to CNF (Chomskey Normal Form). Then steps for conversion are as such: Convert it to left/right grammar is called a regular grammar. Convert the Regular Grammar into Finite Automata The transitions for automata are obtained as follows For every production A -> aB make

Can anyone please explain difference between finite state machine and finite automata?

蹲街弑〆低调 提交于 2019-12-10 15:46:11
问题 Can anyone please explain with example what is the difference between finite state machine and finite automata? 回答1: Both "Finite State Machine" FSM and "Finite Automata" (or Finite State Automata) FA means same, represents an abstract mathematical model of computation for the class of regular languages. The word "Finite" significance the presence of the finite amount of memory in the form of the finite number of states Q (read: Finiteness of Regular Language). Generally in formal-theory (or

Finite State Machine in Objective-C

為{幸葍}努か 提交于 2019-12-09 13:22:59
问题 Does anyone have a solution for a basic, compact Finite state machine/automata written in Objective-C code? I am interested in reusable components so that the FSM have states added and actions defined that use reusable state classes. 回答1: What you want is a rules engine... oddly, I was able to find only one for objective-C (BDRuleEngine) and that is rather out of date: http://eschatologist.net/bDistributed.com/index.html It might be the best starting point though, unless you want to port

Finite automata, Pushdown automata and Turing machine examples

大兔子大兔子 提交于 2019-12-08 02:56:19
问题 I'm looking for some good source of Finite automata, pushdown automata and Turing machine tasks examples (for solving manually, by hand). I was searching around but didn't find nothing special so I'm wondering if someone's got some good examples. Thanks in advance. 回答1: Your best bet might be to get a book on the subject, such as Introduction to the Theory of Computation, Third Edition by Michael Sipser, and then work through the exercises. For a collection of problem sets on automata, along

How do you construct the union of two DFA's?

与世无争的帅哥 提交于 2019-12-06 23:47:30
问题 Does anyone have a straightforward description of the algorithm for constructing the union of two given DFA's? For example, say we have two DFA's over {0,1} where {w|w has an odd number of characters} w has states A and B delta | 0 | 1 ---------------- A | B | B ---------------- B | A | A {x|x has an even number of 1s} x has states a and b delta | 0 | 1 ---------------- a | a | b ---------------- b | b | a I have a resulting transition table showing the union as: delta | 0 | 1 ---------------

Finite automata, Pushdown automata and Turing machine examples

拥有回忆 提交于 2019-12-06 09:33:06
I'm looking for some good source of Finite automata, pushdown automata and Turing machine tasks examples (for solving manually, by hand). I was searching around but didn't find nothing special so I'm wondering if someone's got some good examples. Thanks in advance. Your best bet might be to get a book on the subject, such as Introduction to the Theory of Computation, Third Edition by Michael Sipser, and then work through the exercises. For a collection of problem sets on automata, along with solutions, check out Stanford's introductory course in the theory of computation . Problem Sets 5, 6,

How to merge two finite state automata?

故事扮演 提交于 2019-12-06 04:06:18
问题 Say I have two deterministic finite state automata represented by the following transition diagrams: FSA for keyword IF: IF ___ ___ _ / \ I / \ F // \\ >| 0 |----->| 1 |----->||2|| \___/ \___/ \\_// FSA for an ID: [A-Z][A-Z0-9]* ------------ ___ | _ LET | / \ LET // \\<------ >| 0 |----->||1|| \___/ \\_//<------ | NUM | ------------ What algorithm may I use to combine them into a single deterministic finite state automata with three final states, represented by the following transition

How do you construct the union of two DFA's?

只愿长相守 提交于 2019-12-05 04:15:24
Does anyone have a straightforward description of the algorithm for constructing the union of two given DFA's? For example, say we have two DFA's over {0,1} where {w|w has an odd number of characters} w has states A and B delta | 0 | 1 ---------------- A | B | B ---------------- B | A | A {x|x has an even number of 1s} x has states a and b delta | 0 | 1 ---------------- a | a | b ---------------- b | b | a I have a resulting transition table showing the union as: delta | 0 | 1 ---------------- Aa | Ba | Bb ---------------- Ab | Bb | Ba ---------------- Ba | Aa | Ab ---------------- Bb | Ab |