Languages - PowerPoint PPT Presentation

About This Presentation
Title:

Languages

Description:

Languages Languages A language is a set of strings String: A sequence of letters Examples: cat , dog , house , Defined over an ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 79
Provided by: Cost146
Learn more at: http://www.cs.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: Languages


1
Languages
2
Languages
  • A language is a set of strings
  • String A sequence of letters
  • Examples cat, dog, house,
  • Defined over an alphabet

3
Alphabets and Strings
  • We will use small alphabets
  • Strings

4
String Operations
Concatenation
5
Reverse
6
String Length
  • Length
  • Examples

7
Recursive Definition of Length
  • For any letter
  • For any string
  • Example

8
Length of Concatenation
  • Example

9
Proof of Concatenation Length
  • Claim
  • Proof By induction on the length
  • Induction basis
  • From definition of length

10
  • Inductive hypothesis
  • for
  • Inductive step we will prove

  • for

11
Inductive Step
  • Write , where
  • From definition of length
  • From inductive hypothesis
  • Thus

12
Empty String
  • A string with no letters
  • Observations

13
Substring
  • Substring of string
  • a subsequence of consecutive characters
  • String
    Substring

14
Prefix and Suffix
  • Prefixes Suffixes

prefix
suffix
15
Another Operation
  • Example
  • Definition

16
The Operation
  • the set of all possible strings from
  • alphabet

17
The Operation
the set of all possible strings from
alphabet except
18
Language
  • A language is any subset of
  • Example
  • Languages

19
Another Example
  • An infinite language

20
Operations on Languages
  • The usual set operations
  • Complement

21
Reverse
  • Definition
  • Examples

22
Concatenation
  • Definition
  • Example

23
Another Operation
  • Definition
  • Special case

24
More Examples

25
Star-Closure (Kleene )
  • Definition
  • Example

26
Positive Closure
  • Definition

27
Finite Automata
28
Finite Automaton

Input
String
Output
Finite Automaton
String
29
Finite Accepter

Input
String
Output
Accept or Reject
Finite Automaton
30
Transition Graph

Abba -Finite Accepter
initial state
final state accept
transition
state
31
Initial Configuration

Input String
32
Reading the Input

33

34

35

36
Output accept
37
Rejection

38

39

40

41
Output reject
42
Another Example
43
(No Transcript)
44
(No Transcript)
45
(No Transcript)
46
Output accept
47
Rejection
48
(No Transcript)
49
(No Transcript)
50
(No Transcript)
51
Output reject
52
Formalities
  • Deterministic Finite Accepter (DFA)

set of states
input alphabet
transition function
initial state
set of final states
53
Input Aplhabet

54
Set of States

55
Initial State

56
Set of Final States

57
Transition Function

58

59

60
(No Transcript)
61
Transition Function

62
Extended Transition Function

63
(No Transcript)
64
(No Transcript)
65
(No Transcript)
66
Observation There is a walk from to
with label
67
Recursive Definition

68

69
Languages Accepted by DFAs
  • Take DFA
  • Definition
  • The language contains
  • all input strings accepted by
  • strings that drive to a
    final state

70
Example

accept
71
Another Example

accept
accept
accept
72
Formally
  • For a DFA
  • Language accepted by

alphabet
transition function
initial state
final states
73
Observation
  • Language accepted by
  • Language rejected by

74
More Examples

trap state
accept
75

all substrings with prefix
accept
76

all strings without substring
77
Regular Languages
  • A language is regular if there is
  • a DFA such that
  • All regular languages form a language family

78
Example
  • The language
  • is regular
Write a Comment
User Comments (0)
About PowerShow.com