28
Isabelle Tutorial: System, HOL and Proofs Burkhart Wolff, Makarius Wenzel Université Paris-Sud

Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Tutorial:System, HOL and Proofs

Burkhart Wolff, Makarius Wenzel Université Paris-Sud

Page 2: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What we will talk about

Page 3: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What we will talk about Isabelle with:

! its System Framework! the Logical Framework! the Isabelle/HOL Environment! Proof Contexts and Structured Proof! Tactic Proofs (“apply style”)

Page 4: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

The Isabelle

System Framework

Page 5: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Architecture ! Modern Isabelle Architecture consists of 5 identifyable layers

! SML layer ! Kernel & Proof Object Layer

! Tactic Layer and decision procedures

! Isar Engine

! PIDE Framework and Interface Layer

Page 6: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Architecture • Observation:

Effective parallelization is a PERVASIVE PROBLEM, that must be addressed

kernel PO

decisionprocedures

...

datatypes...

PIDE jEditScala System Interface

records...

multi-core PolySML

C1 C2 C3 C4

.

.

.

Page 7: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Architecture • In detail:

kernel PO

decisionprocedures

...

datatypes...

PIDE jEditScala System Interface

records...

multi-core PolySML

C1 C2 C3 C4

.

.

.

on the execution platform layer

Page 8: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Architecture • In detail:

kernel PO

decisionprocedures

...

datatypes...

PIDE jEditScala System Interface

...

multi-core PolySML

C1 C2 C3 C4

.

.

.

on the kernel layer

Page 9: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Architecture • In detail:

kernel PO

decisionprocedures

...

datatypes...

PIDE jEditScala System Interface

...

multi-core PolySML

C1 C2 C3 C4

.

.

.

on layer of procedures and packages

Page 10: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Isabelle Architecture • In detail:

kernel PO

decisionprocedures

...

datatypes...

PIDE jEditScala System Interface

...

multi-core PolySML

C1 C2 C3 C4

.

.

.

on the interface layerPIDE framework + Editor

Page 11: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

PIDE - GUI - Architecture(see PIDE - Project: http://bitbucket.org/pide/pide/wiki/Manifesto)

π d.e

prover

SML/Scalainterface

π d.e (Java / Scala)

inte-grationlayer

installationmanager

srcdistribution

server

e.g. Isabelle (SML)

domain editplugin

domain viewplugin

Swinglibrary

. . .

user

JVM/Scalainterface

Page 12: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! A Document Processor! … where documents have a unique name! … may acyclicly import documents! … and consists of an command sequence! … where new commands may be intro–duced

on the fly (i.e. the system framework is extensible).● A session (a collection of documents organized in

a hierachy) may be “frozen” to a session (or configuration)

Page 13: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Global View of a “session“

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

Document /“Theory”

cmd

A

BC

D

Page 14: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Global View

token

token

token

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

Document /“Theory”

cmd

A

BC

D

atom detailed view:

Page 15: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Document “positions” were evaluated to an

implicit state, the theory context T

Θ3

Θ0

Θ3 - 2

Θ3 - 1

“semantic”evaluationas SML function

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

Document /“Theory”

cmd

A

BC

D

Page 16: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Document “positions” were evaluated to an

implicit state, the theory context T

Θ

Θ0

Θ3 - 2

Θ3 - 1

“semantic”evaluationas SML function

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

Document /“Theory”

cmd

A

BC

D

Note: stateless command evaluation! No-side-effects apart from “state” managed by Isabelle !!!

Page 17: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Document “positions” were evaluated to an

implicit state, the theory context T

Θ3

Θ0

Θ3 - 2

Θ3 - 1

“semantic”evaluationas SML function

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

Document /“Theory”

cmd

A

BC

D

Note: the theory context T can contain a “type signature”and a “term signature”, “axioms”, but also system configuration information etc.

Page 18: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Document “positions” were evaluated to an

implicit state, the theory context T

Θ3

Θ0

Θ3 - 2

Θ3 - 1

“semantic”evaluationas SML function

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

cmd

Document /“Theory”

cmd

A

BC

D

Note: … and this is at the beginning a minimal intuitionistic logic called in Isabelle/Pure

Page 19: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Example

theory Dimports B Cbeginsection{* First Section *} text{* Some mathematical text: @{text \<alpha>}.*} ML{* fun fac x = if x = 0 then 1 else x*fac(x-1) *}

ML{* fac 10 *}end

Page 20: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Example

theory Dimports B Cbeginsection{* First Section *} text{* Some mathematical text: @{text \<alpha>}.*} ML{* fun fac x = if x = 0 then 1 else x*fac(x-1) *}

ML{* fac 10 *}end

Page 21: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

What is Isabelle as a System ? ! Example

theory Dimports B Cbeginsection{* First Section *} text{* Some mathematical text: @{text \<alpha>}.*} ML{* fun fac x = if x = 0 then 1 else x*fac(x-1) *}

ML{* fac 10 *}end

“fac” visible here because the ML environment is part of T !!

Page 22: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Demo I ! Start Isabelle (via the PIDE jEdit)! Browse „demo1.thy“! Commands:

" text, section, subsection" ML" value" a browser for theorems: find_theorems

! Capabilities:– hovering, jump-link,

Page 23: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Demo I

Page 24: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Demo I

Main (Editing)Panel

Page 25: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Demo I

OutputPanel

Page 26: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Demo I

Sidekick Panel/[Documentation Panel |Theories Panel]

Page 27: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Exercises! Start Isabelle (via the PIDE/jEdit: isabelle jedit demo1.thy)

! Explore Demo1.thy: Set output window, modify texts and value-computations, ML-code.

! Browse „Editor.thy“; ! Edit a (brief) document with mathematical notation.! Edit and evaluate a small SML program(see http://en.wikipedia.org/wiki/Standard_ML as primer)

Page 28: Isabelle Tutorialwolff/tutorials/2014-LRI... · What is Isabelle as a System ? ! Document “positions” were evaluated to an implicit state, the theory context T Θ 3 Θ 0 Θ 3

Parallel Nano-Kernel LCF-Archi-tecture

in the

jEdit - GUI(PIDE)

fine-grained, asynchronous parallelism(Isabelle2009-2)