lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly...

67
Induction

Transcript of lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly...

Page 1: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Induction

Page 2: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Induction is reasoning from the specific to the general.

If various instances of a schema are true and there are no counterexamples, we are tempted to conclude a universally quantified version of the schema.

p(a) ⇒ q(a) p(b) ⇒ q(b) → ∀x.p(x) ⇒ q(x)

p(c) ⇒ q(c)

Induction

Page 3: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Definitionf(1) = 1f(x + 1) = f(x) + 2*x + 1

Data

Conjecture

In this case, the answer is correct. Lucky Guess.

1 = 1 = 12

1+ 3 = 4 = 22

1+ 3 + 5 = 9 = 32

1+ 3 + 5 + 7 = 16 = 42

1+ 3 + 5 + 7 + 9 = 25 = 52

f (x) = x2

Incomplete Induction

Page 4: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Data:

“Theorem” by Fermat (1601-1665):

Fact discovered (mercifully) after his death:

Oops.

221

+1 = 22+1 = 522

2

+1 = 24+1 = 1722

3

+1 = 28+1 = 25722

4

+1 = 216+1 = 65537

prime(22x

+1)

225

+1 = 4,294,967,297 = 641*6,700, 417

Not So Lucky Guess

Page 5: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Domain Closure finite domains

Linear Induction induction on sequences

Tree Induction induction on trees

Structural Induction induction on arbitrary structures

Outline

Page 6: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Domain Closure

Page 7: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ1[σ]…φn[σ]

∀υ.φ[υ]

General Form

Page 8: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a]φ[b]φ[c]φ[d]

∀x.φ[x]

Finite Example

Page 9: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(a) ⇒ q(a) Premise

2. p(b) ⇒ q(b) Premise

3. p(c) ⇒ q(c) Premise

4. p(d) ⇒ q(d) Premise

5. ∀x. p(x) ⇒ q(x) Ind: 1-4

Proof

Page 10: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

What happens when we have infinitely many terms?

p(a) ⇒ q(a)p(s(a)) ⇒ q(s(a))

p(s(s(a))) ⇒ q(s(s(a)))p(s(s(s(a)))) ⇒ q(s(s(s(a))))

∀x.p(x) ⇒ q(x)

Infinite Case

Page 11: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Linear Induction

Page 12: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Linearly Structured World:

a → s(a) → s(s(a)) → s(s(s(a))) → …

Languages like this are called linear languages.The object constant in a linear language is called the base element, and the function constant is called the successor function.

Linear Languages

Page 13: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[s(µ)])

∀υ.φ[υ]

Linear Induction

Page 14: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[s(µ)])

∀υ.φ[υ]

Base Case

Linear Induction

Page 15: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[s(µ)])

∀υ.φ[υ]

Base Case

Inductive Case

Linear Induction

Page 16: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[s(µ)])

∀υ.φ[υ]

Base Case

Inductive Case

Inductive Hypothesis

Linear Induction

Page 17: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[s(µ)])

∀υ.φ[υ]

Base Case

Inductive Case

Inductive HypothesisInductive Conclusion

Linear Induction

Page 18: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[s(µ)])

∀υ.φ[υ]

Base Case

Inductive Case

Inductive HypothesisInductive Conclusion

Overall Conclusion

Linear Induction

Page 19: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Dominoes Set-up

Page 20: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: aUnary function constant: sTernary relation constant: falls

Dominoes Example

Page 21: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: aUnary function constant: sTernary relation constant: falls

Axioms:falls(a)

∀x.(falls(x) ⇒ falls(s(x))

Dominoes Example

Page 22: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: aUnary function constant: sTernary relation constant: falls

Axioms:falls(a)

∀x.(falls(x) ⇒ falls(s(x)))

Goal:∀x.falls(x)

Dominoes Example

Page 23: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. falls(a) Premise

2. ∀x.(falls(x) ⇒ falls(s(x))) Premise

3. ∀x.falls(x) Ind: 1, 2

Dominoes Proof

Page 24: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 0Unary function constant: sTernary relation constant: plus

Arithmetic ExampleArithmetic

Page 25: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 0Unary function constant: sTernary relation constant: plus

Axioms of Arithmetic:∀y.plus(0,y,y)

∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z))

Arithmetic ExampleArithmetic Example

Page 26: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 0Unary function constant: sTernary relation constant: plus

Axioms of Arithmetic:∀y.plus(0,y,y)

∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z))

Goal:∀x.plus(x,0,x)

Arithmetic Example

Page 27: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

Arithmetic Proof

Page 28: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

Arithmetic Proof

Page 29: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Arithmetic Proof1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

4. plus(x,0,x) Assumption

Arithmetic Proof

Page 30: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Arithmetic Proof1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

4. plus(x,0,x) Assumption

5. plus(x,0,x) ⇒ plus(s(x),0,s(x)) 3 x UE: 2

Arithmetic Proof

Page 31: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Arithmetic Proof1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

4. plus(x,0,x) Assumption

5. plus(x,0,x) ⇒ plus(s(x),0,s(x)) 3 x UE: 2

