Compiler theory - Chapter III lexical analysis -3.6 finite automata

Finite Automata

  • definition:
    • FIG formal representations of state, indicates a start state, the transitions between one or more receiving state, and a state set, the state and the input set character set
  • Automaton accepts an input string x:
    • If and only if the corresponding transition diagram exist a path from the start state to a receiving state, so that the edges of the pieces consisting reference path string x
  • Automatic machine definition (language accepted):
    • Reference numeral string set is on all paths from the start state to a receiving state


First, uncertain Finite Automata (NFA)


Structure

Feature

  • A symbol mark can leave a plurality of edges in the same state, and the input air can be used as reference numeral
  • Use spreadsheets to track the status of all NFA when scanning the input characters may be entered

Examples

Example 1

Example 2


Second, the determined finite automata (DFA)


Structure

Feature

  • For any state of any input symbol there is one and only one conversion
  • Transition is not allowed on the air input

    Examples

    Example 1

Example 2

Example 3

Example 4


Third, the relations and differences between the NFA and DFA




Reference - Mu class - Suzhou University

Guess you like

Origin www.cnblogs.com/fangzhiyou/p/12509475.html