cs314: formal languages and automata theory€¦ · cs314: formal languages and automata theory l....

19
Chapter 6. Advanced topics in computability theory CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN

Upload: others

Post on 18-Aug-2020

35 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

Chapter 6. Advanced topics in computability theory

CS314: FORMAL LANGUAGES

AND AUTOMATA THEORY L. NADA ALZABEN

Page 2: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

Quick Note

Cs314pnu.wordpress.com

Computer Science Department

2

Page 3: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.1 The recursion theory

It concerns the possibility of making machines that can

construct replicas of themselves.

To consider the recursion theory:

1. Living things are machines • (modern biology assumption ,operate in a mechanistic way).

2. Living things can self-reproduce

• (essential characteristic of every biology species).

3. Machines cannot self-reproduce • (assuming the reproducing of machines by themselves is false, ex. SELF TM)

Page 4: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

SELF - REFERENCE

Make a Turing machine that ignores its input and print outs

a copy of its own description , we call it SELF.

Page 5: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

SELF - REFERENCE

The job of A is to print out a description of B, and conversely

the job of B is to print out a description of A.

The result is the desired description of SELF.

The jobs are similar, but they are carried out differently.

Our description of A depends on having a description of B.

So we can't complete the description of A until we construct

B.

Page 6: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

SELF - REFERENCE

For A we use the machine P<B>, described by q(<B>).

q(<B>) means applying the function q to <B>.

If B can obtain <B>, it can apply q to that and obtain <A>.

B only needs to look at the tape to obtain <B>.

Then after B computes q(<B>) = <A>, it combines A and B

into a single machine and writes its description <AB> =

<SELF> on the tape.

Page 7: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

SELF - REFERENCE

Page 8: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

SELF - REFERENCE

This can be implemented by any programming language

even plain English “ Print out this line”.

Page 9: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.1 The recursion theory

Page 10: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

TERMINOLOGY FOR THE RECURSION THEOREM

recursion theorem in TM - (If you are designing a machine M,

you can include the phrase "obtain own description <M>" in

the informal description of M's algorithm.)

Two ways:

1. use any other computed value <SELF>

2. simulate <M>.

Page 11: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

TERMINOLOGY FOR THE RECURSION

THEOREM

Applications computer Viruses

Another application giving minimal TM

Page 12: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

Quick Note

Cs314pnu.wordpress.com

Computer Science Department

12

Page 13: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.2 Decidability of Logic Theories

Mathematics logic is a branch of mathematics that investigate mathematics itself. It address questions like:

What is a theorem?

What is a proof?

What is truth?

Can an algorithm decide which statements are true?

Are all true statements provable?

We will focus on the problem of:

Determining if the mathematical statements are true or false

And investigate the decidability of the problem. ( depending on the domain of the statements)

Two domains:

1. To decide truth

2. To state its un-decidable

Page 14: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.2 Decidability of Logic Theories

Remember Boolean operations:

Page 15: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.2 Decidability of Logic Theories

Statement 1 - infinitely many prime numbers exist - solved.

Statement 2 is Fermat' last theorem - solved, and

Statement 3 - infinitely many prime pairs1 exist - unsolved.

To determine these statements are true we treat each statement as strings and define a language consisting of those statements that are true. Then we ask if the language is decidable.

Page 16: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.2 Decidability of Logic Theories

The form of the alphabet of this language is:

Formulas are in the prenex normal form if the quantifier

appears in the front of the formula.

Formulas are called statements or sentences if they have

no free variables.

Example:

Page 17: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.2 Decidability of Logic Theories

To determine the meaning of the variables and relations

we need to determine:

1. The universe over which the variables may take values.

2. A universe together with an assignment of relations to

relation symbols is called a model ( we say M is a tuple

(U,P1,…..,Pk))

Example: (is it true or not)

Page 18: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

6.2 Decidability of Logic Theories

Example 6.11: (is it true or not)

Let

If M2=(R,PLUS)?

If M2=(N,PLUS)?

DECIDABLE THEORY:

Page 19: CS314: FORMAL LANGUAGES AND AUTOMATA THEORY€¦ · CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN . ... statement as strings and define a language consisting of those

DECIDABLE THEORY:

No algorithm can decide whether statements in the number

theory are true or false.

Let (N,+) be the model and its theory is Th(N,+):