Download presentation
Presentation is loading. Please wait.
Published byHomer Foster Modified over 9 years ago
1
Fall 2006Costas Busch - RPI1 Languages
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:
3
Fall 2006Costas Busch - RPI3 Languages are used to describe computation problems: Alphabet:
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
5
Fall 2006Costas Busch - RPI5 Decimal numbers alphabet Binary numbers alphabet
6
Fall 2006Costas Busch - RPI6 Unary numbers alphabet Unary number: Decimal number:
7
Fall 2006Costas Busch - RPI7 String Operations Concatenation
8
Fall 2006Costas Busch - RPI8 Reverse
9
Fall 2006Costas Busch - RPI9 String Length Length: Examples:
10
Fall 2006Costas Busch - RPI10 Length of Concatenation Example:
11
Fall 2006Costas Busch - RPI11 Empty String A string with no letters is denoted: Observations:
12
Fall 2006Costas Busch - RPI12 Substring Substring of string: a subsequence of consecutive characters String Substring
13
Fall 2006Costas Busch - RPI13 Prefix and Suffix Prefixes Suffixes prefix suffix
14
Fall 2006Costas Busch - RPI14 Another Operation Example: Definition:
15
Fall 2006Costas Busch - RPI15 The * Operation : the set of all possible strings from alphabet
16
Fall 2006Costas Busch - RPI16 The + Operation : the set of all possible strings from alphabet except
17
Fall 2006Costas Busch - RPI17 Languages A language over alphabet is any subset of Examples: Language:
18
Fall 2006Costas Busch - RPI18 More Language Examples An infinite language Alphabet
19
Fall 2006Costas Busch - RPI19 Prime numbers Alphabet Language:
20
Fall 2006Costas Busch - RPI20 Even and odd numbers Alphabet
21
Fall 2006Costas Busch - RPI21 Unary Addition Alphabet: Language:
22
Fall 2006Costas Busch - RPI22 Squares Alphabet: Language:
23
Fall 2006Costas Busch - RPI23 Note that: Sets Set size String length
24
Fall 2006Costas Busch - RPI24 Operations on Languages The usual set operations Complement:
25
Fall 2006Costas Busch - RPI25 Reverse Definition: Examples:
26
Fall 2006Costas Busch - RPI26 Concatenation Definition: Example:
27
Fall 2006Costas Busch - RPI27 Another Operation Definition: Special case:
28
Fall 2006Costas Busch - RPI28
29
Fall 2006Costas Busch - RPI29 Star-Closure (Kleene *) All strings that can be constructed from Definition: Example:
30
Fall 2006Costas Busch - RPI30 Positive Closure Definition: Same with but without the
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.