finite-automata

Finiteness of Regular Language

和自甴很熟 提交于 2019-12-28 06:27:42
问题 We all know that (a + b)* is a regular language for containing only symbols a and b . But (a + b)* is a string of infinite length and it is regular as we can build a finite automata, so it should be finite. Can anyone please explain this? 回答1: Finite automaton can be constructed for any regular language, and regular language can be a finite or an infinite set. Of-course there are infinite sets those are not regular sets. Check the Venn diagram below: Notes : 1. every finite set is a regular

Probabilistic Automata / Finite state machines in Clojure

拥有回忆 提交于 2019-12-25 07:52:04
问题 Does anyone know of any good resources for probabilistic finite state machines / automata in Clojure? I know of https://github.com/ztellman/automat and https://github.com/cdorrat/reduce-fsm (but I do not think they do what I want). See here: https://en.wikipedia.org/wiki/Probabilistic_automaton My problem is fairly simply (I think): I have multiple states, and transition between them is singular i.e. for now it is just a simple fixed distribution. I am still trying to gain clarity as to if

Modeling FSM with conditions?

北城余情 提交于 2019-12-24 11:08:00
问题 I am supposed to model a FSM but I am unsure how to model conditions. Let's take the simple ATM example: If user presses "Confirm" AND PIN is correct, go to State 2. If user presses "Confirm" AND PIN is not correct, go to State 3. Or could I simply use input called "wrong pin" and "correct pin"? I would need it to be formal so that I can employ FSM testing procedures, like cover set generation etc. But I do not know if FSM can be modeled this way (maybe with adding states representing

Split a string based on each time a Deterministic Finite Automata reaches a final state?

丶灬走出姿态 提交于 2019-12-21 22:28:54
问题 I have a problem which has an solution that can be solved by iteration, but I'm wondering if there's a more elegant solution using regular expressions and split() I have a string (which excel is putting on the clipboard), which is, in essence, comma delimited. The caveat is that when the cell values contain a comma, the whole cell is surrounded with quotation marks (presumably to escape the commas within that string). An example string is as follows: 123,12,"12,345",834,54,"1,111","98,273","1

Levenshtein DFA in .NET

情到浓时终转凉″ 提交于 2019-12-20 10:53:32
问题 Good afternoon, Does anyone know of an "out-of-the-box" implementation of Levenshtein DFA ( deterministic finite automata ) in .NET (or easily translatable to it)? I have a very big dictionary with more than 160000 different words, and I want to, given an inicial word w , find all known words at Levenshtein distance at most 2 of w in an efficient way. Of course, having a function which computes all possible edits at edit distance one of a given word and applying it again to each of these

How to use the intersection construction to form a DFA?

人盡茶涼 提交于 2019-12-17 17:32:32
问题 I'm doing a homework assignment for my theory of computation class and am a bit confused how to combine 2 DFAs. The book says it uses the "intersection construction" to do so, but I'm not sure what that is. Here are 2 examples: 回答1: The idea is pretty straightforward, although I can see where the confusion comes in. I will give a text/symbolic description of the process for making the intersection (union, difference) machines via the Cartesian Product Machine construction (same thing as you

How does “δ:Q×Σ→Q” read in the definition of a DFA (deterministic finite automaton)?

不想你离开。 提交于 2019-12-17 07:38:55
问题 How do you say δ: Q × Σ → Q in English? Describing what × and → mean would also help. 回答1: δ is like a mathematical function called the transition function . Something like. z = f(x, y) A function in mathematical defines mapping of elements in one set to another set. In function set of input arguments are called Domain of a function and output is the rage. [ANSWER] In expression "δ:Q×Σ → Q" , × means Cartesian product (that is a set), and → is a mapping . "δ:Q×Σ → Q" says δ is a transition

Example of Non-Linear, UnAmbiguous and Non-Deterministic CFL?

可紊 提交于 2019-12-17 06:51:42
问题 In the Chomsky classification of formal languages, I need some examples of Non-Linear, Unambiguous and also Non-Deterministic Context-Free-Language(N-CFL)? Linear Language : For which Linear grammar is possible( ⊆ CFG) e.g. L 1 = {a n b n | n ≥ 0 } Deterministic Context Free Language(D-CFG) : For which Deterministic Push-Down-Automata(D-PDA) is possible e.g. L 2 = {a n b n c m | n ≥ 0, m ≥ 0 } L 2 is unambiguous. A CF grammar that is not linear is nonlinear. L nl = {w: n a (w) = n b (w)} is

Example of Non-Linear, UnAmbiguous and Non-Deterministic CFL?

别等时光非礼了梦想. 提交于 2019-12-17 06:51:18
问题 In the Chomsky classification of formal languages, I need some examples of Non-Linear, Unambiguous and also Non-Deterministic Context-Free-Language(N-CFL)? Linear Language : For which Linear grammar is possible( ⊆ CFG) e.g. L 1 = {a n b n | n ≥ 0 } Deterministic Context Free Language(D-CFG) : For which Deterministic Push-Down-Automata(D-PDA) is possible e.g. L 2 = {a n b n c m | n ≥ 0, m ≥ 0 } L 2 is unambiguous. A CF grammar that is not linear is nonlinear. L nl = {w: n a (w) = n b (w)} is

What is the algorithm for generating a random Deterministic Finite Automata?

大憨熊 提交于 2019-12-12 15:58:52
问题 The DFA must have the following four properties: The DFA has N nodes Each node has 2 outgoing transitions. Each node is reachable from every other node. The DFA is chosen with perfectly uniform randomness from all possibilities This is what I have so far: Start with a collection of N nodes. Choose a node that has not already been chosen. Connect its output to 2 other randomly selected nodes Label one transition 1 and the other transition 0. Go to 2, unless all nodes have been chosen.