6. plus(s(x),0,s(x)) IE: 2, 4

Arithmetic Proof

Page 32: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

4. plus(x,0,x) Assumption

5. plus(x,0,x) ⇒ plus(s(x),0,s(x)) 3 x UE: 2

6. plus(s(x),0,s(x)) IE: 2, 4

7. plus(x,0,x) ⇒ plus(s(x),0,s(x)) II: 4, 6

Arithmetic Proof

Page 33: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

4. plus(x,0,x) Assumption

5. plus(x,0,x) ⇒ plus(s(x),0,s(x)) 3 x UE: 2

6. plus(s(x),0,s(x)) IE: 2, 4

7. plus(x,0,x) ⇒ plus(s(x),0,s(x)) II: 4, 6

8. ∀x.plus(x,0,x) ⇒ plus(s(x),0,s(x)) UI: 7

Arithmetic Proof

Page 34: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. ∀y.plus(0,y,y) Premise

2. ∀x.∀y.∀z.(plus(x,y,z) ⇒ plus(s(x),y,s(z)) Premise

3. plus(0,0,0) UE: 1

4. plus(x,0,x) Assumption

5. plus(x,0,x) ⇒ plus(s(x),0,s(x)) 3 x UE: 2

6. plus(s(x),0,s(x)) IE: 2, 4

7. plus(x,0,x) ⇒ plus(s(x),0,s(x)) II: 4, 6

8. ∀x.plus(x,0,x) ⇒ plus(s(x),0,s(x)) UI: 7

9. ∀x.plus(x,0,x) Ind: 3, 8

Arithmetic Proof

Page 35: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Tree Induction

Page 36: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Tree-Like World:a

f(a) g(a)

f(f(a)) g(f(a)) f(g(a)) g(g(a))

Languages like this are called tree languages.

Tree Languages

Page 37: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a] ∀µ.(φ[µ] ⇒ φ[f(µ)]) ∀µ.(φ[µ] ⇒ φ[g(µ)])

∀υ.φ[υ]

Tree Induction

Page 38: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: rexUnary function constants: f, gUnary relation constant: p

Canine Ancestry Example

Page 39: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: rexUnary function constants: f, gUnary relation constant: p

Axiom:

∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x)))

Canine Ancestry Example

Page 40: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: rexUnary function constants: f, gUnary relation constant: p

Axioms:p(rex)

∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x)))

Goal:∀x.p(x)

Canine Ancestry ExampleCanine Ancestry Example

Page 41: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

Canine Ancestry Proof

Page 42: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

Canine Ancestry Proof

Page 43: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

5. p(x) Assumption

Canine Ancestry Proof

Page 44: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

5. p(x) Assumption

6. p(f(x)) ∧ p(g(x)) IE: 4, 5

Canine Ancestry Proof

Page 45: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

5. p(x) Assumption

6. p(f(x)) ∧ p(g(x)) IE: 4, 5

7. p(f(x)) AE: 6

Canine Ancestry Proof

Page 46: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

5. p(x) Assumption

6. p(f(x)) ∧ p(g(x)) IE: 4, 5

7. p(f(x)) AE: 6

8. p(x) ⇒ p(f(x)) II: 5, 7

9. ∀x.(p(x) ⇒ p(f(x))) UI: 8

Canine Ancestry Proof

Page 47: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

9. ∀x.(p(x) ⇒ p(f(x))) UI: 8

14. ∀x.(p(x) ⇒ p(g(x))) UI: 13

15. ∀x.p(x) Ind: 1, 9, 14

Canine Ancestry Proof

Page 48: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. p(rex) Premise

2. ∀x.(p(x) ⇔ p(f(x)) ∧ p(g(x))) Premise

3. p(x) ⇔ p(f(x)) ∧ p(g(x)) UE: 2

4. p(x) ⇒ p(f(x)) ∧ p(g(x)) BE: 3

9. ∀x.(p(x) ⇒ p(f(x))) UI: 8

14. ∀x.(p(x) ⇒ p(g(x))) UI: 13

15. ∀x.p(x) Ind: 1, 9, 14

Canine Ancestry Proof

Page 49: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Structural Induction

Page 50: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: a, bBinary function constant: c

Sample Terms

a, c(a,a), c(a,b), c(b,a), c(b,b), c(a,c(a,a)), …

General Languages

Page 51: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

φ[a]∀λ.∀µ.(φ[λ] ∧ φ[µ] ⇒ φ[c(λ,µ)])

∀υ.φ[υ]

Structural Induction

Page 52: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Chemistry Set-up

Page 53: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Demonstration

Page 54: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 1, 2Unary function constants: cUnary relation constant: a, n, b

Chemistry Example

Page 55: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 1, 2Unary function constants: cUnary relation constant: a, n, b

Axioms: ∀x.(a(x) ∧ a(y) ⇒ a(c(x,y))) ∀x.(b(x) ∧ b(y) ⇒ b(c(x,y))) ∀x.(a(x) ∧ n(y) ⇒ a(c(x,y))) ∀x.(b(x) ∧ n(y) ⇒ b(c(x,y))) ∀x.(n(x) ∧ a(y) ⇒ a(c(x,y))) ∀x.(n(x) ∧ b(y) ⇒ b(c(x,y)))

