what are formal languages and compilers
play

What are Formal Languages and Compilers? Petr Zemek Brno - PowerPoint PPT Presentation

What are Formal Languages and Compilers? Petr Zemek Brno University of Technology, Faculty of Information Technology zet Bo echova 2, 612 00 Brno, CZ http://www.fit.vutbr.cz/ izemek Formal Languages and Compilers, 2013 What are


  1. What are Formal Languages and Compilers? Petr Zemek Brno University of Technology, Faculty of Information Technology zetˇ Boˇ echova 2, 612 00 Brno, CZ http://www.fit.vutbr.cz/ ∼ izemek Formal Languages and Compilers, 2013

  2. What are Compilers? What are Formal Languages and Compilers? 2 / 7

  3. What are Compilers? • Examples: • gcc : .c file → binary executable file • javac : .java file → .class file What are Formal Languages and Compilers? 2 / 7

  4. What are Compilers? • Examples: • gcc : .c file → binary executable file • javac : .java file → .class file • typically high-level code → low-level code What are Formal Languages and Compilers? 2 / 7

  5. What are Compilers? What are Formal Languages and Compilers? 3 / 7

  6. What are Formal Languages? • A language is a set of “legal” sentences. What are Formal Languages and Compilers? 4 / 7

  7. What are Formal Languages? • A language is a set of “legal” sentences. • A sentence is a sequence of symbols. What are Formal Languages and Compilers? 4 / 7

  8. What are Formal Languages? • A language is a set of “legal” sentences. • A sentence is a sequence of symbols. • The symbols can be characters, words, punctuation, hieroglyphs, dots and dashes (Morse code), etc. What are Formal Languages and Compilers? 4 / 7

  9. What are Formal Languages? • A language is a set of “legal” sentences. • A sentence is a sequence of symbols. • The symbols can be characters, words, punctuation, hieroglyphs, dots and dashes (Morse code), etc. • A formal language is a language defined by a finite set of unambiguous rules delimiting the legal sentences from the illegal ones. What are Formal Languages and Compilers? 4 / 7

  10. What are Formal Languages? • A language is a set of “legal” sentences. • A sentence is a sequence of symbols. • The symbols can be characters, words, punctuation, hieroglyphs, dots and dashes (Morse code), etc. • A formal language is a language defined by a finite set of unambiguous rules delimiting the legal sentences from the illegal ones. Example Rules: S → aSb , S → ab Starting symbol: S Terminal symbols: a , b What are Formal Languages and Compilers? 4 / 7

  11. What are Formal Languages? • A language is a set of “legal” sentences. • A sentence is a sequence of symbols. • The symbols can be characters, words, punctuation, hieroglyphs, dots and dashes (Morse code), etc. • A formal language is a language defined by a finite set of unambiguous rules delimiting the legal sentences from the illegal ones. Example Rules: S → aSb , S → ab Starting symbol: S Terminal symbols: a , b The formal language: { a n b n : n ≥ 1 } What are Formal Languages and Compilers? 4 / 7

  12. What are Formal Languages? • A language is a set of “legal” sentences. • A sentence is a sequence of symbols. • The symbols can be characters, words, punctuation, hieroglyphs, dots and dashes (Morse code), etc. • A formal language is a language defined by a finite set of unambiguous rules delimiting the legal sentences from the illegal ones. Example Rules: S → aSb , S → ab Starting symbol: S Terminal symbols: a , b The formal language: { a n b n : n ≥ 1 } • there are various models for describing formal languages What are Formal Languages and Compilers? 4 / 7

  13. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) What are Formal Languages and Compilers? 5 / 7

  14. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages What are Formal Languages and Compilers? 5 / 7

  15. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers What are Formal Languages and Compilers? 5 / 7

  16. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) What are Formal Languages and Compilers? 5 / 7

  17. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) • modeling and simulation of biological organisms (plant development) What are Formal Languages and Compilers? 5 / 7

  18. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) • modeling and simulation of biological organisms (plant development) • molecular genetics What are Formal Languages and Compilers? 5 / 7

  19. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) • modeling and simulation of biological organisms (plant development) • molecular genetics • coding theory and cryptography What are Formal Languages and Compilers? 5 / 7

  20. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) • modeling and simulation of biological organisms (plant development) • molecular genetics • coding theory and cryptography • natural language processing What are Formal Languages and Compilers? 5 / 7

  21. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) • modeling and simulation of biological organisms (plant development) • molecular genetics • coding theory and cryptography • natural language processing • design of embedded systems What are Formal Languages and Compilers? 5 / 7

  22. Why are Formal Languages Interesting? Theoretical viewpoint: • underly many areas of theoretical computer science (logic, complexity theory, automata theory, etc.) • provide formal models for describing formal languages Practical viewpoint: they have applications in many areas, like • description of programming languages, compilers • computer-aided art (turtle graphics, fractals) • modeling and simulation of biological organisms (plant development) • molecular genetics • coding theory and cryptography • natural language processing • design of embedded systems • ... and many other What are Formal Languages and Compilers? 5 / 7

  23. Formal Languages and Compilers How exactly do formal languages and compilers relate to each other? What are Formal Languages and Compilers? 6 / 7

  24. Formal Languages and Compilers How exactly do formal languages and compilers relate to each other? To build a compiler, we 1 specify our programming language by using formal models What are Formal Languages and Compilers? 6 / 7

  25. Formal Languages and Compilers How exactly do formal languages and compilers relate to each other? To build a compiler, we 1 specify our programming language by using formal models 2 turn these models into an implementation of the compiler What are Formal Languages and Compilers? 6 / 7

  26. Purposes of This Course • getting five credits :) oh yeah! What are Formal Languages and Compilers? 7 / 7

  27. Purposes of This Course • getting five credits :) oh yeah! • introduce you to formal languages What are Formal Languages and Compilers? 7 / 7

  28. Purposes of This Course • getting five credits :) oh yeah! • introduce you to formal languages • introduce you to compiler construction What are Formal Languages and Compilers? 7 / 7

  29. Purposes of This Course • getting five credits :) oh yeah! • introduce you to formal languages • introduce you to compiler construction • see applications of mathematics in computer science What are Formal Languages and Compilers? 7 / 7

Recommend


More recommend