There are poor automata

Source: Internet
Author: User

What is the automaton??

A self-motive is a device that can perform operations and can achieve self-control. A traditional computer that has a program stored in it has the ability to perform operations and has the ability to control itself, so the computer is a self-motive. Automata is a powerful tool to describe the processing of symbolic strings, and therefore, automata become an important basis for the study of lexical analysis procedures. There are poor automata (FA) divided into deterministic have poor automata (DFA) and non-deterministic have poor automata (NFA). A poor automaton is used to identify whether the grammatical components of a symbol string belong to a particular language.


1,DFA (determined to have a poor automaton)

A deterministic have poor automata DFA is defined by a five-tuple to DFA = (q,∑,t,q0,f).

Q is a non-exhaustive set of states where each element is called a state.

∑ is a non-exhaustive input alphabet, where each element is called an input symbol.

T is a single-valued mapping qx∑ →q, also known as a State conversion function; for example, T (q,x)→q ' refers to the current state Q scan to the input symbol X, will go to the next state Q ', Q ' is called the only successor state of Q .

Q0 is the start state and the Q0∈q,dfa start state is unique.

F is a non-exhaustive set of terminating states and F Q; The F-state set is a subset of the Q-state set that contains at least one terminating state .

The certainty of 2,DFA

The current state uniquely determines the next current state when confronted with the next input symbol.

3,NFA (non-deterministic with poor automata)

an indeterminate and poor automaton NFA is also defined by a five-tuple to NFA = (q,∑,t,q0,f).

Q is a non-exhaustive set of states where each element is called a state.

∑ is a non-exhaustive input alphabet, where each element is called an input symbol.

T is a multivalued mapping qx∑ →q, also known as a state transition function; for example, T (q,x) →{q1,q2} refers to the current state Q scan to the input symbol x, the next state to go to is Q1 or Q2, when the current state Q has Q1 and Q2 Two successor states (one-to-many relationship).

Q0 is a non-exhaustive set of start states and Q0 Q,nfa can have multiple start states.

F is a non-exhaustive set of terminating states and F Q; The F-state set is a subset of the Q-state set that contains at least one terminating state .

4,NFA's non-deterministic

The current state cannot uniquely determine the next current state when confronted with the next input symbol.

The difference between 5,DFA and NFA

1,DFA has only one starting state, and the NFA has a starting state set;

The state conversion function of 2,DFA is a single-value mapping, and NFA is a multivalued mapping;

3,DFA cannot be moved, and the NFA can carry out the space shift;

6, describe the method of a poor automaton

1, State transition table

2, State transition diagram

3, the form description of the map

For example: To determine the poor automaton a, for the input symbol, a, B, if its current state is q0, then respectively into the state q1,q3, if the current state is Q1, then respectively into the state q0,q2, if the current state is Q2, respectively into the state q3,q1, if the current state is Q3, are transferred to the state q2,q0 respectively.

Describe automaton A with A State transition table:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/51/wKiom1gPWXOw5ykhAAAYRc8WsKc814.png "title=" Status.png "alt=" Wkiom1gpwxow5ykhaaayrc8wskc814.png "/>

Describe automata with A state transition diagram:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/52/wKiom1gPZAqgx4-yAAAZtNphVw4937.png "title=" View.png "alt=" Wkiom1gpzaqgx4-yaaaztnphvw4937.png "/>

PS: For example, the state q0 is marked with a double circle, indicating that it is a terminating state, and an arrow is used to indicate that it is a starting state. This means that the state q0 is both a start and a terminating state. Transitions between states can be visually visualized by a state transition diagram. If the status q0 by the input letter A can be converted into a state Q1. A state transition diagram is actually a poor automaton, as the five parts of a poor automaton are fully included in the state transition diagram. In a state transition diagram, if there are M states and n input characters, then there are M nodes in this state transition diagram, with a maximum of n arcs fired at each node.

Describe the automaton a in the form of a map:

T (q0,a) = Q1 t (q0,b) = Q3

T (q1,a) = Q0 T (q1,b) = Q2

T (q2,a) = Q3 t (q2,b) = Q1

T (q3,a) = Q2 T (q3,b) = Q0

7, non-deterministic and poor automaton State conversion diagram

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/50/wKioL1gPaRrTHk0rAAAXvzW3v0Y140.png "title=" Nfa.png "alt=" Wkiol1gparrthk0raaaxvzw3v0y140.png "/>

PS: By the known, Mapping T (q0,x) = {Q1,Q2}, indicating that if the current state is q0, when the input character x is encountered, it will be converted to a Q1 or Q2 state, which is clearly indeterminate. So the state node q0 to the arc of the state node Q1 and Q2, all marked with the input character X.




This article from "Luo Chen's blog" blog, declined reproduced!

There are poor automata

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.