• Keine Ergebnisse gefunden

Conservative Extension of Theories

N/A
N/A
Protected

Academic year: 2022

Aktie "Conservative Extension of Theories"

Copied!
6
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

The axioms and rules of HOL (2)

Additionally, there is:

universalα, β, andηcongruence on terms (implicitly),

theaxiom of infinity, and

the axiom of choice (Hilbert operator).

This is the entire basis!

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 164

Properties of HOL

Theorem 1 (Soundness of HOL) HOL is sound:

`φ implies φis valid in the general/standard sense

Theorem 2 (Incompleteness of HOL) HOL is incomplete w.r.t. standard models:

There existφthat are valid in the standard sense, but 0φ

Remark

[And86, Chap. 5-7] presents proofs for these theorems. Note, however, that [And86] does not restrict the semantics to models whereDind is infinite.

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 165

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Section 3.3

Conservative Extension of Theories

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Basic ideas

Theories are stepwise extension of the core theory of HOL

Extensions may introduce new constants and new types

Inconsistencies are avoided by construction

Syntactical mechanisms are used to make extensions more convenient

Remark

Extensions only introduce names for “things” that already exist in the core theory.

(2)

Basic definitions

Terminology and basic definitions (cf. [GordonMelham93]):

Definition (Theory)

A (syntactic)theoryT is a triple(χ,Σ,A)where

χis a signature for type names

Σis a signature for function/constant names using types ofχ

A is a set of axioms overΣ

Definition (Consistent)

A theory T isconsistentiffFalseis not provable in T: A 0 False Definition (Theory extension)

A theoryT0 = (χ00,A0)is an extension of a theoryT = (χ,Σ,A)iff χ⊆χ0 andΣ⊆Σ0 andA ⊆A0.

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 168

Basic definitions (cont.)

Definition (Conservative extension) LetT = (χ,Σ,A)andTh(T) ={φ|A `φ};

a theory extensionT0 = (χ00,A0)ofT isconservativeiff Th(T) = (Th(T0)|Σ)

where|Σrestricts sets formulas to those containing only names inΣ. Lemma (Consistency)

If T0is a conservative extension of a consistent theory T, then False<Th(T0)

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 169

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Syntactic schemata for conservative extensions

Not every extension is conservative:

Counterexample

LetT = (χ,Σ,A)withnat ∈χ.

T0 = (χ,Σ,A∪ { ∀fnatnat.x =f x})isnota conservative extension ofT.

We consider conservative extensions by:

constant definitions

type definitions Remark

Cf. [GordonMelham93] for other extension schemata

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Constant definitions

Definition (Constant definition)

A theory extensionT0 = (χ00,A0)ofT = (χ,Σ,A)is called aconstant definitioniff

χ0 =χandΣ0 = Σ∪ {c ::α}withα∈χandc <Σ

A0 =A∪ {c =E}

Edoes not containc (no recursion)

Eis closed (no free variables)

(no subterm ofEhas a type containing a type variable that is not contained in the type of c)

(3)

Why side conditions?

no recursion and closedness guarantee well-definedness

Consider the following definition with a free type variable:

c = (∃x :: 0a.∃y :: 0a.x ,y) If the language allows to instantiate the type variables:

c =c (by refl)

=⇒ (∃x ::bool.∃y ::bool.x ,y) = (∃x ::Unit.∃y ::Unit.x ,y)

=⇒ True=False

=⇒ False

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 172

Constant definitions are conservative

Lemma (Constant definition)

A constant definition is a conservative extension.

Proof.

Proof sketch:

Th(T)⊆(Th(T0)|Σ) : from definition ofTh

(Th(T0)|Σ)⊆Th(T) : letπ0 be a proof forφ∈(Th(T0)|Σ). We unfold any subterm inπ0that containsc byc =Eintoπ. πis a proof inT, i.e.,φ∈Th(T).

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 173

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Constant definitions in Isabelle/HOL

Definitions ofTrue,False,All,Ex,¬,,,if,let: True :: bool

