1 / 36

Formal Languages Models of Computation

Formal Languages Models of Computation. Computation. memory. CPU. temporary memory. input memory. CPU. output memory. Program memory. Example:. temporary memory. input memory. CPU. output memory. Program memory. compute. compute. temporary memory. input memory. CPU.

dora
Download Presentation

Formal Languages Models of Computation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Formal Languages Models of Computation

  2. Computation memory CPU

  3. temporary memory input memory CPU output memory Program memory

  4. Example: temporary memory input memory CPU output memory Program memory compute compute

  5. temporary memory input memory CPU output memory Program memory compute compute

  6. temporary memory input memory CPU output memory Program memory compute compute

  7. temporary memory input memory CPU Program memory output memory compute compute

  8. Automaton temporary memory Automaton input memory CPU output memory Program memory

  9. Different Kinds of Automata • Automata are distinguished by the temporary memory • Finite Automata: no temporary memory • Pushdown Automata: stack • Turing Machines: random access memory

  10. Finite Automaton temporary memory input memory Finite Automaton output memory Example: Vending Machines (small computing power)

  11. Pushdown Automaton Stack Push, Pop input memory Pushdown Automaton output memory Example: Compilers for Programming Languages (medium computing power)

  12. Turing Machine Random Access Memory input memory Turing Machine output memory Examples: Any Algorithm (highest computing power)

  13. Power of Automata Finite Automata Pushdown Automata Turing Machine Less power More power Solve more computational problems

  14. Languages

  15. A language is a set of strings • String:A sequence of letters • Examples: “cat”, “dog”, “house”,… • Defined over an alphabet:

  16. Alphabets and Strings • We will use small alphabets: • Strings

  17. String Operations Concatenation

  18. Reverse

  19. String Length • Length: • Examples:

  20. Length of Concatenation • Example:

  21. Empty String • A string with no letters: • Observations:

  22. Substring • Substring of string: • a subsequence of consecutive characters • String Substring

  23. Prefix and Suffix • Prefixes Suffixes prefix suffix

  24. Another Operation • Example: • Definition:

  25. The * Operation • : the set of all possible strings from • alphabet

  26. The + Operation : the set of all possible strings from alphabet except

  27. Languages • A language is any subset of • Example: • Languages:

  28. Note that: Sets Set size Set size String length

  29. Another Example • An infinite language

  30. Operations on Languages • The usual set operations • Complement:

  31. Reverse • Definition: • Examples:

  32. Concatenation • Definition: • Example:

  33. Another Operation • Definition: • Special case:

  34. More Examples

  35. Star-Closure (Kleene *) • Definition: • Example:

  36. Positive Closure • Definition:

More Related