Natural deduction  ` A  ` B  ` A Æ B  ` A  ` A Æ B  ` B  ` B  ` A ) B  ` A  ` A ) B  ` B  ` A ÆIÆI ÆE1ÆE1 ÆE2ÆE2 Assume )I)I.

Slides:



Advertisements
Similar presentations
Isabelle / HOL Theorem Proving System
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Introduction to Proofs
Kripke-Style Semantics for Normal Systems Arnon Avron and Ori Lahav Tel Aviv University LATD 2010.
Introduction to Theorem Proving
Automated Reasoning Systems For first order Predicate Logic.
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Induction and recursion
Advanced Formal Methods Lecture 6: Isabelle - HOL Mads Dam KTH/CSC Course 2D1453, Material from L. Paulson.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
` ² Q E D I Nelson-Oppen review
Knoweldge Representation & Reasoning
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Course announcement Software Reliability Methods –Spring 06, Tu Th 9:30am-11:00am –Instructors: Ingolf Krueger, Ranjit Jhala, Sorin Lerner Topics: –Model.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Plan for the rest of the quarter TuesdayThursday Week 7ResolutionProof carrying code Week 8No class (Sorin in DC for workshop) Predicate abstraction (Mystery.
After today Week 9 –Tu: Pat Rondon –Th: Ravi/Nathan Week 10 –Tu: Nathan/Ravi –Th: Class canceled Finals week –Th: Zach, John.
Course eval results More applications Last question –Luging: 0.5 –Curling: 1.5 –Figure skating: 2 –Ice fishing: 6.5 –Foosball: 0.5.
Induction and recursion
Equational Reasoning Math Foundations of Computer Science.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Canonical Constructive Systems Ori Lahav under the supervision of Prof. Arnon Avron 28 July 2009.
The ACL2 Proof Assistant Formal Methods Jeremy Johnson.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Logic CL4 Episode 16 0 The language of CL4 The rules of CL4 CL4 as a conservative extension of classical logic The soundness and completeness of CL4 The.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
Logic in Computer Science - Overview Sep 1, 2009 박성우.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Of 38 lecture 13: propositional logic – part II. of 38 propositional logic Gentzen system PROP_G design to be simple syntax and vocabulary the same as.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Proof Tactics, Strategies and Derived Rules CS 270 Math Foundations of CS Jeremy Johnson.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
1 Lecture 5 PVS commands. 2 Last week Logical formalisms, first-order logic (syntax, semantics). Introduction to PVS. Language of PVS. Proving sequents.
Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova.
The Logic of Conditionals Chapter 8 Language, Proof and Logic.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
Lecture 5 Floyd-Hoare Style Verification
Natural deduction Gerhard Gentzen.
CS 270 Math Foundations of CS
Computer Security: Art and Science, 2nd Edition
Logical Entailment Computational Logic Lecture 3
Chapter 7. Propositional and Predicate Logic
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Presentation transcript:

Natural deduction  ` A  ` B  ` A Æ B  ` A  ` A Æ B  ` B  ` B  ` A ) B  ` A  ` A ) B  ` B  ` A ÆIÆI ÆE1ÆE1 ÆE2ÆE2 Assume )I)I )E)E  ` A  ` A Ç B ÇI1ÇI1  ` B  ` A Ç B ÇI2ÇI2  ` C ÇEÇE  ` C  ` C ` ² Q E D I

Natural deduction  ` F  ` : A : I  ` : : A  ` A : E  ` A  ` : A ` F` F FIFI ` F` F  ` A FEFE ` T` T TITI No T elmination Note: one can get rid of the FE without losing expressiveness. Can someone see why? ` ² Q E D I

Two kinds of non-determinism Don’t care non-determinism (also called conjunctive non-determinism) –All choices will lead to a successful search, so we “don’t care” which one we take Don’t know non-determinism (also called disjunctive non-determinism) –Some of the choices will lead to a successful search, but we “don’t know” which one a priori We will see several techniques for reducing non- determinism ` ² Q E D I

