Fall 2004COMP 3351 Languages
Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”, … Defined over an alphabet:
Fall 2004COMP 3353 Alphabets and Strings We will use small alphabets: Strings
Fall 2004COMP 3354 String Operations Concatenation
Fall 2004COMP 3355 Reverse
Fall 2004COMP 3356 String Length Length: Examples:
Fall 2004COMP 3357 Length of Concatenation Example:
Fall 2004COMP 3358 The Empty String A string with no letters: Observations:
Fall 2004COMP 3359 Substring Substring of string: a subsequence of consecutive characters String Substring
Fall 2004COMP Prefix and Suffix Prefixes Suffixes prefix suffix
Fall 2004COMP Another Operation Example: Definition:
Fall 2004COMP The * Operation : the set of all possible strings from alphabet
Fall 2004COMP The + Operation : the set of all possible strings from alphabet except
Fall 2004COMP Languages A language is any subset of Example: Languages:
Fall 2004COMP Note that: Sets Set size String length
Fall 2004COMP Another Example An infinite language
Fall 2004COMP Operations on Languages The usual set operations Complement:
Fall 2004COMP Reverse Definition: Examples:
Fall 2004COMP Concatenation Definition: Example:
Fall 2004COMP Another Operation Definition: Special case:
Fall 2004COMP More Examples
Fall 2004COMP Star-Closure (Kleene *) Definition: Example:
Fall 2004COMP Positive Closure Definition: