1 / 30

Languages

Languages. Language: a set of strings String: a sequence of symbols from some alphabet Example: Strings: cat, dog, house Language: {cat, dog, house}. Alphabet:. Languages are used to describe computation problems:. Alphabet:. Alphabets and Strings.

Download Presentation

Languages

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. Languages Costas Busch - RPI

  2. Language: a set of strings • String:a sequence of symbols • from some alphabet • Example: • Strings: cat, dog, house • Language: {cat, dog, house} Alphabet: Costas Busch - RPI

  3. Languages are used to describe computation problems: Alphabet: Costas Busch - RPI

  4. Alphabets and Strings An alphabet is a set of symbols Example Alphabet: A string is a sequence of symbols from the alphabet Example Strings Costas Busch - RPI

  5. Decimal numbers alphabet Binary numbers alphabet Costas Busch - RPI

  6. Unary numbers alphabet Unary number: Decimal number: Costas Busch - RPI

  7. String Operations Concatenation Costas Busch - RPI

  8. Reverse Costas Busch - RPI

  9. String Length • Length: • Examples: Costas Busch - RPI

  10. Length of Concatenation • Example: Costas Busch - RPI

  11. Empty String • A string with no letters is denoted: • Observations: Costas Busch - RPI

  12. Substring • Substring of string: • a subsequence of consecutive characters • String Substring Costas Busch - RPI

  13. Prefix and Suffix • Prefixes Suffixes prefix suffix Costas Busch - RPI

  14. Another Operation • Example: • Definition: Costas Busch - RPI

  15. The * Operation • : the set of all possible strings from • alphabet Costas Busch - RPI

  16. The + Operation : the set of all possible strings from alphabet except Costas Busch - RPI

  17. Languages • A language over alphabet • is any subset of • Examples: Language: Language: Language: Costas Busch - RPI

  18. More Language Examples • An infinite language Alphabet Costas Busch - RPI

  19. Prime numbers Alphabet Language: Costas Busch - RPI

  20. Even and odd numbers Alphabet Costas Busch - RPI

  21. Unary Addition Alphabet: Language: Costas Busch - RPI

  22. Squares Alphabet: Language: Costas Busch - RPI

  23. Note that: Sets Set size Set size String length Costas Busch - RPI

  24. Operations on Languages • The usual set operations • Complement: Costas Busch - RPI

  25. Reverse • Definition: • Examples: Costas Busch - RPI

  26. Concatenation • Definition: • Example: Costas Busch - RPI

  27. Another Operation • Definition: • Special case: Costas Busch - RPI

  28. Costas Busch - RPI

  29. Star-Closure (Kleene *) • All strings that can be constructed from • Definition: • Example: Costas Busch - RPI

  30. Positive Closure • Definition: Same with but without the Costas Busch - RPI

More Related