1. Validity preservation An inference rule is said to preserve validity if its premise judgments are valid iff its conclusion judgment is One direction of this definition (namely, “premises” valid implies “conclusion” valid) always holds because it is required by soundness. The other direction may not hold ` ² Q E D I

1. Validity preservation When doing a backward search, rules that preserve validity cannot be the source of “don’t know” non- determinism Among validity preservation rules, it doesn’t matter which one is applied or how it is instantiated, because none of them will lead the search astray. Another way of looking at it is that if all the rules are validity preserving, then there is no need to backtrack –Notice the parallel with a forward search, where we don’t need to backtrack because all rules are sound ` ² Q E D I

1. Validity preservation Great, so which rules in natural deduction preserves validity? Not many… The sequent calculus will improve on this as most of its rules (and in some versions, all of its rules) will be validity preserving ` ² Q E D I

2. Sub-formula property A proof system has the sub-formula property if the derivation of a judgment J only contains sub- formulas of the formulas occurring in J –More precisely, a proof system has the sub-formula property if, whenever there exists a derivation of a judgment J, then there exists a derivation of J that only contains sub-formulas of the formulas in J This property is useful because it suggests ways of instantiating free meta-variables in a forward or a backward search: use sub-formulas of the goal J. ` ² Q E D I

2. Sub-formula property Prove A Ç : A in natural deduction ` ² Q E D I

Cheat sheet  ` A  ` B  ` A Æ B  ` A  ` A Æ B  ` B  ` B  ` A ) B  ` A  ` A ) B  ` B  ` A ÆIÆI ÆE1ÆE1 ÆE2ÆE2 Assume )I)I )E)E  ` A  ` A Ç B ÇI1ÇI1  ` B  ` A Ç B ÇI2ÇI2  ` C ÇEÇE  ` C  ` C ` ² Q E D I

Cheat sheet  ` F  ` : A : I  ` : : A  ` A : E  ` A  ` : A ` F` F FIFI ` F` F  ` A FEFE ` T` T TITI No T elimination ` ² Q E D I

2. Sub-formula property Prove A Ç : A in natural deduction ` ² Q E D I

2. Sub-formula property Natural deduction, in its vanilla flavor, does not have the sub-formula property Proofs take “detours” through formulas that are not in the goal The (cut-free) sequent calculus will improve on this, as it will have the sub-formula property ` ² Q E D I

3. Picking the right direction Which direction should we apply these rules in?  ` A  ` B  ` A Æ B  ` A  ` A Æ B  ` B  ` B  ` A ) B  ` A  ` A ) B  ` B ÆIÆI ÆE1ÆE1 ÆE2ÆE2 )I)I )E)E  ` A  ` A Ç B ÇI1ÇI1  ` B  ` A Ç B ÇI2ÇI2  ` C  ` C  ` C ÇEÇE ` ² Q E D I

3. Picking the right direction The amount of non-determinism in instantiating a rule depends on the direction in which the rule is applied –If the premise of a rule has more meta-variables than the conclusion, then forward application of the rule will require less choice than the backward application –Symmetrically, if the conclusion has more meta-variables than the premise, then the forward application will have more non- determinism The sequent calculus will improve on natural deduction in this respect, since most of its rules will have the same meta-variables in the premise and the conclusion (the only exception being quantifier rules) ` ² Q E D I

3. Picking the right direction Introduction rules are more deterministic going backward Elimination rules are more deterministic going forward This suggests an approach based on bi-directional search: introduction rules are used in the backward direction, elimination rules are used in the forward direction, and a derivation is found when the two meet The final derivation uses elimination rules to split assumptions up into their constituent components and then introduction rules to combine these constituent components into the goal formula ` ² Q E D I

3. Picking the right direction  ` A 1  ` A 2  ` A n … …  ` B  = { A 1, A 2, …, A n } Elim rules Intro rules ` ² Q E D I

3. Picking the right direction For the intuitionistic subset of natural deduction, all proofs can be expressed in such a form –This does not hold for the classical version of natural deduction The intercalation calculus of John Byrnes embodies this idea for intuitionistic natural deduction The sequent calculus will be of help for this approach, since it will simulate the bi-directional search of intercalation using only a backward search ` ² Q E D I

