Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2004COMP 3351 Languages. Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”,

Similar presentations


Presentation on theme: "Fall 2004COMP 3351 Languages. Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”,"— Presentation transcript:

1 Fall 2004COMP 3351 Languages

2 Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”, … Defined over an alphabet:

3 Fall 2004COMP 3353 Alphabets and Strings We will use small alphabets: Strings

4 Fall 2004COMP 3354 String Operations Concatenation

5 Fall 2004COMP 3355 Reverse

6 Fall 2004COMP 3356 String Length Length: Examples:

7 Fall 2004COMP 3357 Length of Concatenation Example:

8 Fall 2004COMP 3358 The Empty String A string with no letters: Observations:

9 Fall 2004COMP 3359 Substring Substring of string: a subsequence of consecutive characters String Substring

10 Fall 2004COMP 33510 Prefix and Suffix Prefixes Suffixes prefix suffix

11 Fall 2004COMP 33511 Another Operation Example: Definition:

12 Fall 2004COMP 33512 The * Operation : the set of all possible strings from alphabet

13 Fall 2004COMP 33513 The + Operation : the set of all possible strings from alphabet except

14 Fall 2004COMP 33514 Languages A language is any subset of Example: Languages:

15 Fall 2004COMP 33515 Note that: Sets Set size String length

16 Fall 2004COMP 33516 Another Example An infinite language

17 Fall 2004COMP 33517 Operations on Languages The usual set operations Complement:

18 Fall 2004COMP 33518 Reverse Definition: Examples:

19 Fall 2004COMP 33519 Concatenation Definition: Example:

20 Fall 2004COMP 33520 Another Operation Definition: Special case:

21 Fall 2004COMP 33521 More Examples

22 Fall 2004COMP 33522 Star-Closure (Kleene *) Definition: Example:

23 Fall 2004COMP 33523 Positive Closure Definition:


Download ppt "Fall 2004COMP 3351 Languages. Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”,"

Similar presentations


Ads by Google