Download presentation
Presentation is loading. Please wait.
Published byDoreen McDaniel Modified over 9 years ago
1
Costas Busch - LSU1 Languages
2
Costas Busch - LSU2 Language: a set of strings String: a sequence of symbols from some alphabet Example: Strings: cat, dog, house Language: {cat, dog, house} Alphabet:
3
Costas Busch - LSU3 Languages are used to describe computation problems: Alphabet:
4
Costas Busch - LSU4 Computation is translated to set membership Is number prime? Example computation problem: Equivalent set membership problem:
5
Costas Busch - LSU5 Alphabets and Strings Example Strings Example Alphabet: An alphabet is a set of symbols A string is a sequence of symbols from the alphabet String variables
6
Costas Busch - LSU6 Decimal numbers alphabet Binary numbers alphabet
7
Costas Busch - LSU7 Unary numbers alphabet Unary number: Decimal number:
8
Costas Busch - LSU8 String Operations Concatenation
9
Costas Busch - LSU9 Reverse
10
Costas Busch - LSU10 String Length Length: Examples:
11
Costas Busch - LSU11 Length of Concatenation Example:
12
Costas Busch - LSU12 A string with no letters is denoted: Acts as a neutral element Observations: Empty String
13
Costas Busch - LSU13 Substring Substring of string: a subsequence of consecutive characters String Substring
14
Costas Busch - LSU14 Prefix and Suffix Prefixes Suffixes prefix suffix string
15
Costas Busch - LSU15 Exponent Operation Example: Definition:
16
Costas Busch - LSU16 The * Operation : the set of all possible strings from alphabet
17
Costas Busch - LSU17 The + Operation : the set of all possible strings from alphabet except
18
Costas Busch - LSU18 Languages A language over alphabet is any subset of Example: Language:
19
Costas Busch - LSU19 More Language Examples An infinite language Alphabet
20
Costas Busch - LSU20 Prime numbers Alphabet Language:
21
Costas Busch - LSU21 Even and odd numbers Alphabet Languages:
22
Costas Busch - LSU22 Addition (of unary numbers) Alphabet: Language:
23
Costas Busch - LSU23 Squares (of unary numbers) Alphabet: Language:
24
Costas Busch - LSU24 Two special languages Size of a language (number of elements): Empty language Language with empty string
25
Costas Busch - LSU25 Note that: Sets Set size String length
26
Costas Busch - LSU26 Operations on Languages The usual set operations Complement:
27
Costas Busch - LSU27 Reverse Definition: Examples:
28
Costas Busch - LSU28 Concatenation Definition: Example:
29
Costas Busch - LSU29 Another Operation Definition: Special case:
30
Costas Busch - LSU30 Example
31
Costas Busch - LSU31 Star-Closure (Kleene *) All strings that can be constructed from Definition: Example:
32
Costas Busch - LSU32 Positive Closure Definition:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.