Docsity

Understanding Formal Languages & Abstract Machine Models in Computer Science, Slides of Computer Science

Partial preview of the text

Download Understanding Formal Languages & Abstract Machine Models in Computer Science and more Slides Computer Science in PDF only on Docsity!

1

Computability

2

Computability Concepts

AIM: Reduce Computer Science to its bare theoretical essentials. APPROACH: Algorithmic Problems  Formal Languages

4

Computability Concepts

AIM: Reduce Computer Science to its bare theoretical essentials. Algorithmic Problems  Formal Languages Computers  Graph based machine models Questions to investigate:

  1. What sorts of problems can be solved by each computer model?
  2. What languages does each model accept?
  3. What are the practical limits on what a computer can do?

5

Abstract Machine Models

DFA’s

DFA’s model computers with strictly bounded memory. 1 3 2 a b b a a,b

7

Abstract Machine Models

DFA’s

A: a*b

1 3 2 a b b a a,b

8

Abstract Machine Models

NFA’s

Nondeterminism is a powerful concept. Often 1 st view of a problem is nondeterministic. 1 3 2 a a b a a,b

10

Abstract Machine Models

NFA’s

A: a

b* 1 3 2 a a b a a,b

11

Abstract Machine Models

PDA’s

By allowing a pushdown stack, increase flexibility and accept more languages. 1 2 3 a,eX e,ee b,Xe 0 e,e$ e,$e

13

Abstract Machine Models

PDA’s

A: {a n b n

| n  0}

1 2 3 a,eX e,ee b,Xe 0 e,e$ e,$e

14

Abstract Machine Models

TM’s

By allowing a read-write tape, amazingly get most general possible computer model! 1 2

XR

0

1 $,R

L

acc 4 3 XL

$L

1 L

$R

1 X,R

1 R

XR

XL

(^5 1) L 1|XL

16

Abstract Machine Models

TM’s

A: Unary powers of 2. 1 2

XR

0

1 $,R

L

acc 4 3 XL

$L

1 L

$R

1 X,R

1 R

XR

XL

(^5 1) L 1|XL

17

I/O Versions

Each class of languages has its own I/O version. Regular:  Finite State Transducers  More powerful models exist (e.g. with e’s) Context free: (didn’t study any)  “Compilers”: Input is a string, output is a parse-tree (or even executable code) Turing Machines:  I/O TM’s

19

System Design

Often computer system creation involves designing a formal language to describe system communication. Components receive communication streams and have to effect actions based on these. Computability theory can help drive design at a high level. EG: Might come up with a communication stream that’s seems like regular language. Could then show that it isn’t using pumping lemma. With this knowledge, final design tweaks original to obtain a regular language and therefore DFA based ultra-fast and super-reliable system components!

20

Negative Examples

As above, it is very important to be able to tell when particular languages cannot be accepted by a certain model of computation. We have several tools at our disposal: Irregularity: pumping lemma (PL) Non-Context-Freeness: CFPL Undecidability: Reductions from undecidable languages Intractability: Poly-time reduction from NP - hard languages