Logosphere A Digital Library of Formal Proof Carsten Schrmann - - PowerPoint PPT Presentation

logosphere
SMART_READER_LITE
LIVE PREVIEW

Logosphere A Digital Library of Formal Proof Carsten Schrmann - - PowerPoint PPT Presentation

Logosphere A Digital Library of Formal Proof Carsten Schrmann Processor Verification INTEL (HOL/HOL light). [John Harrison] $500mio Pentium bug. AMD (ACL2, Nqthm). [Matt Kaufmann] Siemens, Microsoft (ASM). [Yuri


slide-1
SLIDE 1

Logosphere

A Digital Library of Formal Proof

Carsten Schürmann

slide-2
SLIDE 2
  • INTEL (HOL/HOL light). [John Harrison]
  • $500mio Pentium bug.
  • AMD (ACL2, Nqthm). [Matt Kaufmann]
  • Siemens, Microsoft (ASM). [Yuri Gurevich]

Processor Verification

slide-3
SLIDE 3

What’s Intel up to?

HOL [Harrison’03] Floating Point arithmetic.

Actual system Mathematical model Mathematical specification Actual requirements

lthough analyzing this condition combinatorially

Round the same way if

|- (precision fmt = 0) ( m. m IN midpoints fmt abs(x - y) < abs(x - m)) (round fmt Nearest x = round fmt Nearest y)

slide-4
SLIDE 4

NASA Space Shuttle

Huge PVS libraries developed at NASA. Algebra, Real analysis, Complex numbers, Directed graphs, Graph theory, Integer division, Abstract orders, Lattices, Fixed Points, Power sets, Trigonometry, Series, Taylor’s theorem etc. Sharing ok, but how?

slide-5
SLIDE 5

Mathematics

Four-Color theorem [Appel, Haken 1976] Kepler’s Conjecture 2D [Thue 1890] 3D [Hales 1989]

slide-6
SLIDE 6
  • Reconstruct mathematical vernacular.
  • Proof verifier.
  • Large body of mathematical knowledge.
  • No explicit proof objects.
  • Journal of formalized mathematics.
  • On the Hausdorff distance between compact subsets. [Adam Grabowski]
  • Chains on a grating in Euclidean space. [Freek Wiedijk]

MIZAR [Trybulec’72]

slide-7
SLIDE 7

First-

  • rder

logic Proposi tional logic Higher-

  • rder

logic Martin Löf's type theory Calculus of Constructions PVS NUPRL COQ Otter Vampire Chaff SMV SPIN Tempor al logic Modal logic OMEGA MIZAR HOL HOL light LCF Automath AGDA Nqthm ACL2

Logic Diversification

slide-8
SLIDE 8

Digital Libraries

FDL library. [Constable 2000]

  • Storage, retrieval of mathematical facts.
  • Logic dependent.
  • Logosphere. [Schürmann 2002]
  • Logical framework.
  • Foundationally uncommitted.
  • Theory morphisms.
  • Currently under development.
slide-9
SLIDE 9

What shall we store?

Semantic meaning of a theorem! Formulas alone insufficient.

  • Logics vary in proof-theoretic strength.
  • Example: First-order logic vs. impredicative type theory.
  • Semantics-preserving transformations.

| =L1 F1 = ⇒ | =L2 F2

slide-10
SLIDE 10

Meaning of theorems ...

... are mathematical entities expressed as

  • Denotations (Domain theory).
  • Objects (Category theory).
  • {0,1} (Model theory).
  • Strategies (Game theory).
  • Syntactic Proofs (Proof Theory).

Large proofs but small trustworthy checkers.

slide-11
SLIDE 11

Rest of this talk

  • The logic HOL.
  • Logical framework LF.
  • Nuprl type theory.
  • HOL - Nuprl connection.
  • Open questions.

joint work with Mark-Oliver Stehr

slide-12
SLIDE 12
slide-13
SLIDE 13

HOL

  • Higher-order logic [Church ‘40]
  • HOL theorem prover [Gordon ‘85]
  • Flavor: Isabelle/HOL [Paulson, Gordon ‘92]

Terms: e1, e2 ::= x |=|⊃| e1 e2 | λx : τ.e Types: τ ::= o | τ1 → τ2

slide-14
SLIDE 14

HOL (Typing)

Judgments: e : τ Rules:

imp

⊃: o → o → o

eq

=: τ → τ → o e1 : τ2 → τ1 e2 : τ2 app e1 e2 : τ1 u x : τ1 . . . e : τ2

lamu

λx : τ1.e : τ1 → τ2

slide-15
SLIDE 15

HOL (Proofs)

Judgments: P Rules:

P P ⊃ Q

mp

Q P . . . Q

disch

P ⊃ Q

refl

P = P

beta

(λx : τ.P)Q = [Q/x]P

slide-16
SLIDE 16

HOL (Booleans)

bool ˆ = o true ˆ = λx : bool.x = λx : bool. x all P ˆ = P = λx : τ. true false ˆ = all (λx : bool.x) neg P ˆ = P ⊃ false P and Q ˆ = all (λR : bool.(P ⊃ Q ⊃ R) ⊃ R) the P (newly declared) ex P ˆ = P (the P)

slide-17
SLIDE 17
slide-18
SLIDE 18

Twelf

  • Logical framework LF. [Harper ‘93]
  • Meta-language for deductive systems.
  • Judgments-as-types, derivations-as-objects.
  • Representation methodology.
  • Higher-order abstract syntax.
  • Captures variable binding.
slide-19
SLIDE 19

Twelf (cont’d)

Representing numbers in BS (binary strings). Representing judgments in LF. Representing derivations in LF.

79 = ∗, 1, 0, 0, 1, 1, 1, 1

  • H1

P ⊃ Q H2 P

mp

Q

  • :

Q =

mp P Q H1 H2

P : type = P

slide-20
SLIDE 20

Adequacy Theorem: Every HOL derivation D

  • f P1, . . . , Pn Q can be represented in LF

as a canonical object D : Q in context u1 : P1, . . . un : Pn.

Twelf’s Strength

Logical Framework LF Canonical

  • bjects

HOL Terms Types Typing Derivability Definitions

slide-21
SLIDE 21

Twelf Encoding of HOL

tp : type. %name tp (A B).

  • -> : tp -> tp -> tp.

%infix right 10 -->.

  • : tp.

tm : tp -> type. %name tm (H G) (x y P Q R). =>: tm (o --> o --> o). == : tm (A --> A --> o). @ : tm (A --> B) -> tm A -> tm B. %infix left 15 @. \ : (tm A -> tm B) -> tm (A --> B). ==> = [H:tm o] [G:tm o] => @ H @ G. %infix right 13 ==>. === = [H:tm A] [G:tm A] == @ H @ G. %infix left 14 ===. |- : tm o -> type. %prefix 10 |-. %name |- D u. mp : |- H -> |- H ==> G -> |- G. disch : (|- H -> |- G) -> |- H ==> G. refl : |- H === H. beta : |- (\ H) @ G === (H G). sub : {G:tm A -> tm o} |- H1 === H2 -> |- G H1 -> |- G H2. abs : |- \ H === \ G <- ({x} |- H x === G x). bool = o. true : tm bool = (\ [x : tm bool] x) === (\ [x: tm bool] x). all| : tm ((A --> bool) --> bool) = \ [P:tm (A --> bool)] P === \ [x] true. all = [P] all| @ P . false : tm bool = all (\ [P] P). neg : tm (bool --> bool) = \ [P:tm bool] P ==> false. /|\ : tm (bool --> bool --> bool) = \ [P:tm bool] \ [Q:tm bool] all (\ [R:tm bool] (P ==> Q ==> R) ==> R). /\ = [P] [Q] /|\ @ P @ Q. %infix right 12 /\. \|/ : tm (bool --> bool --> bool) = \ [P:tm bool] \ [Q:tm bool] all (\ [R:tm bool] (P ==> R) ==> (Q ==> R) ==> R). \/ = [P] [Q] \|/ @ P @ Q. %infix right 11 \/. the| : tm ((A --> bool) --> A). the = [P] the| @ P . ex| : tm ((A --> bool) --> bool) = \ [P:tm (A --> bool)] P @ (the (\ [x] P @ x)). ex = [P] ex| @ P .

slide-22
SLIDE 22
slide-23
SLIDE 23

Nuprl

  • Polymorphic extensional type theory.

[Constable ‘86]

  • Judgments establishes equality among terms.
  • A type is true iff it is inhabited.
  • Many applications.
  • Ensemble (TCP/IP stack). [Kreitz ‘04]
  • Protocol
  • Verification. [Felty et al ‘98]
slide-24
SLIDE 24
slide-25
SLIDE 25

Translation

  • Original idea. [Howe ‘98]
  • Syntactic argument. [Meseguer, Stehr ‘01]
  • Implemented in Nuprl, replay of proof
  • scripts. [Naumov ‘01]
  • Formalized and executable specification.

[Schürmann, Stehr ‘05]

slide-26
SLIDE 26

Translation (cont’d)

  • Booleans.
  • Propositions-as-types.

boolean

=

unit + unit tt

=

inl bullet ff

=

inr bullet if e e1 e2

=

decide e (λz. e1) (λz. e2)

BOOLEAN

= U1

TRUE

=

unit FALSE

=

void ALL

= Π

=n=>

= Π

slide-27
SLIDE 27

Howe’s Observation

  • Axiom of the excluded middle.
  • Lift Booleans to propositions.
  • Lower propositions to Booleans.
  • All important laws verifiable within Nuprl.

inhI

inh # Πx : BOOLEAN. x + (x → void)

↑ (e) = if e TRUE FALSE.

↓ (P) = decide (inh P) (λx. tt) (λy. ff).

slide-28
SLIDE 28
  • Relations in Twelf.
  • Defining declarations omitted.
  • Executable within Twelf.
  • We can transform HOL proofs into Nuprl.

Translations-as-Relations

trans-tp

:

tp → nuprlterm → type trans-tm

:

tm A → nuprlterm → type trans-sentence

:

tm o → nuprlterm → type trans-proof

: P → trans-sentence P T → M#T → type

slide-29
SLIDE 29
slide-30
SLIDE 30

Conclusion

  • There is a true need to share mathematical

knowledge in form of proofs.

  • Proof-theory: syntax instead semantics.
  • Logical framework technology important.
  • Proof conversion between HOL and Nuprl.
  • For other systems (PVS), work in progress.
slide-31
SLIDE 31

Open Questions

  • Design of a query language.
  • Design of the database.
  • Shared domains, integers, natural numbers,

complex numbers.

  • Partial transformations.
  • Connection to OMDOC. [Kohlhase 2001]
  • Formalization of other logics.
slide-32
SLIDE 32

Thank you! www.logosphere.org