12.07.2015 Views

Tutorial on Isabelle/HOL

Tutorial on Isabelle/HOL

Tutorial on Isabelle/HOL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 1. The Basics1.2 TheoriesWorking with <strong>Isabelle</strong> means creating theories. Roughly speaking, a theoryis a named collecti<strong>on</strong> of types, functi<strong>on</strong>s, and theorems, much like a modulein a programming language or a specificati<strong>on</strong> in a specificati<strong>on</strong> language. Infact, theories in <strong>HOL</strong> can be either. The general format of a theory T istheory Timports B 1 . . . B nbegindeclarati<strong>on</strong>s, definiti<strong>on</strong>s, and proofsendwhere B 1 . . . B n are the names of existing theories that T is based <strong>on</strong> anddeclarati<strong>on</strong>s, definiti<strong>on</strong>s, and proofs represents the newly introduced c<strong>on</strong>cepts(types, functi<strong>on</strong>s etc.) and proofs about them. The B i are the direct parenttheories of T. Everything defined in the parent theories (and their parents,recursively) is automatically visible. To avoid name clashes, identifiers canbe qualified by theory names as in T.f and B.f. Each theory T must residein a theory file named T.thy.This tutorial is c<strong>on</strong>cerned with introducing you to the different linguisticc<strong>on</strong>structs that can fill the declarati<strong>on</strong>s, definiti<strong>on</strong>s, and proofs above. A completegrammar of the basic c<strong>on</strong>structs is found in the <strong>Isabelle</strong>/Isar ReferenceManual [38].!!<strong>HOL</strong> c<strong>on</strong>tains a theory Main, the uni<strong>on</strong> of all the basic predefined theories likearithmetic, lists, sets, etc. Unless you know what you are doing, always includeMain as a direct or indirect parent of all your theories.<strong>HOL</strong>’s theory collecti<strong>on</strong> is available <strong>on</strong>line athttp://isabelle.in.tum.de/library/<strong>HOL</strong>/and is recommended browsing. In subdirectory Library you find a growinglibrary of useful theories that are not part of Main but can be included am<strong>on</strong>gthe parents of a theory and will then be loaded automatically.For the more adventurous, there is the Archive of Formal Proofs, ajournal-like collecti<strong>on</strong> of more advanced <strong>Isabelle</strong> theories:http://afp.sourceforge.net/We hope that you will c<strong>on</strong>tribute to it yourself <strong>on</strong>e day.1.3 Types, Terms and FormulaeEmbedded in a theory are the types, terms and formulae of <strong>HOL</strong>. <strong>HOL</strong> isa typed logic whose type system resembles that of functi<strong>on</strong>al programminglanguages like ML or Haskell. Thus there are

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!