src/Doc/Prog_Prove/document/intro-isabelle.tex
author nipkow
Thu, 23 Aug 2018 07:02:19 +0200
changeset 68791 5e7b3e6625eb
parent 68649 f849fc1cb65e
child 71140 6046f203c245
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
     1
Isabelle is a generic system for
58502
nipkow
parents: 58483
diff changeset
     2
implementing logical formalisms, and Isabelle/HOL is the specialization
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
     3
of Isabelle for HOL, which abbreviates Higher-Order Logic. We introduce
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
     4
HOL step by step following the equation
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
     5
\[ \mbox{HOL} = \mbox{Functional Programming} + \mbox{Logic}. \]
56989
nipkow
parents: 56451
diff changeset
     6
We assume that the reader is used to logical and set-theoretic notation
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
     7
and is familiar with the basic concepts of functional programming.
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
     8
\ifsem
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
     9
Open-minded readers have been known to pick up functional
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    10
programming through the wealth of examples in \autoref{sec:FP}
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    11
and \autoref{sec:CaseStudyExp}.
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    12
\fi
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    13
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    14
\autoref{sec:FP} introduces HOL as a functional programming language and
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    15
explains how to write simple inductive proofs of mostly equational properties
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    16
of recursive functions.
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    17
\ifsem
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    18
\autoref{sec:CaseStudyExp} contains a
54508
nipkow
parents: 54467
diff changeset
    19
small case study: arithmetic and boolean expressions, their evaluation,
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    20
optimization and compilation.
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    21
\fi
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    22
\autoref{ch:Logic} introduces the rest of HOL: the
56989
nipkow
parents: 56451
diff changeset
    23
language of formulas beyond equality, automatic proof tools, single-step
nipkow
parents: 56451
diff changeset
    24
proofs, and inductive definitions, an essential specification construct.
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    25
\autoref{ch:Isar} introduces Isar, Isabelle's language for writing structured
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    26
proofs.
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    27
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    28
%Further material (slides, demos etc) can be found online at
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    29
%\url{http://www.in.tum.de/~nipkow}.
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    30
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    31
% Relics:
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    32
% We aim to minimise the amount of background knowledge of logic we expect
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    33
% from the reader
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    34
% We have focussed on the core material
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    35
% in the intersection of computation and logic.
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    36
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    37
This introduction to the core of Isabelle is intentionally concrete and
54508
nipkow
parents: 54467
diff changeset
    38
example-based: we concentrate on examples that illustrate the typical cases
nipkow
parents: 54467
diff changeset
    39
without explaining the general case if it can be inferred from the examples.
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    40
We cover the essentials (from a functional programming point of view) as
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    41
quickly and compactly as possible.
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    42
\ifsem
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    43
After all, this book is primarily about semantics.
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    44
\fi
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    45
47269
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    46
For a comprehensive treatment of all things Isabelle we recommend the
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    47
\emph{Isabelle/Isar Reference Manual}~\cite{IsarRef}, which comes with the
29aa0c071875 New manual Programming and Proving in Isabelle/HOL
nipkow
parents:
diff changeset
    48
Isabelle distribution.
54508
nipkow
parents: 54467
diff changeset
    49
The tutorial by Nipkow, Paulson and Wenzel~\cite{LNCS2283} (in its updated version that comes with the Isabelle distribution) is still recommended for the wealth of examples and material, but its proof style is outdated. In particular it does not cover the structured proof language Isar.
47546
2d49b0c9d8ec tuned text, improved dependencies
nipkow
parents: 47269
diff changeset
    50
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    51
%This introduction to Isabelle has grown out of many years of teaching
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    52
%Isabelle courses. 
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    53
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    54
\ifsem
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    55
\subsection*{Getting Started with Isabelle}
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    56
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    57
If you have not done so already, download and install Isabelle
68791
nipkow
parents: 68649
diff changeset
    58
(this book is compatible with Isabelle2018)
68649
f849fc1cb65e prefer HTTPS;
wenzelm
parents: 64852
diff changeset
    59
from \url{https://isabelle.in.tum.de}. You can start it by clicking
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    60
on the application icon. This will launch Isabelle's
62221
nipkow
parents: 59187
diff changeset
    61
user interface based on the text editor \concept{jEdit}. Below you see
62222
54a7b9422d3e synchronized with book
nipkow
parents: 62221
diff changeset
    62
a typical example snapshot of a session. At this point we merely explain
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    63
the layout of the window, not its contents.
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    64
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    65
\begin{center}
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    66
\includegraphics[width=\textwidth]{jedit.png}
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    67
\end{center}
58504
nipkow
parents: 58502
diff changeset
    68
The upper part of the window shows the input typed by the user, i.e., the
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    69
gradually growing Isabelle text of definitions, theorems, proofs, etc.  The
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    70
interface processes the user input automatically while it is typed, just like
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    71
modern Java IDEs.  Isabelle's response to the user input is shown in the
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    72
lower part of the window. You can examine the response to any input phrase
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    73
by clicking on that phrase or by hovering over underlined text.
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    74
62223
nipkow
parents: 62222
diff changeset
    75
\begin{warn}\label{proof-state}
62224
9343649abb09 tuned text
nipkow
parents: 62223
diff changeset
    76
Part I frequently refers to the proof state.
64852
f3504bc69ea3 fix problems because of "surj" input abbreviation; tuned
nipkow
parents: 62224
diff changeset
    77
You can see the proof state if you press the ``State'' button.
f3504bc69ea3 fix problems because of "surj" input abbreviation; tuned
nipkow
parents: 62224
diff changeset
    78
If you want to see the proof state combined with other system output, press ``Output'' and tick the ``Proof state'' box.
62222
54a7b9422d3e synchronized with book
nipkow
parents: 62221
diff changeset
    79
\end{warn}
54a7b9422d3e synchronized with book
nipkow
parents: 62221
diff changeset
    80
54a7b9422d3e synchronized with book
nipkow
parents: 62221
diff changeset
    81
This should suffice to get started with the jEdit interface.
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    82
Now you need to learn what to type into it.
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    83
\else
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    84
If you want to apply what you have learned about Isabelle we recommend you
59187
haftmann
parents: 58504
diff changeset
    85
download and read the book
57847
85b8cc142384 updated URL;
wenzelm
parents: 56989
diff changeset
    86
\href{http://www.concrete-semantics.org}{Concrete
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    87
Semantics}~\cite{ConcreteSemantics}, a guided tour of the wonderful world of
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    88
programming langage semantics formalised in Isabelle.  In fact,
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    89
\emph{Programming and Proving in Isabelle/HOL} constitutes part~I of
57847
85b8cc142384 updated URL;
wenzelm
parents: 56989
diff changeset
    90
\href{http://www.concrete-semantics.org}{Concrete Semantics}.  The web
85b8cc142384 updated URL;
wenzelm
parents: 56989
diff changeset
    91
pages for \href{http://www.concrete-semantics.org}{Concrete Semantics}
57819
nipkow
parents: 56989
diff changeset
    92
also provide a set of \LaTeX-based slides and Isabelle demo files
nipkow
parents: 56989
diff changeset
    93
for teaching \emph{Programming and Proving in Isabelle/HOL}.
52782
b11d73dbfb76 tuned intro
nipkow
parents: 48985
diff changeset
    94
\fi
47546
2d49b0c9d8ec tuned text, improved dependencies
nipkow
parents: 47269
diff changeset
    95
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
    96
\ifsem\else
47546
2d49b0c9d8ec tuned text, improved dependencies
nipkow
parents: 47269
diff changeset
    97
\paragraph{Acknowledgements}
54467
663a927fdc88 comments by Sean Seefried
nipkow
parents: 52814
diff changeset
    98
I wish to thank the following people for their comments on this document:
57819
nipkow
parents: 56989
diff changeset
    99
Florian Haftmann, Peter Johnson, Ren\'{e} Thiemann, Sean Seefried,
nipkow
parents: 56989
diff changeset
   100
Christian Sternagel and Carl Witty.
52814
ba5135f45f75 added Getting Started text
nipkow
parents: 52782
diff changeset
   101
\fi