fall 2006costas busch - rpi1 languages. fall 2006costas busch - rpi2 language: a set of strings...

Download Fall 2006Costas Busch - RPI1 Languages. Fall 2006Costas Busch - RPI2 Language: a set of strings String: a sequence of symbols from some alphabet Example:

Post on 22-Dec-2015

213 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • Slide 1
  • Fall 2006Costas Busch - RPI1 Languages
  • Slide 2
  • Fall 2006Costas Busch - RPI2 Language: a set of strings String: a sequence of symbols from some alphabet Example: Strings: cat, dog, house Language: {cat, dog, house} Alphabet:
  • Slide 3
  • Fall 2006Costas Busch - RPI3 Languages are used to describe computation problems: Alphabet:
  • Slide 4
  • Fall 2006Costas Busch - RPI4 Alphabets and Strings Example Strings Example Alphabet: An alphabet is a set of symbols A string is a sequence of symbols from the alphabet
  • Slide 5
  • Fall 2006Costas Busch - RPI5 Decimal numbers alphabet Binary numbers alphabet
  • Slide 6
  • Fall 2006Costas Busch - RPI6 Unary numbers alphabet Unary number: Decimal number:
  • Slide 7
  • Fall 2006Costas Busch - RPI7 String Operations Concatenation
  • Slide 8
  • Fall 2006Costas Busch - RPI8 Reverse
  • Slide 9
  • Fall 2006Costas Busch - RPI9 String Length Length: Examples:
  • Slide 10
  • Fall 2006Costas Busch - RPI10 Length of Concatenation Example:
  • Slide 11
  • Fall 2006Costas Busch - RPI11 Empty String A string with no letters is denoted: Observations:
  • Slide 12
  • Fall 2006Costas Busch - RPI12 Substring Substring of string: a subsequence of consecutive characters String Substring
  • Slide 13
  • Fall 2006Costas Busch - RPI13 Prefix and Suffix Prefixes Suffixes prefix suffix
  • Slide 14
  • Fall 2006Costas Busch - RPI14 Another Operation Example: Definition:
  • Slide 15
  • Fall 2006Costas Busch - RPI15 The * Operation : the set of all possible strings from alphabet
  • Slide 16
  • Fall 2006Costas Busch - RPI16 The + Operation : the set of all possible strings from alphabet except
  • Slide 17
  • Fall 2006Costas Busch - RPI17 Languages A language over alphabet is any subset of Examples: Language:
  • Slide 18
  • Fall 2006Costas Busch - RPI18 More Language Examples An infinite language Alphabet
  • Slide 19
  • Fall 2006Costas Busch - RPI19 Prime numbers Alphabet Language:
  • Slide 20
  • Fall 2006Costas Busch - RPI20 Even and odd numbers Alphabet
  • Slide 21
  • Fall 2006Costas Busch - RPI21 Unary Addition Alphabet: Language:
  • Slide 22
  • Fall 2006Costas Busch - RPI22 Squares Alphabet: Language:
  • Slide 23
  • Fall 2006Costas Busch - RPI23 Note that: Sets Set size String length
  • Slide 24
  • Fall 2006Costas Busch - RPI24 Operations on Languages The usual set operations Complement:
  • Slide 25
  • Fall 2006Costas Busch - RPI25 Reverse Definition: Examples:
  • Slide 26
  • Fall 2006Costas Busch - RPI26 Concatenation Definition: Example:
  • Slide 27
  • Fall 2006Costas Busch - RPI27 Another Operation Definition: Special case:
  • Slide 28
  • Fall 2006Costas Busch - RPI28
  • Slide 29
  • Fall 2006Costas Busch - RPI29 Star-Closure (Kleene *) All strings that can be constructed from Definition: Example:
  • Slide 30
  • Fall 2006Costas Busch - RPI30 Positive Closure Definition: Same with but without the