automata and formal languages
play

Automata and Formal Languages Grammars Regular Expressions - PowerPoint PPT Presentation

Automata and Formal Languages Peter Wood Motivation and Background Automata Automata and Formal Languages Grammars Regular Expressions Example of Peter Wood Research Conclusion Department of Computer Science and Information Systems


  1. Automata and Formal Languages Peter Wood Motivation and Background Automata Automata and Formal Languages Grammars Regular Expressions Example of Peter Wood Research Conclusion Department of Computer Science and Information Systems Birkbeck, University of London ptw@dcs.bbk.ac.uk

  2. Automata and Outline Formal Languages Peter Wood Motivation and Motivation and Background Background Automata Grammars Automata Regular Expressions Example of Grammars Research Conclusion Regular Expressions Example of Research Conclusion

  3. Automata and Doing Research Formal Languages Peter Wood Motivation and Background Automata ◮ analysing problems/languages Grammars ◮ computability/solvability/decidability Regular Expressions — is there an algorithm? Example of ◮ computational complexity Research Conclusion — is it practical? ◮ expressive power — are there things that cannot be expressed? ◮ formal languages provide well-studied models

  4. Automata and Formal Languages Formal Languages Peter Wood ◮ given a finite alphabet (set) of symbols Σ Motivation and Background — e.g., Σ = { 0 , 1 } Automata ◮ a string is a sequence (concatenation) of symbols Grammars — e.g., 0101 Regular Expressions ◮ all finite strings over Σ are denoted by Σ ∗ Example of — e.g., Σ ∗ = { ǫ, 0 , 1 , 00 , 01 , 10 , 11 , . . . } Research Conclusion ◮ language L over Σ is just a subset of Σ ∗ — e.g., L 1 : strings with an even number of 1’s — e.g., L 0 : strings representing valid Java programs (over an alphabet of all legal symbols in Java) ◮ are there finite representations for infinite languages?

  5. Automata and Formal Languages Formal Languages Peter Wood ◮ given a finite alphabet (set) of symbols Σ Motivation and Background — e.g., Σ = { 0 , 1 } Automata ◮ a string is a sequence (concatenation) of symbols Grammars — e.g., 0101 Regular Expressions ◮ all finite strings over Σ are denoted by Σ ∗ Example of — e.g., Σ ∗ = { ǫ, 0 , 1 , 00 , 01 , 10 , 11 , . . . } Research Conclusion ◮ language L over Σ is just a subset of Σ ∗ — e.g., L 1 : strings with an even number of 1’s — e.g., L 0 : strings representing valid Java programs (over an alphabet of all legal symbols in Java) ◮ are there finite representations for infinite languages? ◮ yes, grammars (generative) and automata (recognition)

  6. Automata and Automata Formal Languages Peter Wood Motivation and Background ◮ device (machine) for recognising (accepting) a Automata language Grammars ◮ provide models of computation Regular Expressions ◮ automaton comprises states and transitions between Example of Research states Conclusion ◮ automaton is given a string as input ◮ automaton M accepts a string w by halting in an accept state, when given w as input ◮ language L ( M ) accepted by automaton M is the set of all strings which M accepts

  7. Automata and Types of Automata Formal Languages Peter Wood Motivation and Background Automata Grammars ◮ finite state automaton Regular ◮ deterministic Expressions ◮ nondeterministic Example of Research ◮ pushdown automaton Conclusion ◮ linear-bounded automaton ◮ Turing machine

  8. Automata and Example of a Finite State Automaton Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be recognised by the following FSA Motivation and Background ◮ 2 states s even and s odd Automata ◮ 4 transitions Grammars ◮ s even is both the initial and final state Regular Expressions Example of 0 0 Research 1 Conclusion s even s odd 1 ◮ FSA recognises 011:

  9. Automata and Example of a Finite State Automaton Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be recognised by the following FSA Motivation and Background ◮ 2 states s even and s odd Automata ◮ 4 transitions Grammars ◮ s even is both the initial and final state Regular Expressions Example of 0 0 Research 1 Conclusion s even s even s odd 1 ◮ FSA recognises 011:

  10. Automata and Example of a Finite State Automaton Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be recognised by the following FSA Motivation and Background ◮ 2 states s even and s odd Automata ◮ 4 transitions Grammars ◮ s even is both the initial and final state Regular Expressions Example of 0 0 Research 1 Conclusion s even s even s odd 1 ◮ FSA recognises 011: 0

  11. Automata and Example of a Finite State Automaton Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be recognised by the following FSA Motivation and Background ◮ 2 states s even and s odd Automata ◮ 4 transitions Grammars ◮ s even is both the initial and final state Regular Expressions Example of 0 0 Research 1 Conclusion s even s odd s odd 1 ◮ FSA recognises 011: 01

  12. Automata and Example of a Finite State Automaton Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be recognised by the following FSA Motivation and Background ◮ 2 states s even and s odd Automata ◮ 4 transitions Grammars ◮ s even is both the initial and final state Regular Expressions Example of 0 0 Research 1 Conclusion s even s even s odd 1 ◮ FSA recognises 011: 011

  13. Automata and Grammars Formal Languages Peter Wood Motivation and ◮ grammars generate languages using: Background ◮ symbols from alphabet Σ (called terminals ) Automata ◮ set N of nonterminals (one designated as starting ) Grammars ◮ set P of productions , each of the form Regular Expressions Example of U → V Research Conclusion where U and V are (loosely) strings over Σ ∪ N ◮ a string (sequence of terminals) w is generated by G if there is a derivation of w using G , starting from the starting nonterminal of G ◮ language generated by grammar G , denoted L ( G ) , is the set of strings which can be derived using G

  14. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal

  15. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal ◮ a derivation of 01010 is given by S ⇒ 0 S

  16. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal ◮ a derivation of 01010 is given by S ⇒ 0 S ⇒ 01 T

  17. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal ◮ a derivation of 01010 is given by S ⇒ 0 S ⇒ 01 T ⇒ 010 T

  18. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal ◮ a derivation of 01010 is given by S ⇒ 0 S ⇒ 01 T ⇒ 010 T ⇒ 0101 S

  19. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal ◮ a derivation of 01010 is given by S ⇒ 0 S ⇒ 01 T ⇒ 010 T ⇒ 0101 S ⇒ 01010 S

  20. Automata and Grammar Example Formal Languages Peter Wood ◮ L 1 (strings with an even number of 1’s) can be Motivation and generated by a grammar with productions Background Automata S → ǫ Grammars S → 0 S Regular Expressions S → 1 T Example of Research T → 0 T Conclusion T → 1 S where S is the starting nonterminal ◮ a derivation of 01010 is given by S ⇒ 0 S ⇒ 01 T ⇒ 010 T ⇒ 0101 S ⇒ 01010 S ⇒ 01010

  21. Automata and Uses of Grammars Formal Languages Peter Wood Motivation and Background Automata Grammars ◮ to specify syntax of programming languages Regular ◮ in natural language understanding Expressions Example of ◮ in pattern recognition Research Conclusion ◮ to specify schemas (types) for tree-structured data, e.g., XML ◮ . . .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend