• Keine Ergebnisse gefunden

Exercise 2 Hilbert-Calculus

N/A
N/A
Protected

Academic year: 2021

Aktie "Exercise 2 Hilbert-Calculus"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Prof. Dr. K. Madlener Dipl.-Inf. P. Michel Dipl.-Inf. C. Feller

University of Kaiserslautern

Department of Computer Science AG Grundlagen der Informatik

Exercise Sheet 1: Specification and Verification with Higher-Order Logic (Summer Term 2011)

Date: 18.04.2011

Exercise 1 Calculus of Natural Deduction

We consider theGenzten-Calculus, also known as calculus ofnatural deduction. The calculus usessequents (german:Sequenzen) of the formΓ`A. They state that the formulaAcan be syntactically derived from the set of formulasΓ. If it is possible to derive such a sequent using only therulesof the calculus, starting from theaxioms, we also know thatAis a semantic conclusion fromΓ(as the calculus iscorrect).

The calculus has only one axiom, which states that every formula can be derived from itself:A`A, for all formulasA. Additionally, there are various rules to derive new sequents from existing ones:

Conjunction, Disjunction and Implication (Binary Relations)

Γ`A Γ`B (∧I) Γ`A∧B

Γ`A (∨Il) Γ`A∨B

Γ`B (∨Ir) Γ`A∨B

Γ, A`B

(→I) Γ`A→B

Γ`A∧B (∧El) Γ`A

Γ`A∧B (∧Er) Γ`B

Γ`A→B Γ`A (→E) Γ`B

Γ`A∨B Γ, A`C Γ, B`C Γ`C (∨E)

Truth Values (Constants), Negation (Unary Relation) and Weakening

Γ`False (FalseE) Γ`A

Γ, A`False Γ` ¬A (¬I)

Γ` ¬A Γ`A (¬E) Γ`False

Γ`B (W) Γ, A`B

Universal and Existential Quantifiers Γ` {anew/x}A

(∀I) Γ` ∀x.A

Γ` ∀x.A (∀E) Γ` {t/x}A Γ` {t/x}A

Γ` ∃x.A (∃I)

Γ` ∃x.A Γ,{anew/x}A`C Γ`C (∃E)

The names of the rules are given on the right side in parenthesis. TheI is an abbreviation ofIntroduction, EofEliminationandW ofWeakening. The syntax{y/x}Adenotes that all unbound occurences ofxinA are replaced byy. You have to choose a completely new variable for eachanew, i.e. it must not appear in any term or formula yet.ton the other hand is allowed to be an arbitrary term.

A proof in the calculus is a tree of rule applications, whose leaves are axioms and whose root is the theorem you want to prove. Usually such a proof is donebackwards, starting with the theorem and trying to reach the axioms.

(2)

a) (Prepare!) Prove the following sequent using the Gentzen-Calculus:

`(a∨(b∧c))→((a∨b)∧(a∨c))

b) (Prepare!) Prove the following sequent using the Gentzen-Calculus:

` ∃x.∀y.P(x, y)→ ∀y.∃x.P(x, y)

c) Write an Isabelle/HOL theory for your proofs from a) and b). A skeleton file to start with looks like this:

theory Sheet1 imports Main begin

lemma Exercise_1_a:

"(a \/ (b /\ c)) −−> ((a \/ b) /\ (a \/ c))"

apply (rule ...) ...

done

lemma Exercise_1_b:

"(EX x. ALL y. P x y) −−> (ALL y. EX x. P x y)"

...

end

The rules of the Gentzen-Calculus correspond to the following Isabelle/HOL rules:

Gentzen Isabelle/HOL Gentzen Isabelle/HOL Gentzen Isabelle/HOL

∧I conjI ∨Il disjI1 ¬I notI

∧El conjunct1 ∨Ir disjI2 ¬E notE

∧Er conjunct2 ∨E disjE FalseE FalseE

→I impI ∀E spec ∃I exI

→E mp ∀I allI ∃E exE

Exercise 2 Hilbert-Calculus

The Hilbert-Calculus for propositional logic has only one rule calledmodus ponens:

P →Q P Q (MP)

Additionally, there are three axioms:

(A1) P →(Q→P)

(A2) (P →(Q→R))→((P →Q)→(P →R)) (A3) (¬P → ¬Q)→(Q→P)

A proof in the Hilbert-Calculus is a sequence of formulas, where each formula is either an axiom, an as- sumption or the result of using modus ponens on two formulas appearing earlier in the sequence. The sequent Γ`P states that there is a proof using only the assumptions fromΓ, which ends inP.

a) (Prepare!) Proof the sequent`b→(a→a)using the Hilbert-Calculus.

b) (Prepare!) Proof the sequent`a∨ ¬ausing the Hilbert-Calculus. (Hint: Use the rules from the lecture to eliminiate the∨first.)

c) (Prepare!) Proof the sequent¬¬a`ausing the Hilbert-Calculus.

d) Write an Isabelle/HOL theory for these proofs.

Referenzen

ÄHNLICHE DOKUMENTE

If the error probability of a binary symmetric code is p, calculate the prob- abilities for each of the three codes from the previous exercise that any received vector will be

We represent protocols as processes in the spi calculus and state their security properties in terms of coarse-grained notions of protocol equivalence.... 2.3 Examples using

syntactic derivation semantic implication derivability — validity. consistency

Still, we will in this course mainly restrict our attention to continuous functions, which are always integrable.. 9.1

We then define a four step transformation: reasoning within an equivalence class are replaced by explicit equality steps in Section 4, n-ary operators are replaced by binary ones

Modal µ-calculus is an extension of modal logic with least and greatest fixpoint constructors and allows us to study fixpoints, which play an important role as extensions for many

I Lecture 2: Concepts of Safety and Security, Norms and Standards I Lecture 3: Quality of the Software Development Process I Lecture 4: Requirements Analysis.. I Lecture 5:

Institut f¨ur Theoretische Physik, Universit¨at Regensburg, 93040 Regensburg, Germany (Received 4 November 2015; revised manuscript received 16 February 2016; published 23 March