automaton

Finite automaton in Haskell

蹲街弑〆低调 提交于 2019-12-03 05:46:34
问题 What is a good way to represent finite automaton in Haskell? How would the data type of it look like? In our college, automata were defined as a 5-tuple (Q, X, delta, q_0, F) where Q is the set of automaton's states, X is the alphabet (is this part even necessery), delta is the transition function taking 2-tuple from (Q,X) and returning state/-s (in non-deterministic version) and F is the set of accepting/end states. Most importantly, I'm not sure what type delta should have... 回答1: There are

Finite automaton in Haskell

北城以北 提交于 2019-12-02 19:17:26
What is a good way to represent finite automaton in Haskell? How would the data type of it look like? In our college, automata were defined as a 5-tuple (Q, X, delta, q_0, F) where Q is the set of automaton's states, X is the alphabet (is this part even necessery), delta is the transition function taking 2-tuple from (Q,X) and returning state/-s (in non-deterministic version) and F is the set of accepting/end states. Most importantly, I'm not sure what type delta should have... There are two basic options: An explicit function delta :: Q -> X -> Q (or [Q] as appropriate) as Sven Hager suggests

Design a nondeterministic finite automata in c++ (incorrect output)

亡梦爱人 提交于 2019-11-30 00:57:19
I am doing an assignment for simulate a nondeterministic finite automaton, just as I explain in this post . I have this input read from the file tarea4.in : 1 6 8 0 2 2 5 0 0 a 0 1 a 1 1 b 1 2 c 1 3 c 3 4 d 4 4 d 4 5 d 5 aaabcccc aabbbbcdc abbcdddcc acdddddd abc The first line of input is an integer T, represented the number of cases to evaluate the program. Each test case starts with 4 integers, the first is the number of state for the automaton, next is the number of transitions of the automaton, the third number is the initial state, and then the number of final states. then come the final

Implementing a code to simulate a finite automaton nondeterministic in c++

徘徊边缘 提交于 2019-11-29 03:00:14
问题 I'm doing an assignment for automata theory, which I have to determine whether a word is accepted or not by a transition function for a deterministic finite automaton I have this input file: 6 8 0 2 2 5 0 0 a 0 1 a 1 1 b 1 2 c 1 3 c 3 4 d 4 4 d 4 5 d 3 aaabcccc aabbbbcdc acdddddd The input starts with 4 integers, the first is the number of state for the automaton, next is the number of transitions of the automaton, the third number is the initial state, and then the number of final states.

Design a nondeterministic finite automata in c++ (incorrect output)

时间秒杀一切 提交于 2019-11-28 21:41:32
问题 I am doing an assignment for simulate a nondeterministic finite automaton, just as I explain in this post. I have this input read from the file tarea4.in : 1 6 8 0 2 2 5 0 0 a 0 1 a 1 1 b 1 2 c 1 3 c 3 4 d 4 4 d 4 5 d 5 aaabcccc aabbbbcdc abbcdddcc acdddddd abc The first line of input is an integer T, represented the number of cases to evaluate the program. Each test case starts with 4 integers, the first is the number of state for the automaton, next is the number of transitions of the