• Keine Ergebnisse gefunden

Exercise 2 Methods and Rules in Isabelle/HOL

N/A
N/A
Protected

Academic year: 2021

Aktie "Exercise 2 Methods and Rules in Isabelle/HOL"

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 4: Specification and Verification with Higher-Order Logic (Summer Term 2011)

Date: 10.05.2011

Exercise 1 Conservative Extensions

a) (Prepare!) LetT = (χ,Σ, A)be the core HOL theory as defined in the lecture. Consider the following extension ofT:

T0 = (χ,Σ, A∪ {(¬P =⇒P) =⇒P})

IsT0a conservative extension ofT?

b) (Prepare!) In the lecture we defined the typesetof typed sets (slide 276), using the conservative exten- sion schema for type definitions (slide 273).

Based on the types of core HOL andnat, define the typemsetof typed multisets in the same style.

Hint: Multisets are sets where the same element can appear more than once.

c) (Prepare!) Based on the types of core HOL andnat, define the typelistof typed lists.

d) Define both types in Isabelle/HOL usingtypedefand define additional helpful functions on the types.

e) Define simple generic properties of the newly defined functions and prove them (e.g. the empty list does not contain any elements, formulated on the two constantsemptyandcontains).

Handling (type-)definitions:Functions on newly defined types are likely defined asdefinitions and invol- ve applications ofRep_tandAbs_t. Isabelle/HOL doesnotautomatically use definitions for simplification.

As definitions define equalities, however, you can use the proof commandapply (subst myfunction_def) to unfold them. Using the same command you can unfold the definition of the type (t_def) and the two axiomsRep_t_inverseandAbs_t_inverse.

(2)

Exercise 2 Methods and Rules in Isabelle/HOL

In this exercise we want to practice the use of different methods (like rule, erule or frule) to prove properties in propositional and predicate logic.

You should only use the rules of the first exercise sheet, together with the following additional rules:conjE, impE,iffI,iffEandclassical.

Hint: You can always invokeC-c C-vto enter a command likethm impIand see the concrete definition of the rule in Isabelle/HOL.

a) (Prepare!) Apply the rule

J(?a,?b)∈?r;^

x.?P x x;^

x y z.J(x, y)∈?r; ?P x y; (y, z)∈?rK=⇒?P x zK=⇒?P ?a?b

with the methoderuleto the following subgoal by hand (i.e. on paper):

(i, j)∈s=⇒0≤(dist i j)

Hint: Don’t be distracted by unknown function names; you don’t have to know anything about their meaning. Just apply the rule syntactically.

b) Prove or disprove the following theorems.

• A−→A

• A∧B−→B∧A

• (A∧B)−→(A∨B)

• ((A∨B)∨C)−→A∨(B∨C)

• A−→B −→A

• (A∨A) = (A∧A)

• (A−→B −→C)−→(A−→B)−→A−→C

• (A−→B)−→(B−→C)−→A−→C

• ¬¬A−→A

• A−→ ¬¬A

• (¬A−→B)−→(¬B−→A)

• ((A−→B)−→A)−→A

• A∨ ¬A

• (¬(A∧B)) = (¬A∨ ¬B)

• (∃x.∀y. P x y)−→(∀y.∃x. P x y)

• (∀x. P x−→Q) = ((∃x. P x)−→Q)

• ((∀x. P x)∧(∀x. Q x)) = (∀x.(P x∧Q x))

• ((∀x. P x)∨(∀x. Q x)) = (∀x.(P x∨Q x))

• ((∃x. P x)∨(∃x. Q x)) = (∃x.(P x∨Q x))

• (∀x.∃y. P x y)−→(∃y.∀x. P x y)

• (¬(∀x. P x)) = (∃x.¬P x)

Referenzen

ÄHNLICHE DOKUMENTE

Handin Please submit this homework until Thursday, February 7, either via email to Philipp Schus- ter (philipp.schuster@uni-tuebingen.de) before 12:00, or on paper at the beginning

The calculus has only one axiom, which states that every formula can be derived from itself: A ` A, for all formulas A. The name of the corresponding Isabel- le/HOL rules are

b) (Prepare!) Extend the data type for formulas to support the logical operators And and Or. Remember to also adjust the functions which are using the data type!. c) (Prepare!)

c) At the moment, programs of the source language are just expressions. We now want to extend the lan- guage with assignments. As seen in the tutorial, the semantics of expressions

• (λx. J interprets all constants as defined in the lecture and + as the usual addition on natural numbers.. Exercises 2 and 4 will only be discussed in the exercise meeting, if

Long-term exposure to fine particulate matter and incidence of type 2 diabetes mellitus in a cohort study: effects of total and traffic-specific air pollution.. Rajagopalan S,

Perhaps the most popular heuristic used for this problem is Lloyd’s method, which consists of the following two phases: (a) “Seed” the process with some initial centers (the

Feeding experiments with specifically 13 C-labeled glucose disclosed that the diterpenoid part of the striatals/striatins is formed via the mevalonate pathway, whereas the