Summary Three techniques to reduce non-determinism: –Validity preservation –Sub-formula property –Pick the right direction to apply rules ` ² Q E D I

Sequent calculus Sequent calculus developed in 1935 by Gentzen in the same seminal paper as natural deduction –Coincidentally, this paper also introduces the 8 notation for universal quantifiers Sequents were originally introduced as a device for proving natural deduction consistent –Natural deduction corresponds to the way humans reason, but proofs in natural deduction are sometimes long and indirect –Proofs in the sequent calculus are much more direct, and this directness property allowed Gentzen to show consistency of sequents –Natural deduction was then shown consistent by demonstrating its equivalence to the sequent calculus ` ² Q E D I

Sequent calculus Although the original motivation for sequents had nothing to do with automated reasoning, the more direct form of proofs makes it a good fit for automated theorem provers Sequents are also fairly intuitive to understand, and so they provide a good balance between human friendliness and machine friendliness Sequent style systems are used in PVS and Twelf ` ² Q E D I

Sequent calculus A judgment in the sequent calculus has the form  `  The interpretation is that the conjunction of formulas in  entails the disjunction of formulas in  In other words: {  1, …,  n } ` {  1, …,  m } is interpreted as  1 Æ … Æ  n )  1 Ç … Ç  m ` ² Q E D I

Sequent calculus  ` , A  Ç  B  ` , A  Æ  B  ` , A  )  B  ` , : A ` ² Q E D I

Sequent calculus  ` , A, B  ` , A  Ç  B Ç R  ` , A   ` , B  ` , A  Æ  B Æ R , A  ` , B  ` , A  )  B ) R , A  `   ` , : A : R Right rules correspond to introduction rules in natural deduction  ` A  ` B  ` A Æ B  ` B  ` A ) B ÆIÆI )I)I  ` A  ` A Ç B ÇI1ÇI1  ` B  ` A Ç B ÇI2ÇI2  ` F  ` : A : I ` ² Q E D I

Sequent calculus , A  Ç  B  `  Ç L , A  Æ  B  `  Æ L , A  )  B  `  ) L , : A  `  : L ` ² Q E D I

Sequent calculus , A  `  , B `  , A  Ç  B  `  Ç L , A, B  `  , A  Æ  B  `  Æ L  ` , A , B `  , A  )  B  `  ) L  ` , A , : A  `  : L Left rules correspond to the inverse application of ND elim rules  ` A Æ B  ` A  ` A Æ B  ` B  ` A  ` A ) B  ` B ÆE1ÆE1 ÆE2ÆE2 )E)E  ` A Ç B  ` C ÇEÇE  ` C  ` C  ` : : A  ` A : E ` ² Q E D I

Sequent calculus: logical rules , A  `  , B `  , A  Ç  B  `  Ç L  ` , A, B  ` , A  Ç  B Ç R , A, B  `  , A  Æ  B  `  Æ L  ` , A   ` , B  ` , A  Æ  B Æ R  ` , A , B `  , A  )  B  `  ) L , A  ` , B  ` , A  )  B ) R  ` , A , : A  `  : L , A  `   ` , : A : R ` ² Q E D I

Sequent calculus: axioms Note how this is different from the natural deduction axiom: A ` A  ` A Assume ` ² Q E D I

Sequent calculus: structural rules  `  , A  `   `   ` , A Thinning ,  A, A  `  , A  `  Contraction  ` ,  A, A  ` , A ,  A, B,  `  , B, A,  `  Exchange  ` , A, B,   ` , B, A,  ` ² Q E D I

Cut rule Gentzen’s cut-elimination theorem (also called Hauptsatz): if there exists a derivation of a judgment J in the sequent calculus that uses the cut rule, then there also exists a derivation of J that does not use the cut rule  ` , A A,  `  ,  ` ,  ` ² Q E D I

Cut rule: why have it there in the first place? It can make proofs smaller –There are examples where the proof using cut takes a page, but the cut-free proof cannot be computed in the lifespan of the universe! It makes proving equivalence with respect to natural deduction easier

Cut rule: why remove it? After removing the cut rule, all rules in the sequent calculus (except for quantifier rules) have the same number of meta-variables in the premise and the conclusion In terms of automation, this property is an improvement over natural deduction, where introduction rules were easier to apply in the backward direction, and elimination rules were easier to apply in the forward direction ` ² Q E D I

