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

what are formal languages and compilers
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

What are Formal Languages and Compilers?

Petr Zemek

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

slide-2
SLIDE 2

What are Compilers?

What are Formal Languages and Compilers? 2 / 7

slide-3
SLIDE 3

What are Compilers?

  • Examples:
  • gcc: .c file → binary executable file
  • javac: .java file → .class file

What are Formal Languages and Compilers? 2 / 7

slide-4
SLIDE 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

slide-5
SLIDE 5

What are Compilers?

What are Formal Languages and Compilers? 3 / 7

slide-6
SLIDE 6

What are Formal Languages?

  • A language is a set of “legal” sentences.

What are Formal Languages and Compilers? 4 / 7

slide-7
SLIDE 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

slide-8
SLIDE 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

slide-9
SLIDE 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

slide-10
SLIDE 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

slide-11
SLIDE 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: {anbn : n ≥ 1}

What are Formal Languages and Compilers? 4 / 7

slide-12
SLIDE 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: {anbn : n ≥ 1}

  • there are various models for describing formal languages

What are Formal Languages and Compilers? 4 / 7

slide-13
SLIDE 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

slide-14
SLIDE 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

slide-15
SLIDE 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

slide-16
SLIDE 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

slide-17
SLIDE 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

slide-18
SLIDE 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

slide-19
SLIDE 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

slide-20
SLIDE 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

slide-21
SLIDE 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

slide-22
SLIDE 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

slide-23
SLIDE 23

Formal Languages and Compilers

How exactly do formal languages and compilers relate to each other?

What are Formal Languages and Compilers? 6 / 7

slide-24
SLIDE 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

slide-25
SLIDE 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

slide-26
SLIDE 26

Purposes of This Course

  • getting five credits :) oh yeah!

What are Formal Languages and Compilers? 7 / 7

slide-27
SLIDE 27

Purposes of This Course

  • getting five credits :) oh yeah!
  • introduce you to formal languages

What are Formal Languages and Compilers? 7 / 7

slide-28
SLIDE 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

slide-29
SLIDE 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

slide-30
SLIDE 30

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
  • improve your English skills

What are Formal Languages and Compilers? 7 / 7