∀x.(n(x) ∧ n(y) ⇒ n(c(x,y)))

Chemistry Example

Page 56: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 1, 2Unary function constants: cUnary relation constant: a, n, b

Axioms: ∀x.(a(x) ∧ a(y) ⇒ a(c(x,y))) ∀x.(b(x) ∧ b(y) ⇒ b(c(x,y))) ∀x.(a(x) ∧ n(y) ⇒ a(c(x,y))) ∀x.(b(x) ∧ n(y) ⇒ b(c(x,y))) ∀x.(n(x) ∧ a(y) ⇒ a(c(x,y))) ∀x.(n(x) ∧ b(y) ⇒ b(c(x,y)))

∀x.(n(x) ∧ n(y) ⇒ n(c(x,y)))a(1), a(2)

Goal:∀x.a(x)

Chemistry Example

Page 57: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. a(1) Premise

2. a(2) Premise

3. ∀x.∀y.(a(x) ∧ a(y) ⇒ a(c(x,y))) Premise

Chemistry Proof

Page 58: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Chemistry Proof1. a(1) Premise

2. a(2) Premise

3. ∀x.∀y.(a(x) ∧ a(y) ⇒ a(c(x,y))) Premise

4. ∀x.a(x) Ind: 1, 2, 3

Chemistry Proof

Page 59: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Object constant: 1, 2Unary function constants: cUnary relation constant: a, n, b

Axioms: ∀x.(a(x) ∧ a(y) ⇒ a(c(x,y))) ∀x.(b(x) ∧ b(y) ⇒ b(c(x,y))) ∀x.(a(x) ∧ n(y) ⇒ a(c(x,y))) ∀x.(b(x) ∧ n(y) ⇒ b(c(x,y))) ∀x.(n(x) ∧ a(y) ⇒ a(c(x,y))) ∀x.(n(x) ∧ b(y) ⇒ b(c(x,y)))

∀x.(n(x) ∧ n(y) ⇒ n(c(x,y)))a(1), n(2)

Goal:∀x.(a(x) ∨ n(x))

Chemistry ExampleChemistry Example

Page 60: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

1. a(1) Premise

2. a(2) Premise

3. ∀x.∀y.(a(x) ∧ a(y) ⇒ a(c(x,y))) Premise

4. ∀x.∀y.(a(x) ∧ n(y) ⇒ a(c(x,y))) Premise

5. ∀x.∀y.(n(x) ∧ a(y) ⇒ a(c(x,y))) Premise

6. ∀x.∀y.(n(x) ∧ n(y) ⇒ n(c(x,y))) Premise

Chemistry Proof

Page 61: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

7. a(1) ∨ n(1) OI: 1

8. a(2) ∨ n(2) OI: 2

Chemistry Proof

Page 62: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

7. a(1) ∨ n(1) OI: 1

8. a(2) ∨ n(2) OI: 2

9. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) Assumption

Chemistry Proof

Page 63: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

7. a(1) ∨ n(1) OI: 1

8. a(2) ∨ n(2) OI: 2

9. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) Assumption

41. a(c(x,y)) ∨ n(c(x,y)) OE:10,25,40

Chemistry Proof

Page 64: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

7. a(1) ∨ n(1) OI: 1

8. a(2) ∨ n(2) OI: 2

9. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) Assumption

41. a(c(x,y)) ∨ n(c(x,y)) OE:10,25,40

42. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) ⇒ (a(c(x,y)) ∨ n(c(x,y)))

II: 9, 41

Chemistry Proof

Page 65: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

7. a(1) ∨ n(1) OI: 1

8. a(2) ∨ n(2) OI: 2

9. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) Assumption

41. a(c(x,y)) ∨ n(c(x,y)) OE:10,25,40

42. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) ⇒ (a(c(x,y)) ∨ n(c(x,y)))

II: 9, 41

43. ∀x.∀y.(a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) ⇒ (a(c(x,y)) ∨ n(c(x,y)))

2 x UI: 42

Chemistry Proof

Page 66: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this

Chemistry Proof7. a(1) ∨ n(1) OI: 1

8. a(2) ∨ n(2) OI: 2

9. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) Assumption

41. a(c(x,y)) ∨ n(c(x,y)) OE:10,25,40

42. (a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) ⇒ (a(c(x,y)) ∨ n(c(x,y)))

II: 9, 41

43. ∀x.∀y.(a(x) ∨ n(x)) ∧ (a(y) ∨ n(y)) ⇒ (a(c(x,y)) ∨ n(c(x,y)))

2 x UI: 42

44. ∀x.(a(x) ∨ n(x)) Ind: 7, 8, 43

Chemistry Proof

Page 67: lecture 11 new - logic.stanford.edulogic.stanford.edu/intrologic/lectures/lecture_11.pdfLinearly Structured World: a → s(a) → s(s(a)) → s(s(s(a))) → … Languages like this