logical foundations of cyber physical systems
play

Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - PowerPoint PPT Presentation

06: Truth & Proof Logical Foundations of Cyber-Physical Systems Andr Platzer Logical Foundations of Cyber-Physical Systems Andr Platzer Andr Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 1 / 23 Outline Learning Objectives


  1. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ → L: assume RHS of an assumed implication after proving its LHS André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  2. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ ¬ R Γ ⊢ ¬ P , ∆ Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  3. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  4. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ ¬ R: prove ¬ P by proving contradiction (or ∆ options) from assumption P André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  5. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ ¬ L Γ , ¬ P ⊢ ∆ Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  6. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  7. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ ¬ L: assume ¬ P by proving its opposite P André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  8. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  9. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ id: proof done (marked ∗ ) when succedent to prove is in antecedent André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  10. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ Γ , P → Q ⊢ ∆ id: only way to finish a proof (in propositional logic!) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  11. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ , P → Q ⊢ ∆ Γ ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  12. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  13. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ cut: Show lemma C and then assume lemma C André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  14. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ ⊤ R Γ ⊢ true , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  15. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ ⊤ R Γ ⊢ true , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ ⊤ R: proof done (marked ∗ ) when proving trivial true (used rarely) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  16. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ ⊤ R Γ ⊢ true , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ ⊤ R: what rule to use when true in antecedent? André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  17. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ ⊤ R Γ ⊢ true , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ ⊥ L Γ , false ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  18. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ ⊤ R Γ ⊢ true , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ ⊥ L Γ , false ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ ⊥ L: proof done (marked ∗ ) when assuming trivial false (used rarely) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  19. Propositional Proof Rules of Sequent Calculus ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ ∨ R Γ ⊢ P , Q , ∆ Γ , P ⊢ ∆ ¬ R Γ ⊢ P ∧ Q , ∆ Γ ⊢ P ∨ Q , ∆ Γ ⊢ ¬ P , ∆ ∧ L Γ , P , Q ⊢ ∆ ∨ L Γ , P ⊢ ∆ Γ , Q ⊢ ∆ Γ ⊢ P , ∆ ¬ L Γ , P ∧ Q ⊢ ∆ Γ , P ∨ Q ⊢ ∆ Γ , ¬ P ⊢ ∆ Γ , P ⊢ Q , ∆ → R id Γ , P ⊢ P , ∆ ⊤ R Γ ⊢ true , ∆ Γ ⊢ P → Q , ∆ → L Γ ⊢ P , ∆ Γ , Q ⊢ ∆ cut Γ ⊢ C , ∆ Γ , C ⊢ ∆ ⊥ L Γ , false ⊢ ∆ Γ , P → Q ⊢ ∆ Γ ⊢ ∆ ⊥ L: what rule to use when false in succedent? André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 6 / 23

  20. Sequent Proof Example (Simple) ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  21. Sequent Proof Example (Simple) v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  22. Sequent Proof Example (Simple) ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  23. Sequent Proof Example (Simple) ∧ L v 2 ≤ 10 , b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  24. Sequent Proof Example (Simple) ∗ id v 2 ≤ 10 , b > 0 ⊢ b > 0 ∧ L v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  25. Sequent Proof Example (Simple) ∗ id ∨ R v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 v 2 ≤ 10 , b > 0 ⊢ b > 0 ∧ L v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  26. Sequent Proof Example (Simple) ∗ ∧ L v 2 ≤ 10 , b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 id v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 v 2 ≤ 10 , b > 0 ⊢ b > 0 ∧ L ∨ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  27. Sequent Proof Example (Simple) ∗ id ∗ v 2 ≤ 10 , b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 ∧ L id v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 v 2 ≤ 10 , b > 0 ⊢ b > 0 ∧ L ∨ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 7 / 23

  28. Soundness of Proof Rules Lemma ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ is sound Γ ⊢ P ∧ Q , ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 8 / 23

  29. Soundness of Proof Rules Lemma ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ is sound: conclusion valid if all premises valid. Γ ⊢ P ∧ Q , ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 8 / 23

  30. Soundness of Proof Rules Lemma ∧ R Γ ⊢ P , ∆ Γ ⊢ Q , ∆ is sound: conclusion valid if all premises valid. Γ ⊢ P ∧ Q , ∆ using [ [ P ∧ Q ] ] = [ [ P ] ] ∩ [ [ Q ] ] . Proof ω ∈ [ [ G ] ] for all G ∈ Γ and ω �∈ [ [ D ] ] for all D ∈ ∆ WLOG: (why?) By premise: ω ∈ [ [Γ ⊢ P , ∆] ] and ω ∈ [ [Γ ⊢ Q , ∆] ] ω ∈ [ [ P ] ] and ω ∈ [ [ Q ] ] By WLOG: By semantics: ω ∈ [ [ P ∧ Q ] ] By definition: ω ∈ [ [Γ ⊢ P ∧ Q , ∆] ] André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 8 / 23

  31. Soundness of dL Theorem dL sequent calculus is sound: every dL formula with a proof is valid. André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 9 / 23

  32. Soundness of dL Theorem dL sequent calculus is sound: every dL sequent with a proof is valid. Proof (by induction on structure of sequent calculus proof). André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 9 / 23

  33. Soundness of dL Theorem dL sequent calculus is sound: every dL sequent with a proof is valid. Proof (by induction on structure of sequent calculus proof). Proofs without rule uses only prove dL axioms, which are sound. 0 André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 9 / 23

  34. Soundness of dL Theorem dL sequent calculus is sound: every dL sequent with a proof is valid. Proof (by induction on structure of sequent calculus proof). Proofs without rule uses only prove dL axioms, which are sound. 0 Sequent proof ends with some proof step: 1 Γ 1 ⊢ ∆ 1 Γ n ⊢ ∆ n ... Γ ⊢ ∆ The subproof of each premise Γ i ⊢ ∆ i is smaller, so � Γ i ⊢ ∆ i by IH. All dL proof rules are proved sound, also the one used above, i.e.: If � (Γ 1 ⊢ ∆ 1 ) and ... and � (Γ n ⊢ ∆ n ) then � (Γ ⊢ ∆) Thus, � (Γ ⊢ ∆) . André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 9 / 23

  35. Soundness of dL Theorem dL sequent calculus is sound: every dL sequent with a proof is valid. Proof (by induction on structure of sequent calculus proof). Proofs without rule uses only prove dL axioms, which are sound. 0 Sequent proof ends with some proof step: 1 Γ 1 ⊢ ∆ 1 Γ n ⊢ ∆ n ... Γ ⊢ ∆ The subproof of each premise Γ i ⊢ ∆ i is smaller, so � Γ i ⊢ ∆ i by IH. All dL proof rules are proved sound, also the one used above, i.e.: If � (Γ 1 ⊢ ∆ 1 ) and ... and � (Γ n ⊢ ∆ n ) then � (Γ ⊢ ∆) Thus, � (Γ ⊢ ∆) . Todo Always make sure every axiom and proof rule we adopt is sound! André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 9 / 23

  36. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 10 / 23

  37. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ∪ β ] P , ∆ [ ∪ ] L Γ , [ α ∪ β ] P ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 10 / 23

  38. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Γ ⊢ [ α ∪ β ] P , ∆ [ ∪ ] L Γ , [ α ∪ β ] P ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 10 / 23

  39. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Γ ⊢ [ α ∪ β ] P , ∆ [ ∪ ] L Γ , [ α ] P ∧ [ β ] P ⊢ ∆ Γ , [ α ∪ β ] P ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 10 / 23

  40. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Boring! Already follow from the axiom [ ∪ ] [ α ∪ β ] P ↔ [ α ] P ∧ [ β ] P Γ ⊢ [ α ∪ β ] P , ∆ [ ∪ ] L Γ , [ α ] P ∧ [ β ] P ⊢ ∆ Γ , [ α ∪ β ] P ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 10 / 23

  41. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Boring! Already follow from the axiom [ ∪ ] [ α ∪ β ] P ↔ [ α ] P ∧ [ β ] P Γ ⊢ [ α ∪ β ] P , ∆ Rules [ ∪ ] R , [ ∪ ] L would only apply top-level, [ ∪ ] L Γ , [ α ] P ∧ [ β ] P ⊢ ∆ not in any other logical context such as [ x ′′ = − g ] _ Γ , [ α ∪ β ] P ⊢ ∆ [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 10 / 23

  42. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Boring! Already follow from the axiom [ ∪ ] [ α ∪ β ] P ↔ [ α ] P ∧ [ β ] P Γ ⊢ [ α ∪ β ] P , ∆ Rules [ ∪ ] R , [ ∪ ] L would only apply top-level, [ ∪ ] L Γ , [ α ] P ∧ [ β ] P ⊢ ∆ not in any other logical context such as [ x ′′ = − g ] _ Γ , [ α ∪ β ] P ⊢ ∆ Contextual Equivalence: substituting equals for equals CER Γ ⊢ C ( Q ) , ∆ ⊢ P ↔ Q CEL Γ , C ( Q ) ⊢ ∆ ⊢ P ↔ Q Γ ⊢ C ( P ) , ∆ Γ , C ( P ) ⊢ ∆ [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 11 / 23

  43. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Boring! Already follow from the axiom [ ∪ ] [ α ∪ β ] P ↔ [ α ] P ∧ [ β ] P Γ ⊢ [ α ∪ β ] P , ∆ Rules [ ∪ ] R , [ ∪ ] L would only apply top-level, [ ∪ ] L Γ , [ α ] P ∧ [ β ] P ⊢ ∆ not in any other logical context such as [ x ′′ = − g ] _ Γ , [ α ∪ β ] P ⊢ ∆ Contextual Equivalence: substituting equals for equals CER Γ ⊢ C ( Q ) , ∆ ⊢ P ↔ Q CEL Γ , C ( Q ) ⊢ ∆ ⊢ P ↔ Q Γ ⊢ C ( P ) , ∆ Γ , C ( P ) ⊢ ∆ [? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) ↔ [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 11 / 23

  44. Dynamics Proof Rules of Sequent Calculus Have: Left and right proof rule for all propositional connectives Need: Left and right proof rule for all top-level operators in all modalities? [ ∪ ] R Γ ⊢ [ α ] P ∧ [ β ] P , ∆ Boring! Already follow from the axiom [ ∪ ] [ α ∪ β ] P ↔ [ α ] P ∧ [ β ] P Γ ⊢ [ α ∪ β ] P , ∆ Rules [ ∪ ] R , [ ∪ ] L would only apply top-level, [ ∪ ] L Γ , [ α ] P ∧ [ β ] P ⊢ ∆ not in any other logical context such as [ x ′′ = − g ] _ Γ , [ α ∪ β ] P ⊢ ∆ Contextual Equivalence: substituting equals for equals CER Γ ⊢ C ( Q ) , ∆ ⊢ P ↔ Q CEL Γ , C ( Q ) ⊢ ∆ ⊢ P ↔ Q Γ ⊢ C ( P ) , ∆ Γ , C ( P ) ⊢ ∆ [? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) ↔ [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 11 / 23

  45. Simple Example Proof Dynamics in Sequent Calculus [;] ⊢ [ a := − b ; c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 12 / 23

  46. Simple Example Proof Dynamics in Sequent Calculus � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [ a := − b ; c := 10 ] ↔ � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [ a := − b ][ c := 10 ] by [;] [:=] ⊢ [ a := − b ][ c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [;] ⊢ [ a := − b ; c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 12 / 23

  47. Simple Example Proof Dynamics in Sequent Calculus � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [ a := − b ][ c := 10 ] ↔ � � v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [ c := 10 ] by [:=] [:=] ⊢ [ c := 10 ] � � v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [:=] ⊢ [ a := − b ][ c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [;] ⊢ [ a := − b ; c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 12 / 23

  48. Simple Example Proof Dynamics in Sequent Calculus � � v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [ c := 10 ] ↔ v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) by [:=] ⊢ v 2 ≤ 10 ∧ − ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) [:=] ⊢ [ c := 10 ] � � v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [:=] ⊢ [ a := − b ][ c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [;] ⊢ [ a := − b ; c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 12 / 23

  49. Simple Example Proof Dynamics in Sequent Calculus ∗ id v 2 ≤ 10 , b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 ∗ id v 2 ≤ 10 , b > 0 ⊢ b > 0 ∧ L v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 ∧ L v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∨ R v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) ⊢ v 2 ≤ 10 ∧ − ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) [:=] ⊢ [ c := 10 ] � � v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [:=] ⊢ [ a := − b ][ c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [;] ⊢ [ a := − b ; c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 12 / 23

  50. Simple Example Proof Dynamics in Sequent Calculus ∗ id v 2 ≤ 10 , b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 ∗ id v 2 ≤ 10 , b > 0 ⊢ b > 0 ∧ L v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) , v 2 ≤ 10 ∧ L v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∨ R v 2 ≤ 10 ∧ b > 0 ⊢ ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ∧ R v 2 ≤ 10 ∧ b > 0 ⊢ b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) → R ⊢ v 2 ≤ 10 ∧ b > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) ⊢ v 2 ≤ 10 ∧ − ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ 10 ) [:=] ⊢ [ c := 10 ] � � v 2 ≤ 10 ∧− ( − b ) > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [:=] ⊢ [ a := − b ][ c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) [;] ⊢ [ a := − b ; c := 10 ] � � v 2 ≤ 10 ∧− a > 0 → b > 0 ∧ ( ¬ ( v ≥ 0 ) ∨ v 2 ≤ c ) Need to reason about real arithmetic Here: to glue previous propositional proof with this dynamic proof André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 12 / 23

  51. Quantifier Proof Rules ∀ R Γ ⊢ ∀ x p ( x ) , ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  52. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R Γ ⊢ ∀ x p ( x ) , ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  53. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ ∀ R: show for fresh variable y about which we can’t know anything André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  54. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  55. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  56. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) ∃ R: enough to show for any witness term e André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  57. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ ∀ L Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  58. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ , p ( e ) ⊢ ∆ ∀ L Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  59. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ , p ( e ) ⊢ ∆ ∀ L ( arbitrary term e ) Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) ∀ L: even holds for arbitrary term e André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  60. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ , p ( e ) ⊢ ∆ ∀ L ( arbitrary term e ) Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) ∃ L Γ , ∃ x p ( x ) ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  61. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ , p ( e ) ⊢ ∆ ∀ L ( arbitrary term e ) Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) Γ , p ( y ) ⊢ ∆ ∃ L Γ , ∃ x p ( x ) ⊢ ∆ André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  62. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ , p ( e ) ⊢ ∆ ∀ L ( arbitrary term e ) Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) Γ , p ( y ) ⊢ ∆ ∃ L ( y �∈ Γ , ∆ , ∃ x p ( x )) Γ , ∃ x p ( x ) ⊢ ∆ ∃ L: assume for fresh variable y about which we can’t know anything André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  63. Quantifier Proof Rules Γ ⊢ p ( y ) , ∆ ∀ R ( y �∈ Γ , ∆ , ∀ x p ( x )) Γ ⊢ ∀ x p ( x ) , ∆ Γ , p ( e ) ⊢ ∆ ∀ L ( arbitrary term e ) Γ , ∀ x p ( x ) ⊢ ∆ Γ ⊢ p ( e ) , ∆ ∃ R Γ ⊢ ∃ x p ( x ) , ∆ ( arbitrary term e ) Γ , p ( y ) ⊢ ∆ ∃ L ( y �∈ Γ , ∆ , ∃ x p ( x )) Γ , ∃ x p ( x ) ⊢ ∆ Important: soundness means that conclusion valid if all premises valid. André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 13 / 23

  64. A Sequent Proof of a Single-hop Bouncing Ball ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 14 / 23

  65. A Sequent Proof of a Single-hop Bouncing Ball [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 14 / 23

  66. A Sequent Proof of a Single-hop Bouncing Ball � ( H − g 2 t 2 = 0 → B ( H − g 2 t 2 , − c ( − gt ))) ∧ ( H − g 2 t 2 ≥ 0 → B ( H − g 2 t 2 , − gt A ⊢ ∀ t ≥ 0 � � [:=] A ⊢ ∀ t ≥ 0 [ x := H − g 2 t 2 ] ( x = 0 → B ( x , − c ( − gt ))) ∧ ( x ≥ 0 → B ( x , − gt )) � � [:=] A ⊢ ∀ t ≥ 0 [ x := H − g 2 t 2 ][ v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [;] A ⊢ ∀ t ≥ 0 [ x := H − g � � 2 t 2 ; v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [ ′ ] A ⊢ [ x ′′ = − g ] � � ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) � � [:=] A ⊢ [ x ′′ = − g ] ( x = 0 → [ v := − cv ] B ( x , v )) ∧ ( x ≥ 0 → B ( x , v )) [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 14 / 23

  67. A Sequent Proof of a Single-hop Bouncing Ball [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ↔ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) by [;] [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  68. A Sequent Proof of a Single-hop Bouncing Ball [? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) ↔ � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) by [ ∪ ] [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  69. A Sequent Proof of a Single-hop Bouncing Ball [? x = 0 ; v := − cv ] B ( x , v ) ↔ [? x = 0 ][ v := − cv ] B ( x , v ) by [;] [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  70. A Sequent Proof of a Single-hop Bouncing Ball [? x = 0 ][ v := − cv ] B ( x , v ) ↔ x = 0 → [ v := − cv ] B ( x , v ) by [?] � � [:=] A ⊢ [ x ′′ = − g ] ( x = 0 → [ v := − cv ] B ( x , v )) ∧ ( x ≥ 0 → B ( x , v )) [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  71. A Sequent Proof of a Single-hop Bouncing Ball [ v := − cv ] B ( x , v ) ↔ x = 0 → B ( x , − cv ) by [:=] [ ′ ] A ⊢ [ x ′′ = − g ] � � ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) � � [:=] A ⊢ [ x ′′ = − g ] ( x = 0 → [ v := − cv ] B ( x , v )) ∧ ( x ≥ 0 → B ( x , v )) [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  72. A Sequent Proof of a Single-hop Bouncing Ball [ ′ ] [ x ′ = f ( x )] p ( x ) ↔ ∀ t ≥ 0 [ x := y ( t )] p ( x ) [;] A ⊢ ∀ t ≥ 0 [ x := H − g � � 2 t 2 ; v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [ ′ ] A ⊢ [ x ′′ = − g ] � � ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) � � [:=] A ⊢ [ x ′′ = − g ] ( x = 0 → [ v := − cv ] B ( x , v )) ∧ ( x ≥ 0 → B ( x , v )) [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  73. A Sequent Proof of a Single-hop Bouncing Ball � � [:=] A ⊢ ∀ t ≥ 0 [ x := H − g 2 t 2 ][ v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [;] A ⊢ ∀ t ≥ 0 [ x := H − g � � 2 t 2 ; v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [ ′ ] A ⊢ [ x ′′ = − g ] � � ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) � � [:=] A ⊢ [ x ′′ = − g ] ( x = 0 → [ v := − cv ] B ( x , v )) ∧ ( x ≥ 0 → B ( x , v )) [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

  74. A Sequent Proof of a Single-hop Bouncing Ball � � [:=] A ⊢ ∀ t ≥ 0 [ x := H − g 2 t 2 ] ( x = 0 → B ( x , − c ( − gt ))) ∧ ( x ≥ 0 → B ( x , − gt )) � � [:=] A ⊢ ∀ t ≥ 0 [ x := H − g 2 t 2 ][ v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [;] A ⊢ ∀ t ≥ 0 [ x := H − g � � 2 t 2 ; v := − gt ] ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) [ ′ ] A ⊢ [ x ′′ = − g ] � � ( x = 0 → B ( x , − cv )) ∧ ( x ≥ 0 → B ( x , v )) � � [:=] A ⊢ [ x ′′ = − g ] ( x = 0 → [ v := − cv ] B ( x , v )) ∧ ( x ≥ 0 → B ( x , v )) [?] A ⊢ [ x ′′ = − g ] � � [? x = 0 ][ v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ] � � [? x = 0 ; v := − cv ] B ( x , v ) ∧ [? x ≥ 0 ] B ( x , v ) [ ∪ ] A ⊢ [ x ′′ = − g ][? x = 0 ; v := − cv ∪ ? x ≥ 0 ] B ( x , v ) [;] A ⊢ [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) ⊢ A → [ x ′′ = − g ;(? x = 0 ; v := − cv ∪ ? x ≥ 0 )] B ( x , v ) → R def A ≡ 0 ≤ x ∧ x = H ∧ v = 0 ∧ g > 0 ∧ 1 ≥ c ≥ 0 def B ( x , v ) ≡ 0 ≤ x ∧ x ≤ H { x ′′ = − g } def ≡ { x ′ = v , v ′ = − g } André Platzer (CMU) LFCPS/06: Truth & Proof LFCPS/06 15 / 23

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend