1 |
1 |
2 \chapter{Theorems and Forward Proof} |
2 \chapter{Theorems and Forward Proof} |
3 |
3 |
4 \section{Proof terms}\label{sec:proofObjects} |
4 \section{Proof terms}\label{sec:proofObjects} |
5 \begin{ttbox} |
|
6 infix 8 % %%; |
|
7 |
5 |
8 datatype proof = |
|
9 PBound of int |
|
10 | Abst of string * typ option * proof |
|
11 | AbsP of string * term option * proof |
|
12 | op % of proof * term option |
|
13 | op %% of proof * proof |
|
14 | Hyp of term |
|
15 | PThm of (string * (string * string list) list) * |
|
16 proof * term * typ list option |
|
17 | PAxm of string * term * typ list option |
|
18 | Oracle of string * term * typ list option |
|
19 | MinProof of proof list; |
|
20 \end{ttbox} |
|
21 |
|
22 \begin{ttdescription} |
|
23 \item[\ttindexbold{Abst} ($a$, $\tau$, $prf$)] is the abstraction over |
|
24 a {\it term variable} of type $\tau$ in the body $prf$. Logically, this |
|
25 corresponds to $\bigwedge$ introduction. The name $a$ is used only for |
|
26 parsing and printing. |
|
27 \item[\ttindexbold{AbsP} ($a$, $\varphi$, $prf$)] is the abstraction |
|
28 over a {\it proof variable} standing for a proof of proposition $\varphi$ |
|
29 in the body $prf$. This corresponds to $\Longrightarrow$ introduction. |
|
30 \item[$prf$ \% $t$] \index{\%@{\tt\%}|bold} |
|
31 is the application of proof $prf$ to term $t$ |
|
32 which corresponds to $\bigwedge$ elimination. |
|
33 \item[$prf@1$ \%\% $prf@2$] \index{\%\%@{\tt\%\%}|bold} |
|
34 is the application of proof $prf@1$ to |
|
35 proof $prf@2$ which corresponds to $\Longrightarrow$ elimination. |
|
36 \item[\ttindexbold{PBound} $i$] is a {\em proof variable} with de Bruijn |
|
37 \cite{debruijn72} index $i$. |
|
38 \item[\ttindexbold{Hyp} $\varphi$] corresponds to the use of a meta level |
|
39 hypothesis $\varphi$. |
|
40 \item[\ttindexbold{PThm} (($name$, $tags$), $prf$, $\varphi$, $\overline{\tau}$)] |
|
41 stands for a pre-proved theorem, where $name$ is the name of the theorem, |
|
42 $prf$ is its actual proof, $\varphi$ is the proven proposition, |
|
43 and $\overline{\tau}$ is |
|
44 a type assignment for the type variables occurring in the proposition. |
|
45 \item[\ttindexbold{PAxm} ($name$, $\varphi$, $\overline{\tau}$)] |
|
46 corresponds to the use of an axiom with name $name$ and proposition |
|
47 $\varphi$, where $\overline{\tau}$ is a type assignment for the type |
|
48 variables occurring in the proposition. |
|
49 \item[\ttindexbold{Oracle} ($name$, $\varphi$, $\overline{\tau}$)] |
|
50 denotes the invocation of an oracle with name $name$ which produced |
|
51 a proposition $\varphi$, where $\overline{\tau}$ is a type assignment |
|
52 for the type variables occurring in the proposition. |
|
53 \item[\ttindexbold{MinProof} $prfs$] |
|
54 represents a {\em minimal proof} where $prfs$ is a list of theorems, |
|
55 axioms or oracles. |
|
56 \end{ttdescription} |
|
57 Note that there are no separate constructors |
6 Note that there are no separate constructors |
58 for abstraction and application on the level of {\em types}, since |
7 for abstraction and application on the level of {\em types}, since |
59 instantiation of type variables is accomplished via the type assignments |
8 instantiation of type variables is accomplished via the type assignments |
60 attached to {\tt Thm}, {\tt Axm} and {\tt Oracle}. |
9 attached to {\tt Thm}, {\tt Axm} and {\tt Oracle}. |
61 |
10 |
71 \texttt{HOL}, whose underlying proof is |
20 \texttt{HOL}, whose underlying proof is |
72 {\tt AbsP ("H", None, AbsP ("H", None, $\dots$))}. |
21 {\tt AbsP ("H", None, AbsP ("H", None, $\dots$))}. |
73 The theorem is applied to two (implicit) term arguments, which correspond |
22 The theorem is applied to two (implicit) term arguments, which correspond |
74 to the two variables occurring in its proposition. |
23 to the two variables occurring in its proposition. |
75 |
24 |
76 Isabelle's inference kernel can produce proof objects with different |
|
77 levels of detail. This is controlled via the global reference variable |
|
78 \ttindexbold{proofs}: |
|
79 \begin{ttdescription} |
|
80 \item[proofs := 0;] only record uses of oracles |
|
81 \item[proofs := 1;] record uses of oracles as well as dependencies |
|
82 on other theorems and axioms |
|
83 \item[proofs := 2;] record inferences in full detail |
|
84 \end{ttdescription} |
|
85 Reconstruction and checking of proofs as described in \S\ref{sec:reconstruct_proofs} |
25 Reconstruction and checking of proofs as described in \S\ref{sec:reconstruct_proofs} |
86 will not work for proofs constructed with {\tt proofs} set to |
26 will not work for proofs constructed with {\tt proofs} set to |
87 {\tt 0} or {\tt 1}. |
27 {\tt 0} or {\tt 1}. |
88 Theorems involving oracles will be printed with a |
28 Theorems involving oracles will be printed with a |
89 suffixed \verb|[!]| to point out the different quality of confidence achieved. |
29 suffixed \verb|[!]| to point out the different quality of confidence achieved. |