introduction to computational theory
Download
Skip this Video
Download Presentation
Introduction to Computational Theory

Loading in 2 Seconds...

play fullscreen
1 / 30

Introduction to Computational Theory - PowerPoint PPT Presentation


  • 118 Views
  • Uploaded on

Introduction to Computational Theory. Chapter 6. Front pad. Rear pad. Front, Rear, Both. Rear, Both, Neither. Front. closed. open. Neither. Automatic Door/FA. Nondeterministic. When the ultimate path through a machine is not determined by input alone the machine is nondeterministic .

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Introduction to Computational Theory' - Jims


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
introduction to computational theory

Introductionto Computational Theory

Chapter 6

Cohen, Chapter 6

automatic door fa

Frontpad

Rearpad

Front,Rear,Both

Rear,Both,Neither

Front

closed

open

Neither

Automatic Door/FA

Cohen, Chapter 6

nondeterministic
Nondeterministic

When the ultimate path through a machine is not determined by input alone the machine is nondeterministic.

Cohen, Chapter 6

preamble to chapter 6
Preamble to Chapter 6
  • NFAs
    • Non-deterministic finite automata
    • Vs. DFAs (deterministic – the book calls FAs)
  • We allow multiple transitions per letter per state
    • Including “lambda-transitions”
      • Move on a whim (w/o consuming input)
    • Accept if a path exists to a final state
  • Transition relation:

Cohen, Chapter 6

slide5

a,b

+

a,b

a

a

a

a

-

+

-

a

a,b

a

+

a

a

+

-

b

b

a,b

Examples

Cohen, Chapter 6

why non determinism
Why Non-determinism?
  • More expressive model
  • Easier to find machines for a language
    • E.g., unions of two languages/machines

Cohen, Chapter 6

examples
Examples
  • (ab + aba)*
  • Language over {a b} where last symbol is repeated

Cohen, Chapter 6

nfa dfa equivalence
NFA – DFA Equivalence
  • There is an algorithm to convert a NFA to a DFA
  • Just track all the possibilities
    • Collapse lambda moves
  • States are a subset of 2Q
  • “Rabin-Scott” Algorithm
  • Example: a+c*b*

Cohen, Chapter 6

lambda transitions
Lambda Transitions
  • Handy for combining machines
    • E.g., union of two languages: create a new start state with lambda moves to the start states of the two machines

Cohen, Chapter 6

slide10

a,b

x2

b

a

x4

x1

-

+

b

a

x3

a,b

Examples

Cohen, Chapter 6

slide11

x2

b

b

b

b

x4

x1

-

+

x3

Examples

Cohen, Chapter 6

slide12

x2

a,b

a,b

b

b

x3

+

x1

-

Examples

Cohen, Chapter 6

slide13

x7

x6

x5

x2

x1

-

x3

a

a,b

a,b

a

a

+

b

b

b

Examples

Cohen, Chapter 6

transition graphs

-

+

-

+

baa

baa

All else

a,b

All else

a,b

Transition Graphs

Abandon the requirement that the edges eat just one letter at a time.

Cohen, Chapter 6

crashes formerly hell state or jail
Crashes (Formerly, Hell State or Jail)

When an input string that has not been completely read reaches a state (final or otherwise) that it cannot leave because there is no outgoing edge that it may follow, we say that the input (or the machine) crashes at that state.

Cohen, Chapter 6

rejected input

-

+

a,b

aa, bb

a,b

Rejected Input
  • Trace a path ending in a non-final state
  • Crash while being processed

baa

Cohen, Chapter 6

acceptance
Acceptance

A string is accepted by a TG if there is some way it could be processed as to arrive at a final state.

There may also be ways in which this string does not get to a final state, but we ignore all failures.

Cohen, Chapter 6

transition graph
Transition Graph

A collection of three things:

1. A finite set of states, at least one of which is designated as the start state (-) and some (maybe none) of which are designated as final states (+)

2. An alphabet of possible input letters from which input strings are formed.

3. A finite set of transitions (edge labels) that show how to go from some states to some others, based on reading specified substrings of input letters (possibly even the null string )

Cohen, Chapter 6

successful path

2

3

Free Ride

Successful Path

A successful path through a transition graph is a series of edges forming a path beginning at some start state (there may be several) and ending at a final state.

abbab…

abbaa…

abb

a

abbababba

1-

4+

aa

b

A Lambda transition occurs when you get a free transition that was not initiated by user or system action/interaction. Move on a whim (w/o consuming input).Slide modified by Seals

Cohen, Chapter 6

equivalent language acceptors

a

1-

3-

2-

1

2

3

b

-

+

aba

a

b

+

aba

Equivalent Language Acceptors

Cohen, Chapter 6

examples1

-

-

+

-

-

abba

baa

Examples

Cohen, Chapter 6

examples2

-

+

+

+

bb

a

a,b

-

+

Examples

Cohen, Chapter 6

examples3

-

+

-

+

TG

a,b

a

b

b

b

FA

a

Examples

(a + b)*b

Cohen, Chapter 6

examples4

+

+

-

a,b

b

a

a,b

b

a

Examples

Cohen, Chapter 6

examples even even cf p 69

aa,bb

aa,bb

ab.ba

ab.ba

Examples(EVEN-EVEN; cf. p. 69)

Cohen, Chapter 6

example p 84
Example(p. 84)

b

a,b

a

b

-

+

bbb

a

a

a

ab

b

bbb

bb

bb

a

Cohen, Chapter 6

examples p 85

a

a

-

+

a

-

a

+

+

Examples(p. 85)

Cohen, Chapter 6

example problem 17 p 91
Example(Problem 17, p. 91)
  • L = {a abb bbaab bbbaa}
  • 1) given a FA that accepts L, construct a TG that accepts transpose(L)
    • Invert start/final states; reverse arrows
  • 2) given a TG that accepts L, construct a TG that accepts transpose(L)
    • Same as 1, but reverse transition strings

Cohen, Chapter 6

generalized transition graph gtg
GeneralizedTransition Graph (GTG)

A collection of three things:

1. A finite set of states, at least one of which is designated as the start state (-) and some (maybe none) of which are designated as final states (+)

2. An alphabet of possible input letters from which input strings are formed.

3. Directed edges connecting some pairs of states, each labeled with a regular expression.

Cohen, Chapter 6

examples5

L2

2

L1

L3

L5

1-

3+

L4

a

(ab + a)*

a

+

Examples

Cohen, Chapter 6

ad