False :: bool

Not :: bool⇒bool ("‘¬_"’ [40] 40) If :: [bool, ’a, ’a ]⇒’a ("‘if _ then _ else _)"’) Let :: [’a, ’a⇒’b]’b

The :: (’a⇒bool)’a (binder"‘THE"’ 10) All :: (’a⇒bool)⇒bool (binder"‘∀"’ 10) Ex :: (’a⇒bool)⇒bool (binder"‘∃"’ 10)

= :: [’a,’a]⇒bool (infixl50)

∧ :: [bool, bool]⇒bool (infixr 35)

∨ :: [bool, bool]⇒bool (infixr 30)

−→ :: [bool, bool]⇒bool (infixr 25)

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Constant definitions in Isabelle/HOL (2)

True_def: True ≡ ((λx ::bool.x) = (λx.x)) All_def: All(P) ≡ (P = (λx.True))

Ex_def: Ex(P) ≡ ∀Q.(∀x.Px −→Q)−→Q False_def: False ≡ (∀P.P)

not_def: ¬PP −→False

and_def: P∧Q ≡ ∀R.(P −→Q−→R)−→R

or_def: P∨Q ≡ ∀R.(P −→R)−→(Q −→R)−→R if_def: IfP×yTHEz :: 0a.(P =True−→z=x)∧ (P =False−→z =y) Let_def: Lets f ≡ f(s)

(4)

Approaching type definitions

Idea

Specify a subset of the elements of an existing typer

“Copy” the subset and use the copy as value set of the new typet

Link old and new type by two functions

More precisely, a type definition is based on:

an existing typer

a predicateS ::r ⇒ bool, defining anon-empty“subset” ofr;

an abstraction functionAbst :: r ⇒t

a representation functionRept ::t ⇒r

axioms stating an isomorphism between S and the new type t.

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 176

Type definitions as theory extensions

Definition (Type definition)

LetT = (χ,Σ,A)be a theory andr ∈χandSa term of typer ⇒bool.

A theory extensionT0 = (χ00,A0)ofT is atype definitionfort witht <χ iff

χ0 =χ∪ {t}

Σ0 = Σ∪ {Abst ::r ⇒ t, Rept ::t ⇒r }

A0 =A∪ { ∀x.Abst(Rept x) =x, ∀y.S y−→Rept(Abst y) =y }

One has to proveT ` ∃x.S x (using Isabelle/HOL)

Lemma (Type definition)

A type definition is a conservative extension.

For a proof see [GordonMelham93]

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 177

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

The nature of extensions

Remark

This may seem strange: if a new type is always isomorphic to a subset of an existing type, how is this construction going to lead to a “rich” collection of types for large-scale applications?

But in fact, due toindand⇒, the types in HOL are already very rich.

Thus, extensions essentially give names to values and types that have already been “expressible” in the “old” theory.

Extensions allow to formulate theorems in a more compact and readable way.

We now give three examples revealing the power of type definitions:

Typed sets

Pairs

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Types for sets

We define the new typenatset containing all sets of natural numbers:

existing type:(nat ⇒bool)

predicateS:: (nat ⇒bool)⇒bool,S ≡ λf.True

χ0 =χ∪ {natset}

Σ0 = Σ∪ {Absnatset :: (nat ⇒bool)⇒natset, Repnatset ::natset ⇒(nat⇒bool)}

A0 =A∪ { ∀x.Absnatset(Repnatset x) =x,

y.True−→Repnatset(Absnatset y) =y }

One has to proveT ` ∃x.(λf.True)x (using Isabelle/HOL)

(5)

Remarks on the set type

Remarks

Isabelle/HOL allows to define a parametric type αset whereαis a type variable.

Functions of typeα⇒boolare used to represent sets, i.e., sets are represented by theircharacteristic function.

In(Absαset f), the abstraction functionAbsαset can thus be read as

“interpretf as a set”.

Here, sets are just an example to demonstrate type definitions.

Later we study them for their own sake.

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 180