Cut rule: why remove it? Removing the cut rule makes the sequent calculus have the sub-formula property –don’t need to take detours through formulas that are not mentioned in the original goal –In general, this makes proofs smaller and more direct (although in the worst case, it can make proofs be gigantic) Revisiting our previous example: –prove A Ç : A ` ² Q E D I

Cheat sheet , A  `  , B `  , A  Ç  B  `  Ç L  ` , A, B  ` , A  Ç  B Ç R , A, B  `  , A  Æ  B  `  Æ L  ` , A   ` , B  ` , A  Æ  B Æ R  ` , A , B `  , A  )  B  `  ) L , A  ` , B  ` , A  )  B ) R  ` , A , : A  `  : L , A  `   ` , : A : R ` ² Q E D I

Other properties of sequents In the cut-free version of the sequent calculus presented here, all rules are validity preserving –This removes the need to backtrack Also, because applying left rules corresponds to the inverse application of elim rules, Byrnes bi- directional approach can be seen as a unidirectional search in the sequent calculus ` ² Q E D I

Summary of sequents Same number of meta-variables in premise and consequents (except for quantifier rules) –Reduces non-determinism Sub-formula property –Makes proofs more direct Validity preservation (in some versions) –Don’t need to backtrack Can do natural-deduction-bi-directional searches in one direction ` ² Q E D I

Tactics and Tacticals LCF: Logic for Computable functions, 1969 A “meta-language” for manipulating proofs –The language of proofs: higher-order logic –The meta-language for manipulating proofs: functional language with static types to help make sure that the proofs are manipulated correctly This language was called ML for meta-language LCF introduced tactics and tactics, but variants have appeared in many systems, including HOL, PVS, Isabelle and NuPRL ` ² Q E D I

Tactics A tactic is a backward application of an inference rule –More broadly, a tactic is a way of decomposing a goal into sub-goals while performing a backward search When applied, a tactic can either succeed –in which case it create a sub-goal Or it can fail because it is not applicable –in this case, the goal is not changed ` ² Q E D I

Tactics The system provides a set of primitive tactics, for example: –skip: always success, does nothing –fail: always fails –apply- ) L: apply the ) L rule –skolemize: if the formula to prove is a universal, remove the quantifier –simplify: simplify based on decision procedures –Induct: if the formula to prove is a universal, try to apply induction –… (a typical system provides many more) ` ² Q E D I

Tacticals A tactical is a function that takes tactics and returns tactics The system includes a set of predefined tacticals, for example: –IF-THEN-ELSE: takes three tactics a, b, and c, and returns a tactic that applies a to the goal, and, if a succeeds, it then applies b to all sub-goals created by a, otherwise, it applies c to all sub-goals created by a –SEQ: takes two tactics a and b, and returns a tactic that applies a to the goal, and b to all the sub-goal produced by a –REPEAT: takes a given tactic, and repeatedly applies it until it fails ` ² Q E D I

Tacticals Using these predefined tacticals, programmers can create new tactics from primitive tactics They can also create their own tacticals Tacticals can be seen as creating more complicated inference steps from simpler ones ` ² Q E D I

Examples ;; A tactic that repeatedly skolemizes ;; and then simplifies define grind = REPEAT(SEQ(skolemize, simplify)) ` ² Q E D I

Examples ;; A tactical that tries all the tactics ;; in the given list in sequence. If ;; one of the tactic succeeds, that ;; tactic is applied and the try succeeds. ;; Otherwise, the try fails define try(list) = case list of nil: fail first::rest: IF-THEN-ELSE(first, skip, try(rest)) ;; Perform a backward search, by first applying ;; introduction rules repeatedly, and then applying ;; elimination rules to the results define backsearch = SEQ( REPEAT(try(list-of-I-rules)), REPEAT(try(list-of-E-rules))) Note: This is not the syntax of any particular system. Each system has its own syntax and language for expressing tactics and tacticals. For example, LCF and its successors (such as HOL) use ML. PVS uses LISP. ` ² Q E D I

Tactics and tacticals: Summary Tactics and tacticals provide a way for a programmer to customize a theorem prover Many variants exist, and each system has its own primitives and its own language for defining tactics and tacticals ` ² Q E D I