Download presentation
Presentation is loading. Please wait.
Published byLora Bradley Modified over 9 years ago
1
1 Languages
2
2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet:
3
3 Alphabets and Strings We will use small alphabets: Strings
4
4 String Operations Concatenation
5
5 Reverse
6
6 String Length Length: Examples:
7
7 Length of Concatenation Example:
8
8 Empty String A string with no letters: Observations:
9
9 Substring Substring of string: a subsequence of consecutive characters String Substring
10
10 Prefix and Suffix Prefixes Suffixes prefix suffix
11
11 Another Operation Example: Definition:
12
12 The * Operation : the set of all possible strings from alphabet
13
13 The + Operation : the set of all possible strings from alphabet except
14
14 Languages A language is any subset of Example: Languages:
15
15 Note that: Sets Set size String length
16
16 Another Example An infinite language
17
17 Operations on Languages The usual set operations Complement:
18
18 Reverse Definition: Examples:
19
19 Concatenation Definition: Example:
20
20 Another Operation Definition: Special case:
21
21 More Examples
22
22 Star-Closure (Kleene *) Definition: Example:
23
23 Positive Closure Definition:
24
24 Exercise {a,ba}*
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.