Th(N, +) is decidable Presented by: Brian Lee Two Domains 1. We - - PowerPoint PPT Presentation
Th(N, +) is decidable Presented by: Brian Lee Two Domains 1. We - - PowerPoint PPT Presentation
Theorem 6.12 Th(N, +) is decidable Presented by: Brian Lee Two Domains 1. We can give an algorithm to decide truth 2. A problem is undecidable First Order Logic Also known as First order predicate calculus Uses quantified
Two Domains
1. We can give an algorithm to decide truth 2. A problem is undecidable
First Order Logic
- Also known as First order predicate calculus
- Uses quantified variables over non-logical objects
1. Infinitely many primes exist. 2. Fermat’s Last Theorem 3. Twin prime conjecture
First Order Logic
- Treat the logical statements as strings and define a language consisting of
those statements are true.
Terminology
- Boolean operations, quantifiers, variables, and relations.
- Formula
- Atomic Formula
- Prenex Normal Form
- Sentences/Statement
- Free variables
- Universe
- Model
- Language of a Model
- theory of M - Th(M)
Boolean Operators
- Relations (R1,...,Rk)
○ atomic formula: a string of the form R(x1,...,xn) ○ arity: the number of arguments for relation ○ R(x1,...,xn) is a relation taking variables as arguments ○ x1,...,xn are arguments for the R and returns true/false ○ R: x1,...xn -> {TRUE, FALSE}
Formulas
- Well formed strings over boolean alphabet(a set of strings part of a formal
language)
- It must have the requirements:
Sentences
- A formula without any free variables
- Prenex Normal Form
○ Quantifiers are in front of a sentence 1. x2 & x3 are free variables 2. x2 & x3 are free variables 3. Sentence
Variables and Relations
First we need to specify 2 things
- Universe over where variables may take values
- Assignment of specific relations to relation symbols
○ arity of a relation symbol must match that of its assigned relation
Model
- A universe with assignment of relations to relation symbols
- We say that a model M is a
○ tuple of (U,P1,...,Pk) ○ P1,...,Pk are relations assigned to relation symbols R1,...,Rk ○
- Language of a Model- collection of formulas that
○ use only the relation symbols the model assigns ○ that use each symbol with the correct arity
- Phi is a sentence in the language of a model
○ has the value {TRUE,FALSE} ○ if TRUE in model M, then M is a model of Phi
Example 6.10
Example 6.10 Summary
- M = (N,<=)
- R1(x,y) is (x “<=” y)
- Phi says All natural numbers x and y, there is x >= y or x <= y
○ This sentence is true
- Using less than “<”, this sentence will not be in the model because
if x == y, then R1 will not work
Example 6.11
Example 6.11
- Universe is real numbers
- R1 is PLUS(a,b,c) = TRUE whenever a + b =c
- The sentence phi is true
- using N instead of R(real) universe would not work.
We can represent functions like addition by relations.
Theory of M
Written as Th(M):
- This is the collection of true sentences in the language of the model.
- So any phi that works for all values in the universe.
- In example 6.10:
For Model M = (N, <=) [R1(x,y) or R1(y,x)] is inTh(M)
What this means theory of model (N,+) is decidable for the universe N. Is Decidable, proof will be shown in the next slides.
Th(N, +) is decidable
Proof Idea
- We use the finite automata that is capable of doing addition if the input is
presented in a special form. The special form is 3 bit value that represents 8 different characters.
- Instead we use this form in general for i
Proof Idea
- Let
- Q’s - are quantifiers
- Psi is a formula without quantifiers
○ has variables: x1,...,xL ○ each quantifier has a variable
- For each i from 0 to L define:
Proof Idea
Also each Phi can take arguments a1,...,an from Natural Numbers writing and substitute them for their respective Xi’s.
Proof Idea
- For each i from 0 to L, Create a finite automaton Ai that recognize strings
that represent i-tuples of numbers that make phi(i) true.
- First construct A(L) directly, iterate i from L to 0
- The construct A(i-1) using Ai
- Check A0 accepts empty string
○ if it does, phi is true and algorithm accepts
Proof
- i is the size of the column
- [] is also a symbol
- ai represents a column
Algorithm to Decide Th(N,+)
- AL - phiL = psi
- Addition is the atomic formula we are trying to prove is in N
- FA can be created to compute any of the individual relations
- use regular language operations to compute the boolean
combinations of the atomic formulas
Algorithm to Decide Th(N,+)
- On input phi, where phi is a sentence
- Write phi, and define phi(i) for each i from 0 to L.
- For each i,
○ create finite automaton Ai from phi(I) that accepts strings
- ver
whenever phi(a1,...,ai) is true
Construct Ai from Ai+1
Construct Ai from Ai+1
- Every time Ai reads Fig. 1
- It nondeterministically guesses z and simulates Ai+1(Fig. 2)
Construct Ai from Ai+1
Construct Ai from Ai+1
- Ai nondeterministically guesses the leading bit of ai+1
corresponding to leading 0s in a1 through ai by branching with empty strings it’s new start state to all states Ai+1 can reach from its start state with the input strings of the symbols
Final Step
- A0 accepts any input iff phi(0) is true
- Final Step: algorithm test if A0 accepts empty string
- if it does, phi is true and it accepts, else reject