introduction to logic herbrand logic proofsintrologic.stanford.edu/lectures/lecture_12.pdfuniversal...

27
Introduction to Logic Herbrand Logic Proofs Michael Genesereth Computer Science Department Stanford University

Upload: others

Post on 16-Sep-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Introduction to LogicHerbrand Logic Proofs

Michael GeneserethComputer Science Department

Stanford University

Page 2: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

2

Propositional Logic

{m ⇒ p ∨ q, p ⇒ q} ⊨ m ⇒ q?

Page 3: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Relational Logic

{p(a) ∨ p(b), ∀x.(p(x) ⇒ q(x))} ⊨ ∃x.q(x)?

Page 4: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

4

Object constants: nBinary relation constants: kFactoids in Herbrand Base: infiniteInterpretations: infinite

Herbrand Logic

Page 5: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Herbrand Proofs

Page 6: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Logical Rules of Inference

Negation IntroductionNegation Elimination

And IntroductionAnd Elimination

Or IntroductionOr Elimination

AssumptionImplication Elimination

Biconditional IntroductionBiconditional Elimination

Page 7: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Universal IntroductionUniversal Elimination

Existential IntroductionExistential Elimination

Domain ClosureInduction (Linear, Tree, Structural) New!!

Rules of Inference for Quantifiers

Page 8: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

A structured proof of a conclusion from a set of premises is a sequence of (possibly nested) sentences terminating in an occurrence of the conclusion at the top level of the proof. Each step in the proof must be either (1) a premise (at the top level), (2) an assumption, or (3) the result of applying an ordinary or structured rule of inference to earlier items in the sequence (subject to the constraints given above).

If there exists a proof of a sentence φ from a set Δ of premises using the rules of inference in Herbrand, we say that φ is provable from Δ (written Δ ⊢Herbrand φ).

Structured Proof

Page 9: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Example - Spin

Page 10: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

On transition, a particle goes from spin zero to spin positive or spin negative and then goes to spin zero on second transition. Show that if it has spin zero, it will have spin zero after two transitions.

Givens: ∀x:(zero(x) ⇒ pos(f(x)) | neg(f(x))) ∀x:(pos(x) ⇒ zero(f(x))) ∀x:(neg(x) ⇒ zero(f(x)))

Goal: ∀x:(zero(x) ⇒ zero(f(f(x))))

Problem

Page 11: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise

Proof

Page 12: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption

Proof

Page 13: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption5. zero(x) ⇒ pos(f(x)) ∨ neg(f(x)) UE: 1

Proof

Page 14: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption5. zero(x) ⇒ pos(f(x)) ∨ neg(f(x)) UE: 16. pos(f(x)) ∨ neg(f(x)) IE: 5, 4

Proof

Page 15: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption5. zero(x) ⇒ pos(f(x)) ∨ neg(f(x)) UE: 16. pos(f(x)) ∨ neg(f(x)) IE: 5, 47. pos(f(x)) ⇒ zero(f(f(x))) UE: 28. neg(f(x)) ⇒ zero(f(f(x))) UE: 3

Proof

Page 16: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption5. zero(x) ⇒ pos(f(x)) ∨ neg(f(x)) UE: 16. pos(f(x)) ∨ neg(f(x)) IE: 5, 47. pos(f(x)) ⇒ zero(f(f(x))) UE: 28. neg(f(x)) ⇒ zero(f(f(x))) UE: 39. zero(f(f(x))) OE: 6, 7, 8

Proof

Page 17: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption5. zero(x) ⇒ pos(f(x)) ∨ neg(f(x)) UE: 16. pos(f(x)) ∨ neg(f(x)) IE: 5, 47. pos(f(x)) ⇒ zero(f(f(x))) UE: 28. neg(f(x)) ⇒ zero(f(f(x))) UE: 39. zero(f(f(x))) OE: 6, 7, 8

10. zero(x) ⇒ zero(f(f(x)))) II: 4, 9

Proof

Page 18: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

1. ∀x.(zero(x) ⇒ pos(f(x)) ∨ neg(f(x))) Premise2. ∀x.(pos(x) ⇒ zero(f(x))) Premise3. ∀x.(neg(x) ⇒ zero(f(x))) Premise4. zero(x) Assumption5. zero(x) ⇒ pos(f(x)) ∨ neg(f(x)) UE: 16. pos(f(x)) ∨ neg(f(x)) IE: 5, 47. pos(f(x)) ⇒ zero(f(f(x))) UE: 28. neg(f(x)) ⇒ zero(f(f(x))) UE: 39. zero(f(f(x))) OE: 6, 7, 8

10. zero(x) ⇒ zero(f(f(x)))) II: 4, 911. ∀x.(zero(x) ⇒ zero(f(f(x)))) UI: 10

Proof

Page 19: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Analysis

Page 20: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

A set of premises Δ logically entails a conclusion ϕ (Δ |= ϕ) if and only if every interpretation that satisfies Δ also satisfies ϕ.

If there exists a proof of a sentence φ from a set Δ of premises using the rules of inference in R, we say that φ is provable from Δ using R (written Δ ⊢R φ).

Logical Entailment and Provability

Page 21: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

A proof system is sound if and only if every provable conclusion is logically entailed.

If Δ ⊢ φ, then Δ ⊨ φ.

A proof system is complete if and only if every logical conclusion is provable.

If Δ ⊨ φ, then Δ ⊢ φ.

Soundness and Completeness

Page 22: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Theorem: Fitch is sound and complete for Relational Logic.

Δ |= ϕ if and only if Δ ⊢Fitch φ.

Theorem: Herbrand is sound for Herbrand Logic.

if Δ ⊢Herbrand φ, then Δ |= ϕ.

Theorem: Fitch is not complete for Herbrand Logic.

However, everything that can be proved by Fitch can be proved by Herbrand!

Herbrand Proof System

Page 23: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

HL is highly expressive.

For example, possible to axiomatize arithmetic as a finite set of axioms.

This is not possible with Relational Logic and in other logics (e.g. First-Order Logic).

Good News

Page 24: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

The question of unsatisfiability and the question of logical entailment for HL are not even semidecidable.

Bad News

Page 25: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

Diophantine equation:

3x2 = 1

Diophantine equation in Peano Arithmetic:

∃x.∃y.(times(x,x,y) ∧ times(s(s(s(0))),y,s(0)))

Unsolvability Question:

Axioms of Arithmetic ∪ {∃x.∃y.(times(x,x,y) ∧ times(s(s(s(0))),y,s(0)))}

Diophantine Equations

Page 26: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination

It is known that the question of unsolvability of Diophantine equations is not semidecidable.

Since we can represent the question of unsolvability of Diophantine equations in Herbrand Logic, if we could determine the unsatisfiability of sentences in Herbrand Logic, we could answer questions of unsolvability of Diophantine equations.

HL Not Even Semidecidable

Page 27: Introduction to Logic Herbrand Logic Proofsintrologic.stanford.edu/lectures/lecture_12.pdfUniversal Introduction Universal Elimination Existential Introduction Existential Elimination