Approaching the types for pairs

Given some typesαandβ.

How can we represent pairs, i.e., define the typeα×β? Idea:

Existing type:α⇒ β⇒bool

Represent pairs as functions of typeα⇒ β⇒bool)

Use functionλx ::α. λy ::β.x =a∧y =b to represent the pair(a,b)

It is clear that there is exactly one function for each pair.

There are also functions of typeα⇒β⇒ boolthat do not represent a pair, i.e., we have to define a nontrivialS.

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 181

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Types for pairs

We define the new typeα×β:

existing type: α⇒β⇒bool

predicateS ≡ λf ::α⇒β⇒bool.

a.∃b.f =λx ::α. λy :: β.x =a∧y =b

χ0=χ∪ {α×β} Remark

Isabelle/HOL provides a special syntax for type definitions.

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Type definitions in Isabelle/HOL

Syntax for type definitions

typedef (T) (typevars) T’ = "{x. A(x)}"

Relation with explained schema:

The new type isT0

r is the type ofx (inferred)

Sisλx.A x

ConstantsAbsT0 andRepT0 are automatically generated.

(6)

Conservative extensions: Summary

We have presented a method tosafelybuild up larger theories:

I Constant definitions

I Type definitions

Subtle side conditions

New types must be isomorphic to a “subset” of an existing type.

Isabelle/HOL uses these conservative extensions to

I build up the theoryMainfrom the core definitions of HOL

I provide more convenient specialized syntax for conservative extensions (datatype, primrec, function, ...)

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 184

Conclusions of Chap. 3

HOL generalizes semantics of FOL

I boolserves as type of propositions

I Syntax/semantics allows for higher-order functions

Logic is rather minimal: 8 rules, more-or-less obvious

Logic is very powerful in terms of what we can represent/derive.

I Other “logical” syntax

I Rich theories via conservative extensions

©Arnd Poetzsch-Heffter et al. TU Kaiserslautern 185

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Questions

1. What is the foundational reason that HOL is typed? Are there other reasons w.r.t. an application in computer science?

2. What does “higher-order” mean?

3. Why is predicate logic not sufficient? Give an example?

4. What are the types in HOL?

5. What are the terms in HOL? Give examples of constants.

6. Explain the description operator.

7. What is a frame? What is an interpretation?

8. How is satisfiability defined?

3. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories

Questions (2)

9. What is a standard model?

10. Give and explain one of the axioms of HOL?

11. Can the constants True and False be defined in HOL?

12. What does it mean that HOL+infinity is incomplete wrt. standard models?

13. What is a conservative extension?

14. What is the advantage of conservative extensions over axiomatic definitions?

15. Which syntactic schemata for conservative extensions were treated in the lecture?

16. Give examples of constant definitions.

17. Explain the definitions of new types?

18. Does a data type definition in Isabelle/HOL lead to a new type?

Referenzen

ÄHNLICHE DOKUMENTE

Finney (1948) has given a table which may be used to test the significance of the deviation from proportionality in any 2 x 2 contingency table having both the frequencies in one

This may seem strange: if a new type is always isomorphic to a subset of an existing type, how is this construction going to lead to a “rich” collection of types for

True_def: True ≡ ((λ x :: bool.. Foundations of Higher-Order Logic 3.3 Conservative Extension of Theories. The nature

• Bertrand Russell found paradox in Frege’s system and proposed the Ramified Theory of Types.. • Wrote Principia Mathematica with Whitehead, an attempt at developing basic

We formulated a model for the temporal evolution of the density of agents in a market, where the density itself depends both on the propensity to trade and wealth, which are here

With a foreword by Tiff Macklem, outgoing senior deputy governor of the Bank of Canada, Crisis and Reform examines Canada’s role in the formative years of the international

The presented upper bound for the Hausdorff distance between the reachable sets of conservative and non-conservative networks provides us with a metric to compare the variation

We shall now formulate two auxiliary results which will be used in the proof of Theorem 3.. Stochastic Models of Control and Economic