Logic for Computer Science Satisfiability and Validity

Logic for Computer Science Satisfiability and Validity

Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Logic for Computer Science 2.2 Natural Deduction Jens Otten University of Oslo Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 1 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Satisfiability and Validity Definition (Satisfiable, Valid, Logical Consequence). Let A be a formula and U= A , ... be a set of formulae A . ∈F { 1 } i ∈F I A is satisfiable iff v (A) = T for some interpretation . I I A satisfying interpretation is a model for A. U= A , ... is satisfiable iff there is (common) model for all A . { 1 } i A/U is unsatisfiable iff A/U is not satisfiable. I A is valid, denoted = A, iff v (A) = T for all interpretations . | I I A is invalid iff A is not valid. I A is a logical consequence of U, denoted U = A, iff every | model of U is a model of A. Theorem (Logical Consequence and Validity). Let A and U= A , ..., A . Then U = A iff = A A. ∈F { 1 n} | | i i → Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171V Autumn ’18 2 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Validity and Complexity I A is valid, denoted = A, iff v (A) = T for all interpretations | I I I for a given formula A, testing for every possible interpretation I whether v (A) = T holds is an “expensive” task I n I if A contains n (different) atoms, i.e. = n, then2 truth |PA| assignments have to be tested I the problem of determining if a formula A is valid is co-NP-complete, i.e. all known solutions/algorithm have an exponential time complexity I if P = NP, then there is a solution/algorithm that has a polynomial time complexity Goal: “formal system” to derive valid formulae in a purely syntactical and more efficient way Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 3 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Calculus and Proof Definition 21 (Calculus/Deductive System). A calculus consists of axioms and inference rules. w1 wn Axioms have the form w ; rules have the form ···w (w1,..., wn are the premises, w is the conclusion). A proof of w is a tree whose (inner) nodes are rules of the calculus such that each premise of a rule is a conclusion of another rule or an axiom. Definition 22 (Proof, Derivation). Let = A ,... be axioms and = R ,... be rules of a calculus. A { 1 } R { 1 } 1. Let Ai be of the form w . Then w is a proof of w. ∈ A w is a derivation of w. w1 wn 2. Let R be a rule of the form ··· and 1, ..., n i ∈ R w D D proofs/derivations of w , ..., w . Then 1 n is also a 1 n D ···Dw proof/derivation of w. Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 4 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Hilbert Systems Goal: calculus (or deductive system) to formalize mathematical reasoning I published by David Hilbert in 1922/1934 I contains 3 axioms and 1 rule of inference I proofs are constructed as a sequence of formulae, each of which is either I an axiom (or a formula that has been previously proved) or I a derivation of a formula from previous formulae in the sequence using the rule of inference I uses only the logical connectives (implication) and (negation) → ¬ I A B can be defined as (A B) A ∧ B can be defined as ¬A →B ¬ ∨ ¬ → Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 5 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Hilbert’s Axiomatic System H Definition 23 (Hilbert System ). H The axioms of are: H A (B A) (Axiom 1) ` → → (A (B C)) ((A B) (A C)) (Axiom 2) ` → → → → → → ( B A) (A B) (Axiom 3) ` ¬ → ¬ → → The rule of inference of is modus ponens (“MP” for short): H A A B MP ` `B → ` Remark: All axioms of are valid formulae. The modus ponens inference H rule of states that “a formula B can be inferred from A and A B”. H → Definition 24 (Provable, Theorem). A formula A is provable in a calculus (here in ), written A, iff H ` there is a proof for A in the calculus ( ). A is called a theorem. H Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 6 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Hilbert System — Examples Theorem 25 (A A). → A A for formula A. ` → Proof. 1. A ((A A) A) (Axiom 1∗) ` → → → 2. (A ((A A) A)) ((A (A A)) (A A)) (Axiom 2∗) 3. ` (A → (A →A)) → (A →A) → → → → (MP 1,2) 4. ` A →(A →A) → → (Axiom 1 with B A) 5. ` A → A→ (MP≡ 3,4) ` → ∗: with B (A A) ≡ → Examples: I A (B A) (Axiom 1) ` → → I p (( q r) p) (Axiom 1) ` → ¬ → → (with A p and B ( q r)) ≡ ≡ ¬ → Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 7 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary The Deduction Rule Goal: simplify proofs in by using derived rules H Definition 26 (U A). ` Let U be a set of formulae and A be a formula. The notation U A means that formulae in U are assumptions in the proof of A ` (as axioms also allowed: U U0 with U0 U). ` ⊆ Definition 27 (Deduction Rule). U A B The deduction rule is ∪ { } ` . U A B ` → Theorem 28 (Deduction Theorem). The deduction rule is a sound derived rule, i.e., it does not increase the increase the set of provable formulae (theorems) in . H Proof. It is shown by induction on the length n of the proof of U A B how to obtain a proof of U A B that does not use the ∪ { } ` ` → deduction rule; for details see [Ben-Ari 2012, page 57]. Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 8 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Derived Rules in H U B A I Contrapositive rule: U` ¬A →B ¬ ` → Axiom 3 U B A U ( B A) (A B) ` ¬ → ¬ ` ¬ → ¬ → → MP U A B ` → A B B C I Transitivity: ` → A `C → ` → Prove (A B) [(B C) (A C)] (using deduction rule), → → → → → then use MP rule twice I Further derivable rules: e.g., exchange of antecedent, double negation, reductio ad absurdum Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 9 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Soundness and Completeness Correctness and completeness are important criteria for calculi. Definition 29 (Soundness/Correctness). A calculus is sound iff all provable formulae (i.e. theorems) are valid, i.e. for all A: if A then = A. ` | Definition 30 (Completeness). A calculus is complete iff all valid formulae are provable (i.e. theorems), i.e. for all A: if = A then A. | ` Theorem 31 (Soundness and Completeness of ). H The Hilbert System is sound and complete. H Proof. Soundness: the proof is by structural induction on the length of the proof. The axioms are valid and the inference rule MP preserves validity. Completeness: translation into sequent calculus, see also [Ben-Ari 2012, page 64ff.]. Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 10 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Hilbert Systems — Summary Hilbert Systems I are axiomatic systems, i.e., they are essentially based on axioms I are the simplest and historically first proof systems for first-order logic I allow to mechanically verify if a formula is an axiom and whether it follows correctly from other formulae by one of the inference rules I are easy to describe, but proofs/derivations in them are hard to read and understand, and are also (very!) hard to find The problem with Hilbert systems is that they offer no guidance on how to find a proof of a formula. Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 11 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Proof Search Calculi efficiency ¨* DPLL ¨ 6 ¨¨ × ¨¨ ¨ Resolution ¨ Connection Calculus × ¨ × ¨¨ ¨¨ ¨¨ ¨¨ ¨¨ ¨¨ Tableau Calculus ¨¨ × ¨ - ¨ time ¨¨ ¨¨ ¨¨ Sequent Calculus ¨¨ × Natural Deduction × ? readability Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 12 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Gentzen’s Natural Deduction Goal: A derivation system intended to mirror actual reasoning “First I wanted to construct a formalism which comes as close as possible to actual reasoning. Thus arose a calculus of natural deduction.” [G. Gentzen] I the calculus of natural deduction was developed by Gehard Gentzen in the 1930’s I he was dissatisfied with axiomatic systems in the Hilbert tradition, which did not seem to capture mathematical reasoning practices very directly I instead of many axioms and one rule, he introduced only one axiom and rules for each logical connective Jens Otten (UiO) Logic for CS — 2.2 Natural Deduction INF3170/4171 Autumn ’18 13 / 22 Motivation Hilbert Systems Natural Deduction The Calculus Examples Summary Natural Deduction — Assumptions I natural deduction systems are close to the informal reasoning used in mathematical proofs; natural deduction proofs begin with assumptions, inference rules are then applied I the inference rules come in two flavours, an introduction and an elimination rule for each logical operator I they introduce a logical operator in the conclusion or removea logical operator from a premise of the rule I some of the rules allow an assumption to be discharged; to indicate which assumption is discharged by which inference, a label is assigned to the assumption and the inference Definition 32 (Assumptions).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us