1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 1
(*<*)
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 2
theory Paper
2183
+ − 3
imports "Quotient"
1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 4
"LaTeXsugar"
2186
+ − 5
"../Nominal/FSet"
1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 6
begin
1994
+ − 7
2286
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 8
(****
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 9
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 10
** things to do for the next version
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 11
*
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 12
* - what are quot_thms?
2287
+ − 13
* - what do all preservation theorems look like,
+ − 14
in particular preservation for quotient
+ − 15
compositions
2286
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 16
*)
e7bc2ae30faf
added a few points that need to be looked at the next version of the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 17
1994
+ − 18
notation (latex output)
2258
+ − 19
rel_conj ("_ \<circ>\<circ>\<circ> _" [53, 53] 52) and
2269
+ − 20
pred_comp ("_ \<circ>\<circ> _" [1, 1] 30) and
2258
+ − 21
"op -->" (infix "\<longrightarrow>" 100) and
+ − 22
"==>" (infix "\<Longrightarrow>" 100) and
2227
+ − 23
fun_map ("_ \<^raw:\mbox{\singlearr}> _" 51) and
+ − 24
fun_rel ("_ \<^raw:\mbox{\doublearr}> _" 51) and
2217
+ − 25
list_eq (infix "\<approx>" 50) and (* Not sure if we want this notation...? *)
2223
+ − 26
fempty ("\<emptyset>") and
+ − 27
funion ("_ \<union> _") and
+ − 28
finsert ("{_} \<union> _") and
2221
+ − 29
Cons ("_::_") and
+ − 30
concat ("flat") and
2223
+ − 31
fconcat ("\<Union>")
2220
+ − 32
2217
+ − 33
1994
+ − 34
2182
+ − 35
ML {*
+ − 36
fun nth_conj n (_, r) = nth (HOLogic.dest_conj r) n;
2274
+ − 37
2182
+ − 38
fun style_lhs_rhs proj = Scan.succeed (fn ctxt => fn t =>
+ − 39
let
+ − 40
val concl =
+ − 41
Object_Logic.drop_judgment (ProofContext.theory_of ctxt) (Logic.strip_imp_concl t)
+ − 42
in
+ − 43
case concl of (_ $ l $ r) => proj (l, r)
+ − 44
| _ => error ("Binary operator expected in term: " ^ Syntax.string_of_term ctxt concl)
+ − 45
end);
+ − 46
*}
2274
+ − 47
2182
+ − 48
setup {*
+ − 49
Term_Style.setup "rhs1" (style_lhs_rhs (nth_conj 0)) #>
+ − 50
Term_Style.setup "rhs2" (style_lhs_rhs (nth_conj 1)) #>
+ − 51
Term_Style.setup "rhs3" (style_lhs_rhs (nth_conj 2))
+ − 52
*}
2274
+ − 53
1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 54
(*>*)
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 55
2227
+ − 56
1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 57
section {* Introduction *}
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 58
2102
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 59
text {*
2205
+ − 60
\begin{flushright}
+ − 61
{\em ``Not using a [quotient] package has its advantages: we do not have to\\
+ − 62
collect all the theorems we shall ever want into one giant list;''}\\
2213
+ − 63
Larry Paulson \cite{Paulson06}
2237
+ − 64
\end{flushright}
2103
+ − 65
+ − 66
\noindent
2220
+ − 67
Isabelle is a popular generic theorem prover in which many logics can be
2214
+ − 68
implemented. The most widely used one, however, is Higher-Order Logic
+ − 69
(HOL). This logic consists of a small number of axioms and inference rules
+ − 70
over a simply-typed term-language. Safe reasoning in HOL is ensured by two
+ − 71
very restricted mechanisms for extending the logic: one is the definition of
+ − 72
new constants in terms of existing ones; the other is the introduction of
+ − 73
new types by identifying non-empty subsets in existing types. It is well
2223
+ − 74
understood how to use both mechanisms for dealing with quotient
2220
+ − 75
constructions in HOL (see \cite{Homeier05,Paulson06}). For example the
+ − 76
integers in Isabelle/HOL are constructed by a quotient construction over the
+ − 77
type @{typ "nat \<times> nat"} and the equivalence relation
2102
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 78
2237
+ − 79
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 80
@{text "(n\<^isub>1, n\<^isub>2) \<approx> (m\<^isub>1, m\<^isub>2) \<equiv> n\<^isub>1 + m\<^isub>2 = m\<^isub>1 + n\<^isub>2"}\hfill\numbered{natpairequiv}
+ − 81
\end{isabelle}
2102
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 82
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 83
\noindent
2217
+ − 84
This constructions yields the new type @{typ int} and definitions for @{text
2220
+ − 85
"0"} and @{text "1"} of type @{typ int} can be given in terms of pairs of
+ − 86
natural numbers (namely @{text "(0, 0)"} and @{text "(1, 0)"}). Operations
+ − 87
such as @{text "add"} with type @{typ "int \<Rightarrow> int \<Rightarrow> int"} can be defined in
+ − 88
terms of operations on pairs of natural numbers (namely @{text
2224
+ − 89
"add_pair (n\<^isub>1, m\<^isub>1) (n\<^isub>2,
2222
+ − 90
m\<^isub>2) \<equiv> (n\<^isub>1 + n\<^isub>2, m\<^isub>1 + m\<^isub>2)"}).
+ − 91
Similarly one can construct the type of finite sets, written @{term "\<alpha> fset"},
2223
+ − 92
by quotienting the type @{text "\<alpha> list"} according to the equivalence relation
2103
+ − 93
2237
+ − 94
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 95
@{text "xs \<approx> ys \<equiv> (\<forall>x. memb x xs \<longleftrightarrow> memb x ys)"}\hfill\numbered{listequiv}
+ − 96
\end{isabelle}
2103
+ − 97
+ − 98
\noindent
2224
+ − 99
which states that two lists are equivalent if every element in one list is
+ − 100
also member in the other. The empty finite set, written @{term "{||}"}, can
+ − 101
then be defined as the empty list and the union of two finite sets, written
+ − 102
@{text "\<union>"}, as list append.
2220
+ − 103
2269
+ − 104
Quotients are important in a variety of areas, but they are really ubiquitous in
2258
+ − 105
the area of reasoning about programming language calculi. A simple example
+ − 106
is the lambda-calculus, whose raw terms are defined as
+ − 107
2220
+ − 108
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 109
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 110
@{text "t ::= x | t t | \<lambda>x.t"}\hfill\numbered{lambda}
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 111
\end{isabelle}
2217
+ − 112
2220
+ − 113
\noindent
2256
+ − 114
The problem with this definition arises, for instance, when one attempts to
+ − 115
prove formally the substitution lemma \cite{Barendregt81} by induction
2222
+ − 116
over the structure of terms. This can be fiendishly complicated (see
2220
+ − 117
\cite[Pages 94--104]{CurryFeys58} for some ``rough'' sketches of a proof
2226
+ − 118
about raw lambda-terms). In contrast, if we reason about
2220
+ − 119
$\alpha$-equated lambda-terms, that means terms quotient according to
2223
+ − 120
$\alpha$-equivalence, then the reasoning infrastructure provided,
+ − 121
for example, by Nominal Isabelle \cite{UrbanKaliszyk11} makes the formal
2222
+ − 122
proof of the substitution lemma almost trivial.
2220
+ − 123
+ − 124
The difficulty is that in order to be able to reason about integers, finite
2221
+ − 125
sets or $\alpha$-equated lambda-terms one needs to establish a reasoning
2220
+ − 126
infrastructure by transferring, or \emph{lifting}, definitions and theorems
2226
+ − 127
from the raw type @{typ "nat \<times> nat"} to the quotient type @{typ int}
2220
+ − 128
(similarly for finite sets and $\alpha$-equated lambda-terms). This lifting
2222
+ − 129
usually requires a \emph{lot} of tedious reasoning effort \cite{Paulson06}.
2252
+ − 130
It is feasible to do this work manually, if one has only a few quotient
2247
+ − 131
constructions at hand. But if they have to be done over and over again, as in
2222
+ − 132
Nominal Isabelle, then manual reasoning is not an option.
2221
+ − 133
2223
+ − 134
The purpose of a \emph{quotient package} is to ease the lifting of theorems
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 135
and automate the reasoning as much as possible. In the
2223
+ − 136
context of HOL, there have been a few quotient packages already
2234
+ − 137
\cite{harrison-thesis,Slotosch97}. The most notable one is by Homeier
2223
+ − 138
\cite{Homeier05} implemented in HOL4. The fundamental construction these
+ − 139
quotient packages perform can be illustrated by the following picture:
2217
+ − 140
+ − 141
\begin{center}
2220
+ − 142
\mbox{}\hspace{20mm}\begin{tikzpicture}
+ − 143
%%\draw[step=2mm] (-4,-1) grid (4,1);
+ − 144
+ − 145
\draw[very thick] (0.7,0.3) circle (4.85mm);
+ − 146
\draw[rounded corners=1mm, very thick] ( 0.0,-0.9) rectangle ( 1.8, 0.9);
+ − 147
\draw[rounded corners=1mm, very thick] (-1.95,0.8) rectangle (-2.9,-0.195);
+ − 148
+ − 149
\draw (-2.0, 0.8) -- (0.7,0.8);
+ − 150
\draw (-2.0,-0.195) -- (0.7,-0.195);
2103
+ − 151
2220
+ − 152
\draw ( 0.7, 0.23) node {\begin{tabular}{@ {}c@ {}}equiv-\\[-1mm]clas.\end{tabular}};
+ − 153
\draw (-2.45, 0.35) node {\begin{tabular}{@ {}c@ {}}new\\[-1mm]type\end{tabular}};
+ − 154
\draw (1.8, 0.35) node[right=-0.1mm]
2224
+ − 155
{\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw elements)\end{tabular}};
2220
+ − 156
\draw (0.9, -0.55) node {\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};
+ − 157
+ − 158
\draw[->, very thick] (-1.8, 0.36) -- (-0.1,0.36);
+ − 159
\draw[<-, very thick] (-1.8, 0.16) -- (-0.1,0.16);
2221
+ − 160
\draw (-0.95, 0.26) node[above=0.4mm] {@{text Rep}};
+ − 161
\draw (-0.95, 0.26) node[below=0.4mm] {@{text Abs}};
2220
+ − 162
+ − 163
\end{tikzpicture}
+ − 164
\end{center}
2217
+ − 165
2221
+ − 166
\noindent
2247
+ − 167
The starting point is an existing type, to which we refer as the
2269
+ − 168
\emph{raw type} and over which an equivalence relation given by the user is
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 169
defined. With this input the package introduces a new type, to which we
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 170
refer as the \emph{quotient type}. This type comes with an
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 171
\emph{abstraction} and a \emph{representation} function, written @{text Abs}
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 172
and @{text Rep}.\footnote{Actually slightly more basic functions are given;
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 173
the functions @{text Abs} and @{text Rep} need to be derived from them. We
2269
+ − 174
will show the details later. } They relate elements in the
+ − 175
existing type to elements in the new type and vice versa, and can be uniquely
2256
+ − 176
identified by their quotient type. For example for the integer quotient construction
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 177
the types of @{text Abs} and @{text Rep} are
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 178
2224
+ − 179
+ − 180
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
2234
+ − 181
@{text "Abs :: nat \<times> nat \<Rightarrow> int"}\hspace{10mm}@{text "Rep :: int \<Rightarrow> nat \<times> nat"}
2224
+ − 182
\end{isabelle}
+ − 183
+ − 184
\noindent
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 185
We therefore often write @{text Abs_int} and @{text Rep_int} if the
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 186
typing information is important.
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 187
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 188
Every abstraction and representation function stands for an isomorphism
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 189
between the non-empty subset and elements in the new type. They are
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 190
necessary for making definitions involving the new type. For example @{text
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 191
"0"} and @{text "1"} of type @{typ int} can be defined as
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 192
2221
+ − 193
+ − 194
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 195
@{text "0 \<equiv> Abs_int (0, 0)"}\hspace{10mm}@{text "1 \<equiv> Abs_int (1, 0)"}
2221
+ − 196
\end{isabelle}
+ − 197
+ − 198
\noindent
2224
+ − 199
Slightly more complicated is the definition of @{text "add"} having type
2222
+ − 200
@{typ "int \<Rightarrow> int \<Rightarrow> int"}. Its definition is as follows
2221
+ − 201
2258
+ − 202
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 203
@{text "add n m \<equiv> Abs_int (add_pair (Rep_int n) (Rep_int m))"}
+ − 204
\hfill\numbered{adddef}
+ − 205
\end{isabelle}
+ − 206
2221
+ − 207
\noindent
2224
+ − 208
where we take the representation of the arguments @{text n} and @{text m},
2226
+ − 209
add them according to the function @{text "add_pair"} and then take the
2221
+ − 210
abstraction of the result. This is all straightforward and the existing
+ − 211
quotient packages can deal with such definitions. But what is surprising
2223
+ − 212
that none of them can deal with slightly more complicated definitions involving
2221
+ − 213
\emph{compositions} of quotients. Such compositions are needed for example
2247
+ − 214
in case of quotienting lists to yield finite sets and the operator that
2226
+ − 215
flattens lists of lists, defined as follows
2102
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 216
2220
+ − 217
@{thm [display, indent=10] concat.simps(1) concat.simps(2)[no_vars]}
2183
+ − 218
2103
+ − 219
\noindent
2221
+ − 220
We expect that the corresponding operator on finite sets, written @{term "fconcat"},
2248
+ − 221
builds finite unions of finite sets:
2188
+ − 222
2220
+ − 223
@{thm [display, indent=10] fconcat_empty[no_vars] fconcat_insert[no_vars]}
2102
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 224
2103
+ − 225
\noindent
2256
+ − 226
The quotient package should automatically provide us with a definition for @{text "\<Union>"} in
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 227
terms of @{text flat}, @{text Rep_fset} and @{text Abs_fset}. The problem is
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 228
that the method used in the existing quotient
2247
+ − 229
packages of just taking the representation of the arguments and then taking
2258
+ − 230
the abstraction of the result is \emph{not} enough. The reason is that in case
2224
+ − 231
of @{text "\<Union>"} we obtain the incorrect definition
+ − 232
2234
+ − 233
@{text [display, indent=10] "\<Union> S \<equiv> Abs_fset (flat (Rep_fset S))"}
2221
+ − 234
2224
+ − 235
\noindent
+ − 236
where the right-hand side is not even typable! This problem can be remedied in the
+ − 237
existing quotient packages by introducing an intermediate step and reasoning
2226
+ − 238
about flattening of lists of finite sets. However, this remedy is rather
2224
+ − 239
cumbersome and inelegant in light of our work, which can deal with such
+ − 240
definitions directly. The solution is that we need to build aggregate
+ − 241
representation and abstraction functions, which in case of @{text "\<Union>"}
+ − 242
generate the following definition
+ − 243
2234
+ − 244
@{text [display, indent=10] "\<Union> S \<equiv> Abs_fset (flat ((map Rep_fset \<circ> Rep_fset) S))"}
2221
+ − 245
+ − 246
\noindent
2223
+ − 247
where @{term map} is the usual mapping function for lists. In this paper we
2224
+ − 248
will present a formal definition of our aggregate abstraction and
2223
+ − 249
representation functions (this definition was omitted in \cite{Homeier05}).
2224
+ − 250
They generate definitions, like the one above for @{text "\<Union>"},
2226
+ − 251
according to the type of the raw constant and the type
2224
+ − 252
of the quotient constant. This means we also have to extend the notions
2237
+ − 253
of \emph{aggregate equivalence relation}, \emph{respectfulness} and \emph{preservation}
2231
+ − 254
from Homeier \cite{Homeier05}.
2223
+ − 255
2252
+ − 256
In addition we are able to address the criticism by Paulson \cite{Paulson06} cited
2237
+ − 257
at the beginning of this section about having to collect theorems that are
2247
+ − 258
lifted from the raw level to the quotient level into one giant list. Our
+ − 259
quotient package is the first one that is modular so that it allows to lift
2282
+ − 260
single higher-order theorems separately. This has the advantage for the user of being able to develop a
2252
+ − 261
formal theory interactively as a natural progression. A pleasing side-result of
2256
+ − 262
the modularity is that we are able to clearly specify what is involved
+ − 263
in the lifting process (this was only hinted at in \cite{Homeier05} and
2247
+ − 264
implemented as a ``rough recipe'' in ML-code).
+ − 265
2237
+ − 266
+ − 267
The paper is organised as follows: Section \ref{sec:prelims} presents briefly
2247
+ − 268
some necessary preliminaries; Section \ref{sec:type} describes the definitions
2252
+ − 269
of quotient types and shows how definitions of constants can be made over
2277
+ − 270
quotient types. Section \ref{sec:resp} introduces the notions of respectfulness
2274
+ − 271
and preservation; Section \ref{sec:lift} describes the lifting of theorems;
+ − 272
Section \ref{sec:examples} presents some examples
2256
+ − 273
and Section \ref{sec:conc} concludes and compares our results to existing
+ − 274
work.
2102
200954544cae
added some of the quotient literature; a bit more to the qpaper
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 275
*}
1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 276
2257
+ − 277
section {* Preliminaries and General Quotients\label{sec:prelims} *}
1978
+ − 278
+ − 279
text {*
2274
+ − 280
We give in this section a crude overview of HOL and describe the main
+ − 281
definitions given by Homeier for quotients \cite{Homeier05}.
2258
+ − 282
2274
+ − 283
At its core, HOL is based on a simply-typed term language, where types are
2269
+ − 284
recorded in Church-style fashion (that means, we can always infer the type of
2258
+ − 285
a term and its subterms without any additional information). The grammars
+ − 286
for types and terms are as follows
2256
+ − 287
+ − 288
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 289
\begin{tabular}{@ {}rl@ {\hspace{3mm}}l@ {}}
+ − 290
@{text "\<sigma>, \<tau> ::="} & @{text "\<alpha> | (\<sigma>,\<dots>, \<sigma>) \<kappa>"} & (type variables and type constructors)\\
+ − 291
@{text "t, s ::="} & @{text "x\<^isup>\<sigma> | c\<^isup>\<sigma> | t t | \<lambda>x\<^isup>\<sigma>. t"} &
+ − 292
(variables, constants, applications and abstractions)\\
+ − 293
\end{tabular}
+ − 294
\end{isabelle}
+ − 295
+ − 296
\noindent
+ − 297
We often write just @{text \<kappa>} for @{text "() \<kappa>"}, and use @{text "\<alpha>s"} and
2258
+ − 298
@{text "\<sigma>s"} to stand for collections of type variables and types,
+ − 299
respectively. The type of a term is often made explicit by writing @{text
2274
+ − 300
"t :: \<sigma>"}. HOL includes a type @{typ bool} for booleans and the function
+ − 301
type, written @{text "\<sigma> \<Rightarrow> \<tau>"}. HOL also contains many primitive and defined
+ − 302
constants; a primitive constant is equality, with type @{text "= :: \<sigma> \<Rightarrow> \<sigma> \<Rightarrow>
2287
+ − 303
bool"}, and the identity function with type @{text "id :: \<sigma> \<Rightarrow> \<sigma>"} is
2274
+ − 304
defined as @{text "\<lambda>x\<^sup>\<sigma>. x\<^sup>\<sigma>"}).
2256
+ − 305
2258
+ − 306
An important point to note is that theorems in HOL can be seen as a subset
2287
+ − 307
of terms that are constructed specially (namely through axioms and proof
2269
+ − 308
rules). As a result we are able to define automatic proof
2258
+ − 309
procedures showing that one theorem implies another by decomposing the term
+ − 310
underlying the first theorem.
+ − 311
2274
+ − 312
Like Homeier, our work relies on map-functions defined for every type
+ − 313
constructor taking some arguments, for example @{text map} for lists. Homeier
+ − 314
describes in \cite{Homeier05} map-functions for products, sums, options and
+ − 315
also the following map for function types
2258
+ − 316
+ − 317
@{thm [display, indent=10] fun_map_def[no_vars, THEN eq_reflection]}
+ − 318
+ − 319
\noindent
+ − 320
Using this map-function, we can give the following, equivalent, but more
+ − 321
uniform, definition for @{text add} shown in \eqref{adddef}:
2256
+ − 322
2258
+ − 323
@{text [display, indent=10] "add \<equiv> (Rep_int \<singlearr> Rep_int \<singlearr> Abs_int) add_pair"}
2182
+ − 324
2258
+ − 325
\noindent
2274
+ − 326
Using extensionality and unfolding the definition of @{text "\<singlearr>"},
+ − 327
we can get back to \eqref{adddef}.
+ − 328
In what follows we shall use the convention to write @{text "map_\<kappa>"} for a map-function
+ − 329
of the type-constructor @{text \<kappa>}. In our implementation we maintain
+ − 330
a database of these map-functions that can be dynamically extended.
2258
+ − 331
+ − 332
It will also be necessary to have operators, referred to as @{text "rel_\<kappa>"},
+ − 333
which define equivalence relations in terms of constituent equivalence
+ − 334
relations. For example given two equivalence relations @{text "R\<^isub>1"}
+ − 335
and @{text "R\<^isub>2"}, we can define an equivalence relations over
+ − 336
products as follows
+ − 337
%
+ − 338
@{text [display, indent=10] "(R\<^isub>1 \<tripple> R\<^isub>2) (x\<^isub>1, x\<^isub>2) (y\<^isub>1, y\<^isub>2) \<equiv> R\<^isub>1 x\<^isub>1 y\<^isub>1 \<and> R\<^isub>2 x\<^isub>2 y\<^isub>2"}
1978
+ − 339
2258
+ − 340
\noindent
2269
+ − 341
Homeier gives also the following operator for defining equivalence
+ − 342
relations over function types
2258
+ − 343
%
2274
+ − 344
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 345
@{thm fun_rel_def[of "R\<^isub>1" "R\<^isub>2", no_vars, THEN eq_reflection]}
+ − 346
\hfill\numbered{relfun}
+ − 347
\end{isabelle}
+ − 348
+ − 349
\noindent
2319
+ − 350
In the context of quotients, the following two notions from \cite{Homeier05}
+ − 351
are needed later on.
2274
+ − 352
+ − 353
\begin{definition}[Respects]\label{def:respects}
+ − 354
An element @{text "x"} respects a relation @{text "R"} provided @{text "R x x"}.
+ − 355
\end{definition}
+ − 356
+ − 357
\begin{definition}[Bounded Quantification and Bounded Abstractions]\label{def:babs}
+ − 358
@{text "\<forall>x \<in> S. P x"} holds if for all @{text x}, @{text "x \<in> S"} implies @{text "P x"};
+ − 359
and @{text "(\<lambda>x \<in> S. f x) = f x"} provided @{text "x \<in> S"}.
+ − 360
\end{definition}
2258
+ − 361
+ − 362
The central definition in Homeier's work \cite{Homeier05} relates equivalence
+ − 363
relations, abstraction and representation functions:
+ − 364
+ − 365
\begin{definition}[Quotient Types]
+ − 366
Given a relation $R$, an abstraction function $Abs$
+ − 367
and a representation function $Rep$, the predicate @{term "Quotient R Abs Rep"}
+ − 368
means
2182
+ − 369
\begin{enumerate}
+ − 370
\item @{thm (rhs1) Quotient_def[of "R", no_vars]}
+ − 371
\item @{thm (rhs2) Quotient_def[of "R", no_vars]}
+ − 372
\item @{thm (rhs3) Quotient_def[of "R", no_vars]}
+ − 373
\end{enumerate}
+ − 374
\end{definition}
+ − 375
2258
+ − 376
\noindent
2269
+ − 377
The value of this definition is that validity of @{text "Quotient R Abs Rep"} can
+ − 378
often be proved in terms of the validity of @{text "Quotient"} over the constituent
+ − 379
types of @{text "R"}, @{text Abs} and @{text Rep}.
2258
+ − 380
For example Homeier proves the following property for higher-order quotient
+ − 381
types:
+ − 382
2269
+ − 383
\begin{proposition}\label{funquot}
2258
+ − 384
@{thm[mode=IfThen] fun_quotient[where ?R1.0="R\<^isub>1" and ?R2.0="R\<^isub>2"
+ − 385
and ?abs1.0="Abs\<^isub>1" and ?abs2.0="Abs\<^isub>2" and ?rep1.0="Rep\<^isub>1" and ?rep2.0="Rep\<^isub>2"]}
+ − 386
\end{proposition}
2195
+ − 387
2258
+ − 388
\noindent
2274
+ − 389
As a result, Homeier is able to build an automatic prover that can nearly
2269
+ − 390
always discharge a proof obligation involving @{text "Quotient"}. Our quotient
+ − 391
package makes heavy
+ − 392
use of this part of Homeier's work including an extension
2274
+ − 393
to deal with compositions of equivalence relations defined as follows:
2234
+ − 394
2258
+ − 395
\begin{definition}[Composition of Relations]
+ − 396
@{abbrev "rel_conj R\<^isub>1 R\<^isub>2"} where @{text "\<circ>\<circ>"} is the predicate
2319
+ − 397
composition defined by
+ − 398
@{thm (concl) pred_compI[of "R\<^isub>1" "x" "y" "R\<^isub>2" "z"]}
2274
+ − 399
holds if and only if @{thm (prem 1) pred_compI[of "R\<^isub>1" "x" "y" "R\<^isub>2" "z"]} and
+ − 400
@{thm (prem 2) pred_compI[of "R\<^isub>1" "x" "y" "R\<^isub>2" "z"]}.
2258
+ − 401
\end{definition}
2237
+ − 402
2258
+ − 403
\noindent
2274
+ − 404
Unfortunately, there are two predicaments with compositions of relations.
+ − 405
First, a general quotient theorem, like the one given in Proposition \ref{funquot},
+ − 406
cannot be stated inside HOL, because of the restriction on types.
+ − 407
Second, even if we were able to state such a quotient theorem, it
2282
+ − 408
would not be true in general. However, we can prove specific instances of a
+ − 409
quotient theorem for composing particular quotient relations.
2287
+ − 410
For example, to lift theorems involving @{term flat} the quotient theorem for
+ − 411
composing @{text "\<approx>\<^bsub>list\<^esub>"} will be necessary: given @{term "Quotient R Abs Rep"}
+ − 412
with @{text R} being an equivalence relation, then
2282
+ − 413
2319
+ − 414
@{text [display, indent=10] "Quotient (rel_list R \<circ>\<circ>\<circ> \<approx>\<^bsub>list\<^esub>) (Abs_fset \<circ> map Abs) (map Rep \<circ> Rep_fset)"}
2282
+ − 415
+ − 416
\vspace{-.5mm}
2195
+ − 417
*}
+ − 418
2237
+ − 419
section {* Quotient Types and Quotient Definitions\label{sec:type} *}
1978
+ − 420
2234
+ − 421
text {*
2247
+ − 422
The first step in a quotient construction is to take a name for the new
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 423
type, say @{text "\<kappa>\<^isub>q"}, and an equivalence relation, say @{text R},
2247
+ − 424
defined over a raw type, say @{text "\<sigma>"}. The type of the equivalence
2269
+ − 425
relation must be @{text "\<sigma> \<Rightarrow> \<sigma> \<Rightarrow> bool"}. The user-visible part of
+ − 426
the quotient type declaration is therefore
2234
+ − 427
2235
+ − 428
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
2269
+ − 429
\isacommand{quotient\_type}~~@{text "\<alpha>s \<kappa>\<^isub>q = \<sigma> / R"}\hfill\numbered{typedecl}
2235
+ − 430
\end{isabelle}
+ − 431
+ − 432
\noindent
2237
+ − 433
and a proof that @{text "R"} is indeed an equivalence relation. Two concrete
+ − 434
examples are
+ − 435
+ − 436
+ − 437
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 438
\begin{tabular}{@ {}l}
+ − 439
\isacommand{quotient\_type}~~@{text "int = nat \<times> nat / \<approx>\<^bsub>nat \<times> nat\<^esub>"}\\
+ − 440
\isacommand{quotient\_type}~~@{text "\<alpha> fset = \<alpha> list / \<approx>\<^bsub>list\<^esub>"}
+ − 441
\end{tabular}
+ − 442
\end{isabelle}
+ − 443
+ − 444
\noindent
+ − 445
which introduce the type of integers and of finite sets using the
+ − 446
equivalence relations @{text "\<approx>\<^bsub>nat \<times> nat\<^esub>"} and @{text
2269
+ − 447
"\<approx>\<^bsub>list\<^esub>"} defined in \eqref{natpairequiv} and
2247
+ − 448
\eqref{listequiv}, respectively (the proofs about being equivalence
2274
+ − 449
relations is omitted). Given this data, we define for declarations shown in
+ − 450
\eqref{typedecl} the quotient types internally as
2234
+ − 451
+ − 452
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 453
\isacommand{typedef}~~@{text "\<alpha>s \<kappa>\<^isub>q = {c. \<exists>x. c = R x}"}
+ − 454
\end{isabelle}
+ − 455
+ − 456
\noindent
2247
+ − 457
where the right-hand side is the (non-empty) set of equivalence classes of
2274
+ − 458
@{text "R"}. The constraint in this declaration is that the type variables
2237
+ − 459
in the raw type @{text "\<sigma>"} must be included in the type variables @{text
2274
+ − 460
"\<alpha>s"} declared for @{text "\<kappa>\<^isub>q"}. HOL will then provide us with the following
2269
+ − 461
abstraction and representation functions
2182
+ − 462
2234
+ − 463
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 464
@{text "abs_\<kappa>\<^isub>q :: \<sigma> set \<Rightarrow> \<alpha>s \<kappa>\<^isub>q"}\hspace{10mm}@{text "rep_\<kappa>\<^isub>q :: \<alpha>s \<kappa>\<^isub>q \<Rightarrow> \<sigma> set"}
+ − 465
\end{isabelle}
+ − 466
2235
+ − 467
\noindent
2269
+ − 468
As can be seen from the type, they relate the new quotient type and equivalence classes of the raw
2235
+ − 469
type. However, as Homeier \cite{Homeier05} noted, it is much more convenient
+ − 470
to work with the following derived abstraction and representation functions
+ − 471
2234
+ − 472
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 473
@{text "Abs_\<kappa>\<^isub>q x \<equiv> abs_\<kappa>\<^isub>q (R x)"}\hspace{10mm}@{text "Rep_\<kappa>\<^isub>q x \<equiv> \<epsilon> (rep_\<kappa>\<^isub>q x)"}
+ − 474
\end{isabelle}
+ − 475
+ − 476
\noindent
2235
+ − 477
on the expense of having to use Hilbert's choice operator @{text "\<epsilon>"} in the
2237
+ − 478
definition of @{text "Rep_\<kappa>\<^isub>q"}. These derived notions relate the
+ − 479
quotient type and the raw type directly, as can be seen from their type,
+ − 480
namely @{text "\<sigma> \<Rightarrow> \<alpha>s \<kappa>\<^isub>q"} and @{text "\<alpha>s \<kappa>\<^isub>q \<Rightarrow> \<sigma>"},
+ − 481
respectively. Given that @{text "R"} is an equivalence relation, the
2274
+ − 482
following property holds for every quotient type
+ − 483
(for the proof see \cite{Homeier05}).
2237
+ − 484
2258
+ − 485
\begin{proposition}
2287
+ − 486
@{text "Quotient R Abs_\<kappa>\<^isub>q Rep_\<kappa>\<^isub>q"}.
2258
+ − 487
\end{proposition}
2234
+ − 488
2247
+ − 489
The next step in a quotient construction is to introduce definitions of new constants
+ − 490
involving the quotient type. These definitions need to be given in terms of concepts
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 491
of the raw type (remember this is the only way how to extend HOL
2269
+ − 492
with new definitions). For the user the visible part of such definitions is the declaration
2235
+ − 493
+ − 494
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
2237
+ − 495
\isacommand{quotient\_definition}~~@{text "c :: \<tau>"}~~\isacommand{is}~~@{text "t :: \<sigma>"}
2235
+ − 496
\end{isabelle}
+ − 497
2237
+ − 498
\noindent
+ − 499
where @{text t} is the definiens (its type @{text \<sigma>} can always be inferred)
+ − 500
and @{text "c"} is the name of definiendum, whose type @{text "\<tau>"} needs to be
+ − 501
given explicitly (the point is that @{text "\<tau>"} and @{text "\<sigma>"} can only differ
2269
+ − 502
in places where a quotient and raw type is involved). Two concrete examples are
2188
+ − 503
2237
+ − 504
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
+ − 505
\begin{tabular}{@ {}l}
+ − 506
\isacommand{quotient\_definition}~~@{text "0 :: int"}~~\isacommand{is}~~@{text "(0::nat, 0::nat)"}\\
+ − 507
\isacommand{quotient\_definition}~~@{text "\<Union> :: (\<alpha> fset) fset \<Rightarrow> \<alpha> fset"}~~%
+ − 508
\isacommand{is}~~@{text "flat"}
+ − 509
\end{tabular}
+ − 510
\end{isabelle}
+ − 511
+ − 512
\noindent
+ − 513
The first one declares zero for integers and the second the operator for
2274
+ − 514
building unions of finite sets (@{text "flat"} having the type
+ − 515
@{text "(\<alpha> list) list \<Rightarrow> \<alpha> list"}).
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 516
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 517
The problem for us is that from such declarations we need to derive proper
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 518
definitions using the @{text "Abs"} and @{text "Rep"} functions for the
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 519
quotient types involved. The data we rely on is the given quotient type
2247
+ − 520
@{text "\<tau>"} and the raw type @{text "\<sigma>"}. They allow us to define \emph{aggregate
+ − 521
abstraction} and \emph{representation functions} using the functions @{text "ABS (\<sigma>,
2252
+ − 522
\<tau>)"} and @{text "REP (\<sigma>, \<tau>)"} whose clauses we give below. The idea behind
2274
+ − 523
these two functions is to simultaneously descend into the raw types @{text \<sigma>} and
2247
+ − 524
quotient types @{text \<tau>}, and generate the appropriate
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 525
@{text "Abs"} and @{text "Rep"} in places where the types differ. Therefore
2269
+ − 526
we generate just the identity whenever the types are equal. On the ``way'' down,
+ − 527
however we might have to use map-functions to let @{text Abs} and @{text Rep} act
2274
+ − 528
over the appropriate types. In what follows we use the short-hand notation
+ − 529
@{text "ABS (\<sigma>s, \<tau>s)"} to mean @{text "ABS (\<sigma>\<^isub>1, \<tau>\<^isub>1)\<dots>ABS (\<sigma>\<^isub>i, \<tau>\<^isub>i)"}; similarly
+ − 530
for @{text REP}.
+ − 531
%
2227
+ − 532
\begin{center}
2252
+ − 533
\hfill
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 534
\begin{tabular}{rcl}
2227
+ − 535
\multicolumn{3}{@ {\hspace{-4mm}}l}{equal types:}\\
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 536
@{text "ABS (\<sigma>, \<sigma>)"} & $\dn$ & @{text "id :: \<sigma> \<Rightarrow> \<sigma>"}\\
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 537
@{text "REP (\<sigma>, \<sigma>)"} & $\dn$ & @{text "id :: \<sigma> \<Rightarrow> \<sigma>"}\smallskip\\
2227
+ − 538
\multicolumn{3}{@ {\hspace{-4mm}}l}{function types:}\\
2233
+ − 539
@{text "ABS (\<sigma>\<^isub>1 \<Rightarrow> \<sigma>\<^isub>2, \<tau>\<^isub>1 \<Rightarrow> \<tau>\<^isub>2)"} & $\dn$ & @{text "REP (\<sigma>\<^isub>1, \<tau>\<^isub>1) \<singlearr> ABS (\<sigma>\<^isub>2, \<tau>\<^isub>2)"}\\
+ − 540
@{text "REP (\<sigma>\<^isub>1 \<Rightarrow> \<sigma>\<^isub>2, \<tau>\<^isub>1 \<Rightarrow> \<tau>\<^isub>2)"} & $\dn$ & @{text "ABS (\<sigma>\<^isub>1, \<tau>\<^isub>1) \<singlearr> REP (\<sigma>\<^isub>2, \<tau>\<^isub>2)"}\smallskip\\
2227
+ − 541
\multicolumn{3}{@ {\hspace{-4mm}}l}{equal type constructors:}\\
2232
+ − 542
@{text "ABS (\<sigma>s \<kappa>, \<tau>s \<kappa>)"} & $\dn$ & @{text "map_\<kappa> (ABS (\<sigma>s, \<tau>s))"}\\
+ − 543
@{text "REP (\<sigma>s \<kappa>, \<tau>s \<kappa>)"} & $\dn$ & @{text "map_\<kappa> (REP (\<sigma>s, \<tau>s))"}\smallskip\\
2227
+ − 544
\multicolumn{3}{@ {\hspace{-4mm}}l}{unequal type constructors:}\\
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 545
@{text "ABS (\<sigma>s \<kappa>, \<tau>s \<kappa>\<^isub>q)"} & $\dn$ & @{text "Abs_\<kappa>\<^isub>q \<circ> (MAP(\<rho>s \<kappa>) (ABS (\<sigma>s', \<tau>s)))"}\\
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 546
@{text "REP (\<sigma>s \<kappa>, \<tau>s \<kappa>\<^isub>q)"} & $\dn$ & @{text "(MAP(\<rho>s \<kappa>) (REP (\<sigma>s', \<tau>s))) \<circ> Rep_\<kappa>\<^isub>q"}
2247
+ − 547
\end{tabular}\hfill\numbered{ABSREP}
2227
+ − 548
\end{center}
2234
+ − 549
%
2232
+ − 550
\noindent
2274
+ − 551
In the last two clauses we have that the type @{text "\<alpha>s
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 552
\<kappa>\<^isub>q"} is the quotient of the raw type @{text "\<rho>s \<kappa>"} (for example
2237
+ − 553
@{text "int"} and @{text "nat \<times> nat"}, or @{text "\<alpha> fset"} and @{text "\<alpha>
+ − 554
list"}). The quotient construction ensures that the type variables in @{text
2247
+ − 555
"\<rho>s"} must be among the @{text "\<alpha>s"}. The @{text "\<sigma>s'"} are given by the
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 556
matchers for the @{text "\<alpha>s"} when matching @{text "\<rho>s \<kappa>"} against
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 557
@{text "\<sigma>s \<kappa>"}. The
2237
+ − 558
function @{text "MAP"} calculates an \emph{aggregate map-function} for a raw
+ − 559
type as follows:
+ − 560
%
2227
+ − 561
\begin{center}
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 562
\begin{tabular}{rcl}
2237
+ − 563
@{text "MAP' (\<alpha>)"} & $\dn$ & @{text "a\<^sup>\<alpha>"}\\
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 564
@{text "MAP' (\<kappa>)"} & $\dn$ & @{text "id :: \<kappa> \<Rightarrow> \<kappa>"}\\
2232
+ − 565
@{text "MAP' (\<sigma>s \<kappa>)"} & $\dn$ & @{text "map_\<kappa> (MAP'(\<sigma>s))"}\smallskip\\
2233
+ − 566
@{text "MAP (\<sigma>)"} & $\dn$ & @{text "\<lambda>as. MAP'(\<sigma>)"}
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 567
\end{tabular}
2227
+ − 568
\end{center}
2237
+ − 569
%
2232
+ − 570
\noindent
2252
+ − 571
In this definition we rely on the fact that we can interpret type-variables @{text \<alpha>} as
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 572
term variables @{text a}. In the last clause we build an abstraction over all
2274
+ − 573
term-variables of the map-function generated by the auxiliary function
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 574
@{text "MAP'"}.
2274
+ − 575
The need for aggregate map-functions can be seen in cases where we build quotients,
2247
+ − 576
say @{text "(\<alpha>, \<beta>) \<kappa>\<^isub>q"}, out of compound raw types, say @{text "(\<alpha> list) \<times> \<beta>"}.
+ − 577
In this case @{text MAP} generates the
+ − 578
aggregate map-function:
2232
+ − 579
2233
+ − 580
@{text [display, indent=10] "\<lambda>a b. map_prod (map a) b"}
+ − 581
+ − 582
\noindent
2274
+ − 583
which is essential in order to define the corresponding aggregate
+ − 584
abstraction and representation functions.
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 585
2247
+ − 586
To see how these definitions pan out in practise, let us return to our
+ − 587
example about @{term "concat"} and @{term "fconcat"}, where we have the raw type
+ − 588
@{text "(\<alpha> list) list \<Rightarrow> \<alpha> list"} and the quotient type @{text "(\<alpha> fset) fset \<Rightarrow> \<alpha>
2274
+ − 589
fset"}. Feeding these types into @{text ABS} gives us (after some @{text "\<beta>"}-simplifications)
2247
+ − 590
the abstraction function
2233
+ − 591
+ − 592
@{text [display, indent=10] "(map (map id \<circ> Rep_fset) \<circ> Rep_fset) \<singlearr> Abs_fset \<circ> map id"}
+ − 593
+ − 594
\noindent
2247
+ − 595
In our implementation we further
+ − 596
simplify this function by rewriting with the usual laws about @{text
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 597
"map"}s and @{text "id"}, namely @{term "map id = id"} and @{text "f \<circ> id =
2274
+ − 598
id \<circ> f = f"}. This gives us the simpler abstraction function
2237
+ − 599
2233
+ − 600
@{text [display, indent=10] "(map Rep_fset \<circ> Rep_fset) \<singlearr> Abs_fset"}
+ − 601
+ − 602
\noindent
+ − 603
which we can use for defining @{term "fconcat"} as follows
+ − 604
+ − 605
@{text [display, indent=10] "\<Union> \<equiv> ((map Rep_fset \<circ> Rep_fset) \<singlearr> Abs_fset) flat"}
2232
+ − 606
2237
+ − 607
\noindent
2247
+ − 608
Note that by using the operator @{text "\<singlearr>"} and special clauses
+ − 609
for function types in \eqref{ABSREP}, we do not have to
2252
+ − 610
distinguish between arguments and results, but can deal with them uniformly.
+ − 611
Consequently, all definitions in the quotient package
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 612
are of the general form
2188
+ − 613
2237
+ − 614
@{text [display, indent=10] "c \<equiv> ABS (\<sigma>, \<tau>) t"}
2227
+ − 615
2237
+ − 616
\noindent
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 617
where @{text \<sigma>} is the type of the definiens @{text "t"} and @{text "\<tau>"} the
2247
+ − 618
type of the defined quotient constant @{text "c"}. This data can be easily
+ − 619
generated from the declaration given by the user.
2252
+ − 620
To increase the confidence in this way of making definitions, we can prove
2247
+ − 621
that the terms involved are all typable.
2227
+ − 622
+ − 623
\begin{lemma}
+ − 624
If @{text "ABS (\<sigma>, \<tau>)"} returns some abstraction function @{text "Abs"}
+ − 625
and @{text "REP (\<sigma>, \<tau>)"} some representation function @{text "Rep"},
+ − 626
then @{text "Abs"} is of type @{text "\<sigma> \<Rightarrow> \<tau>"} and @{text "Rep"} of type
+ − 627
@{text "\<tau> \<Rightarrow> \<sigma>"}.
+ − 628
\end{lemma}
2233
+ − 629
2237
+ − 630
\begin{proof}
2274
+ − 631
By mutual induction and analysing the definitions of @{text "ABS"} and @{text "REP"}.
+ − 632
The cases of equal types and function types are
2247
+ − 633
straightforward (the latter follows from @{text "\<singlearr>"} having the
+ − 634
type @{text "(\<alpha> \<Rightarrow> \<beta>) \<Rightarrow> (\<gamma> \<Rightarrow> \<delta>) \<Rightarrow> (\<beta> \<Rightarrow> \<gamma>) \<Rightarrow> (\<alpha> \<Rightarrow> \<delta>)"}). In case of equal type
+ − 635
constructors we can observe that a map-function after applying the functions
+ − 636
@{text "ABS (\<sigma>s, \<tau>s)"} produces a term of type @{text "\<sigma>s \<kappa> \<Rightarrow> \<tau>s \<kappa>"}. The
+ − 637
interesting case is the one with unequal type constructors. Since we know
+ − 638
the quotient is between @{text "\<alpha>s \<kappa>\<^isub>q"} and @{text "\<rho>s \<kappa>"}, we have
+ − 639
that @{text "Abs_\<kappa>\<^isub>q"} is of type @{text "\<rho>s \<kappa> \<Rightarrow> \<alpha>s
+ − 640
\<kappa>\<^isub>q"}. This type can be more specialised to @{text "\<rho>s[\<tau>s] \<kappa> \<Rightarrow> \<tau>s
+ − 641
\<kappa>\<^isub>q"} where the type variables @{text "\<alpha>s"} are instantiated with the
+ − 642
@{text "\<tau>s"}. The complete type can be calculated by observing that @{text
+ − 643
"MAP (\<rho>s \<kappa>)"}, after applying the functions @{text "ABS (\<sigma>s', \<tau>s)"} to it,
+ − 644
returns a term of type @{text "\<rho>s[\<sigma>s'] \<kappa> \<Rightarrow> \<rho>s[\<tau>s] \<kappa>"}. This type is
+ − 645
equivalent to @{text "\<sigma>s \<kappa> \<Rightarrow> \<rho>s[\<tau>s] \<kappa>"}, which we just have to compose with
+ − 646
@{text "\<rho>s[\<tau>s] \<kappa> \<Rightarrow> \<tau>s \<kappa>\<^isub>q"} according to the type of @{text "\<circ>"}.\qed
2237
+ − 647
\end{proof}
+ − 648
+ − 649
\noindent
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 650
The reader should note that this lemma fails for the abstraction and representation
2274
+ − 651
functions used in Homeier's quotient package.
2188
+ − 652
*}
+ − 653
2252
+ − 654
section {* Respectfulness and Preservation \label{sec:resp} *}
2188
+ − 655
+ − 656
text {*
2247
+ − 657
The main point of the quotient package is to automatically ``lift'' theorems
+ − 658
involving constants over the raw type to theorems involving constants over
2274
+ − 659
the quotient type. Before we can describe this lifting process, we need to impose
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 660
two restrictions in the form of proof obligations that arise during the
2274
+ − 661
lifting. The reason is that even if definitions for all raw constants
+ − 662
can be given, \emph{not} all theorems can be lifted to the quotient type. Most
2287
+ − 663
notable is the bound variable function, that is the constant @{text bn}, defined
2274
+ − 664
for raw lambda-terms as follows
2188
+ − 665
2247
+ − 666
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
2252
+ − 667
@{text "bn (x) \<equiv> \<emptyset>"}\hspace{4mm}
+ − 668
@{text "bn (t\<^isub>1 t\<^isub>2) \<equiv> bn (t\<^isub>1) \<union> bn (t\<^isub>2)"}\hspace{4mm}
2247
+ − 669
@{text "bn (\<lambda>x. t) \<equiv> {x} \<union> bn (t)"}
+ − 670
\end{isabelle}
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 671
2247
+ − 672
\noindent
2274
+ − 673
We can generate a definition for this constant using @{text ABS} and @{text REP}.
+ − 674
But this constant does \emph{not} respect @{text "\<alpha>"}-equivalence and
2247
+ − 675
consequently no theorem involving this constant can be lifted to @{text
+ − 676
"\<alpha>"}-equated lambda terms. Homeier formulates the restrictions in terms of
2277
+ − 677
the properties of \emph{respectfulness} and \emph{preservation}. We have
2258
+ − 678
to slightly extend Homeier's definitions in order to deal with quotient
2247
+ − 679
compositions.
+ − 680
+ − 681
To formally define what respectfulness is, we have to first define
2287
+ − 682
the notion of \emph{aggregate equivalence relations} using the function @{text REL}:
2274
+ − 683
+ − 684
\begin{center}
+ − 685
\hfill
+ − 686
\begin{tabular}{rcl}
+ − 687
\multicolumn{3}{@ {\hspace{-4mm}}l}{equal types:}\\
+ − 688
@{text "REL (\<sigma>, \<sigma>)"} & $\dn$ & @{text "= :: \<sigma> \<Rightarrow> \<sigma> \<Rightarrow> bool"}\smallskip\\
+ − 689
\multicolumn{3}{@ {\hspace{-4mm}}l}{equal type constructors:}\\
+ − 690
@{text "REL (\<sigma>s \<kappa>, \<tau>s \<kappa>)"} & $\dn$ & @{text "rel_\<kappa> (REL (\<sigma>s, \<tau>s))"}\smallskip\\
+ − 691
\multicolumn{3}{@ {\hspace{-4mm}}l}{unequal type constructors:}\smallskip\\
+ − 692
@{text "REL (\<sigma>s \<kappa>, \<tau>s \<kappa>\<^isub>q)"} & $\dn$ & @{text "rel_\<kappa>\<^isub>q (REL (\<sigma>s', \<tau>s))"}\\
+ − 693
\end{tabular}\hfill\numbered{REL}
+ − 694
\end{center}
2238
8ddf1330f2ed
completed proof and started section about respectfulness and preservation
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 695
2274
+ − 696
\noindent
+ − 697
The @{text "\<sigma>s'"} in the last clause are calculated as in \eqref{ABSREP}:
+ − 698
we know that type @{text "\<alpha>s \<kappa>\<^isub>q"} is the quotient of the raw type
+ − 699
@{text "\<rho>s \<kappa>"}. The @{text "\<sigma>s'"} are determined by matching
+ − 700
@{text "\<rho>s \<kappa>"} and @{text "\<sigma>s \<kappa>"}.
+ − 701
+ − 702
Lets return to the lifting procedure of theorems. Assume we have a theorem
+ − 703
that contains the raw constant @{text "c\<^isub>r :: \<sigma>"} and which we want to
+ − 704
lift to a theorem where @{text "c\<^isub>r"} is replaced by the corresponding
+ − 705
constant @{text "c\<^isub>q :: \<tau>"} defined over a quotient type. In this situation
2287
+ − 706
we generate the following proof obligation
2274
+ − 707
+ − 708
@{text [display, indent=10] "REL (\<sigma>, \<tau>) c\<^isub>r c\<^isub>r"}
2258
+ − 709
2274
+ − 710
\noindent
2277
+ − 711
Homeier calls these proof obligations \emph{respectfulness
2278
+ − 712
theorems}. However, unlike his quotient package, we might have several
+ − 713
respectfulness theorems for one constant---he has at most one.
+ − 714
The reason is that because of our quotient compositions, the types
+ − 715
@{text \<sigma>} and @{text \<tau>} are not completely determined by the type of @{text "c\<^bsub>r\<^esub>"}.
+ − 716
And for every instantiation of the types, we might end up with a
+ − 717
corresponding respectfulness theorem.
+ − 718
+ − 719
Before lifting a theorem, we require the user to discharge
2287
+ − 720
respectfulness proof obligations. And the point with @{text bn} is that the respectfulness theorem
2274
+ − 721
looks as follows
+ − 722
+ − 723
@{text [display, indent=10] "(\<approx>\<^isub>\<alpha> \<doublearr> =) bn bn"}
+ − 724
+ − 725
\noindent
2287
+ − 726
and the user cannot discharge it: because it is not true. To see this,
2274
+ − 727
we can just unfold the definition of @{text "\<doublearr>"} \eqref{relfun}
2276
+ − 728
using extensionally to obtain
2274
+ − 729
+ − 730
@{text [display, indent=10] "\<forall>t\<^isub>1 t\<^isub>2. if t\<^isub>1 \<approx>\<^isub>\<alpha> t\<^isub>2 implies bn(t\<^isub>1) = bn(t\<^isub>2)"}
+ − 731
+ − 732
\noindent
+ − 733
In contrast, if we lift a theorem about @{text "append"} to a theorem describing
+ − 734
the union of finite sets, then we need to discharge the proof obligation
+ − 735
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 736
@{text [display, indent=10] "(\<approx>\<^bsub>list\<^esub> \<doublearr> \<approx>\<^bsub>list\<^esub> \<doublearr> \<approx>\<^bsub>list\<^esub>) append append"}
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 737
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 738
\noindent
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 739
To do so, we have to establish
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 740
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 741
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %%%
2287
+ − 742
if @{text "xs \<approx>\<^bsub>list\<^esub> ys"} and @{text "us \<approx>\<^bsub>list\<^esub> vs"}
+ − 743
then @{text "xs @ us \<approx>\<^bsub>list\<^esub> ys @ vs"}
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 744
\end{isabelle}
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 745
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 746
\noindent
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 747
which is straightforward given the definition shown in \eqref{listequiv}.
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 748
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 749
The second restriction we have to impose arises from
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 750
non-lifted polymorphic constants, which are instantiated to a
2287
+ − 751
type being quotient. For example, take the @{term "cons"}-constructor to
+ − 752
add a pair of natural numbers to a list, whereby teh pair of natural numbers
+ − 753
is to become an integer in te quotient construction. The point is that we
+ − 754
still want to use @{text cons} for
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 755
adding integers to lists---just with a different type.
2287
+ − 756
To be able to lift such theorems, we need a \emph{preservation property}
2276
+ − 757
for @{text cons}. Assuming we have a polymorphic raw constant
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 758
@{text "c\<^isub>r :: \<sigma>"} and a corresponding quotient constant @{text "c\<^isub>q :: \<tau>"},
2287
+ − 759
then a preservation property is as follows
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 760
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 761
@{text [display, indent=10] "Quotient R\<^bsub>\<alpha>s\<^esub> Abs\<^bsub>\<alpha>s\<^esub> Rep\<^bsub>\<alpha>s\<^esub> implies ABS (\<sigma>, \<tau>) c\<^isub>r = c\<^isub>r"}
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 762
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 763
\noindent
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 764
where the @{text "\<alpha>s"} stand for the type variables in the type of @{text "c\<^isub>r"}.
2278
+ − 765
In case of @{text cons} (which has type @{text "\<alpha> \<Rightarrow> \<alpha> list \<Rightarrow> \<alpha> list"}) we have
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 766
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 767
@{text [display, indent=10] "(Rep ---> map Rep ---> map Abs) cons = cons"}
2274
+ − 768
+ − 769
\noindent
2278
+ − 770
under the assumption @{text "Quotient R Abs Rep"}. Interestingly, if we have
+ − 771
an instance of @{text cons} where the type variable @{text \<alpha>} is instantiated
+ − 772
with @{text "nat \<times> nat"} and we also quotient this type to yield integers,
2287
+ − 773
then we need to show the corresponding preservation property.
2274
+ − 774
2279
+ − 775
%%%@ {thm [display, indent=10] insert_preserve2[no_vars]}
2189
+ − 776
2278
+ − 777
%Given two quotients, one of which quotients a container, and the
+ − 778
%other quotients the type in the container, we can write the
+ − 779
%composition of those quotients. To compose two quotient theorems
+ − 780
%we compose the relations with relation composition as defined above
+ − 781
%and the abstraction and relation functions are the ones of the sub
+ − 782
%quotients composed with the usual function composition.
+ − 783
%The @ {term "Rep"} and @ {term "Abs"} functions that we obtain agree
+ − 784
%with the definition of aggregate Abs/Rep functions and the
+ − 785
%relation is the same as the one given by aggregate relations.
+ − 786
%This becomes especially interesting
+ − 787
%when we compose the quotient with itself, as there is no simple
+ − 788
%intermediate step.
+ − 789
%
+ − 790
%Lets take again the example of @ {term flat}. To be able to lift
+ − 791
%theorems that talk about it we provide the composition quotient
+ − 792
%theorem which allows quotienting inside the container:
+ − 793
%
+ − 794
%If @ {term R} is an equivalence relation and @ {term "Quotient R Abs Rep"}
+ − 795
%then
+ − 796
%
+ − 797
%@ {text [display, indent=10] "Quotient (list_rel R \<circ>\<circ>\<circ> \<approx>\<^bsub>list\<^esub>) (abs_fset \<circ> map Abs) (map Rep o rep_fset)"}
2275
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 798
%%%
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 799
%%%\noindent
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 800
%%%this theorem will then instantiate the quotients needed in the
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 801
%%%injection and cleaning proofs allowing the lifting procedure to
69b80ad616c5
finished section 4, but put some things I do not understand on comment
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 802
%%%proceed in an unchanged way.
2192
+ − 803
*}
+ − 804
2256
+ − 805
section {* Lifting of Theorems\label{sec:lift} *}
1978
+ − 806
2194
+ − 807
text {*
2271
+ − 808
2278
+ − 809
The main benefit of a quotient package is to lift automatically theorems over raw
+ − 810
types to theorems over quotient types. We will perform this lifting in
+ − 811
three phases, called \emph{regularization},
2287
+ − 812
\emph{injection} and \emph{cleaning} according to procedures in Homeier's ML-code.
2271
+ − 813
2278
+ − 814
The purpose of regularization is to change the quantifiers and abstractions
+ − 815
in a ``raw'' theorem to quantifiers over variables that respect the relation
2279
+ − 816
(Definition \ref{def:respects} states what respects means). The purpose of injection is to add @{term Rep}
2271
+ − 817
and @{term Abs} of appropriate types in front of constants and variables
+ − 818
of the raw type so that they can be replaced by the ones that include the
2279
+ − 819
quotient type. The purpose of cleaning is to bring the theorem derived in the
+ − 820
first two phases into the form the user has specified. Abstractly, our
+ − 821
package establishes the following three proof steps:
+ − 822
+ − 823
\begin{center}
+ − 824
\begin{tabular}{r@ {\hspace{4mm}}l}
+ − 825
1.) & @{text "raw_thm \<longrightarrow> reg_thm"}\\
+ − 826
2.) & @{text "reg_thm \<longleftrightarrow> inj_thm"}\\
+ − 827
3.) & @{text "inj_thm \<longleftrightarrow> quot_thm"}\\
+ − 828
\end{tabular}
+ − 829
\end{center}
2193
+ − 830
2279
+ − 831
\noindent
2287
+ − 832
which means the raw theorem implies the quotient theorem.
2279
+ − 833
In contrast to other quotient packages, our package requires
+ − 834
the \emph{term} of the @{text "quot_thm"} to be given by the user.\footnote{Though we
+ − 835
also provide a fully automated mode, where the @{text "quot_thm"} is guessed
2287
+ − 836
from the form of @{text "raw_thm"}.} As a result, it is possible that a user can lift only some
+ − 837
occurrences of a raw type, but not others.
2279
+ − 838
+ − 839
The second and third proof step will always succeed if the appropriate
+ − 840
respectfulness and preservation theorems are given. In contrast, the first
+ − 841
proof step can fail: a theorem given by the user does not always
2319
+ − 842
imply a regularized version and a stronger one needs to be proved. An example
2287
+ − 843
for this kind of failure is the simple statement for integers @{text "0 \<noteq> 1"}.
+ − 844
One might hope that it can be proved by lifting @{text "(0, 0) \<noteq> (1, 0)"},
2319
+ − 845
but this raw theorem only shows that particular element in the
+ − 846
equivalence classes are not equal. In order to obtain @{text "0 \<noteq> 1"}, a
+ − 847
more general statement stipulating that the equivalence classes are not
+ − 848
equal is necessary. This kind of failure is beyond the scope where the
+ − 849
quotient package can help: the user has to provide a raw theorem that
+ − 850
can be regularized automatically, or has to provide an explicit proof
+ − 851
for the first proof step.
2193
+ − 852
2271
+ − 853
In the following we will first define the statement of the
2280
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 854
regularized theorem based on @{text "raw_thm"} and
2279
+ − 855
@{text "quot_thm"}. Then we define the statement of the injected theorem, based
2287
+ − 856
on @{text "reg_thm"} and @{text "quot_thm"}. We then show the three proof steps,
2279
+ − 857
which can all be performed independently from each other.
2197
+ − 858
2287
+ − 859
We first define the function @{text REG}. The intuition
2207
+ − 860
behind this function is that it replaces quantifiers and
+ − 861
abstractions involving raw types by bounded ones, and equalities
+ − 862
involving raw types are replaced by appropriate aggregate
2251
+ − 863
equivalence relations. It is defined as follows:
1994
+ − 864
2244
+ − 865
\begin{center}
2273
+ − 866
\begin{longtable}{rcl}
+ − 867
\multicolumn{3}{@ {}l}{abstractions:}\smallskip\\
+ − 868
@{text "REG (\<lambda>x\<^sup>\<sigma>. t, \<lambda>x\<^sup>\<tau>. s)"} & $\dn$ &
+ − 869
$\begin{cases}
+ − 870
@{text "\<lambda>x\<^sup>\<sigma>. REG (t, s)"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\
+ − 871
@{text "\<lambda>x\<^sup>\<sigma> \<in> Respects (REL (\<sigma>, \<tau>)). REG (t, s)"}
+ − 872
\end{cases}$\smallskip\\
2279
+ − 873
\\
2273
+ − 874
\multicolumn{3}{@ {}l}{universal quantifiers:}\\
+ − 875
@{text "REG (\<forall>x\<^sup>\<sigma>. t, \<forall>x\<^sup>\<tau>. s)"} & $\dn$ &
+ − 876
$\begin{cases}
+ − 877
@{text "\<forall>x\<^sup>\<sigma>. REG (t, s)"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\
+ − 878
@{text "\<forall>x\<^sup>\<sigma> \<in> Respects (REL (\<sigma>, \<tau>)). REG (t, s)"}
+ − 879
\end{cases}$\smallskip\\
+ − 880
\multicolumn{3}{@ {}l}{equality:}\smallskip\\
2280
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 881
%% REL of two equal types is the equality so we do not need a separate case
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 882
@{text "REG (=\<^bsup>\<sigma>\<Rightarrow>\<sigma>\<Rightarrow>bool\<^esup>, =\<^bsup>\<tau>\<Rightarrow>\<tau>\<Rightarrow>bool\<^esup>)"} & $\dn$ & @{text "REL (\<sigma>, \<tau>)"}\\\smallskip\\
2273
+ − 883
\multicolumn{3}{@ {}l}{applications, variables and constants:}\\
2244
+ − 884
@{text "REG (t\<^isub>1 t\<^isub>2, s\<^isub>1 s\<^isub>2)"} & $\dn$ & @{text "REG (t\<^isub>1, s\<^isub>1) REG (t\<^isub>2, s\<^isub>2)"}\\
2273
+ − 885
@{text "REG (x\<^isub>1, x\<^isub>2)"} & $\dn$ & @{text "x\<^isub>1"}\\
+ − 886
@{text "REG (c\<^isub>1, c\<^isub>2)"} & $\dn$ & @{text "c\<^isub>1"}\\[-5mm]
+ − 887
\end{longtable}
2244
+ − 888
\end{center}
2273
+ − 889
%
+ − 890
\noindent
2230
+ − 891
In the above definition we omitted the cases for existential quantifiers
2207
+ − 892
and unique existential quantifiers, as they are very similar to the cases
2287
+ − 893
for the universal quantifier. For the third and fourt clause, note that
+ − 894
@{text "\<forall>x. P"} is defined as @{text "\<forall> (\<lambda>x. P)"}.
2279
+ − 895
+ − 896
Next we define the function @{text INJ} which takes as argument
+ − 897
@{text "reg_thm"} and @{text "quot_thm"} (both as
+ − 898
terms) and returns @{text "inj_thm"}:
2198
+ − 899
2245
+ − 900
\begin{center}
+ − 901
\begin{tabular}{rcl}
2273
+ − 902
\multicolumn{3}{@ {\hspace{-4mm}}l}{abstractions:}\\
+ − 903
@{text "INJ (\<lambda>x. t :: \<sigma>, \<lambda>x. s :: \<tau>) "} & $\dn$ &
+ − 904
$\begin{cases}
+ − 905
@{text "\<lambda>x. INJ (t, s)"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\
+ − 906
@{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) (\<lambda>x. INJ (t, s)))"}
+ − 907
\end{cases}$\\
+ − 908
@{text "INJ (\<lambda>x \<in> R. t :: \<sigma>, \<lambda>x. s :: \<tau>) "} & $\dn$
+ − 909
& @{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) (\<lambda>x \<in> R. INJ (t, s)))"}\smallskip\\
+ − 910
\multicolumn{3}{@ {\hspace{-4mm}}l}{universal quantifiers:}\\
+ − 911
@{text "INJ (\<forall> t, \<forall> s) "} & $\dn$ & @{text "\<forall> INJ (t, s)"}\\
+ − 912
@{text "INJ (\<forall> t \<in> R, \<forall> s) "} & $\dn$ & @{text "\<forall> INJ (t, s) \<in> R"}\smallskip\\
+ − 913
\multicolumn{3}{@ {\hspace{-4mm}}l}{applications, variables and constants:}\smallskip\\
2245
+ − 914
@{text "INJ (t\<^isub>1 t\<^isub>2, s\<^isub>1 s\<^isub>2) "} & $\dn$ & @{text " INJ (t\<^isub>1, s\<^isub>1) INJ (t\<^isub>2, s\<^isub>2)"}\\
2273
+ − 915
@{text "INJ (x\<^isub>1\<^sup>\<sigma>, x\<^isub>2\<^sup>\<tau>) "} & $\dn$ &
+ − 916
$\begin{cases}
+ − 917
@{text "x\<^isub>1"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\
+ − 918
@{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) x\<^isub>1)"}\\
+ − 919
\end{cases}$\\
+ − 920
@{text "INJ (c\<^isub>1\<^sup>\<sigma>, c\<^isub>2\<^sup>\<tau>) "} & $\dn$ &
+ − 921
$\begin{cases}
+ − 922
@{text "c\<^isub>1"} \quad\mbox{provided @{text "\<sigma> = \<tau>"}}\\
+ − 923
@{text "REP (\<sigma>, \<tau>) (ABS (\<sigma>, \<tau>) c\<^isub>1)"}\\
+ − 924
\end{cases}$\\
2245
+ − 925
\end{tabular}
+ − 926
\end{center}
2198
+ − 927
2279
+ − 928
\noindent
2319
+ − 929
In this definition we again omitted the cases for existential and unique existential
+ − 930
quantifiers.
2208
+ − 931
2279
+ − 932
In the first proof step, establishing @{text "raw_thm \<longrightarrow> reg_thm"}, we always
+ − 933
start with an implication. Isabelle provides \emph{mono} rules that can split up
2319
+ − 934
the implications into simpler implicational subgoals. This succeeds for every
2281
+ − 935
monotone connective, except in places where the function @{text REG} inserted,
2287
+ − 936
for instance, a quantifier by a bounded quantifier. In this case we have
2279
+ − 937
rules of the form
2208
+ − 938
2279
+ − 939
@{text [display, indent=10] "(\<forall>x. R x \<longrightarrow> (P x \<longrightarrow> Q x)) \<longrightarrow> (\<forall>x. P x \<longrightarrow> \<forall>x \<in> R. Q x)"}
+ − 940
+ − 941
\noindent
2280
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 942
They decompose a bounded quantifier on the right-hand side. We can decompose a
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 943
bounded quantifier anywhere if R is an equivalence relation or
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 944
if it is a relation over function types with the range being an equivalence
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 945
relation. If @{text R} is an equivalence relation we can prove that
2261
+ − 946
2279
+ − 947
@{text [display, indent=10] "\<forall>x \<in> Respects R. P x = \<forall>x. P x"}
2199
+ − 948
2279
+ − 949
\noindent
2280
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 950
And when @{term R\<^isub>2} is an equivalence relation and we can prove
2231
+ − 951
2273
+ − 952
@{thm [display, indent=10] (concl) ball_reg_eqv_range[of R\<^isub>1 R\<^isub>2, no_vars]}
2209
+ − 953
2279
+ − 954
\noindent
2242
+ − 955
The last theorem is new in comparison with Homeier's package. There the
2287
+ − 956
injection procedure would be used to prove such goals, and
2279
+ − 957
the assumption about the equivalence relation would be used. We use the above theorem directly,
+ − 958
because this allows us to completely separate the first and the second
2287
+ − 959
proof step into two independent ``units''.
2206
+ − 960
2280
229660b9f2fc
Fix regularization. Two "FIXME" left in introduction. Minor spellings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 961
The second proof step, establishing @{text "reg_thm \<longleftrightarrow> inj_thm"}, starts with an equality.
2279
+ − 962
The proof again follows the structure of the
+ − 963
two underlying terms, and is defined for a goal being a relation between these two terms.
2199
+ − 964
2211
+ − 965
\begin{itemize}
2279
+ − 966
\item For two constants an appropriate constant respectfulness lemma is applied.
+ − 967
\item For two variables, we use the assumptions proved in the regularization step.
+ − 968
\item For two abstractions, we @{text "\<eta>"}-expand and @{text "\<beta>"}-reduce them.
+ − 969
\item For two applications, we check that the right-hand side is an application of
+ − 970
@{term Rep} to an @{term Abs} and @{term "Quotient R Rep Abs"}. If yes then we
+ − 971
can apply the theorem:
2271
+ − 972
+ − 973
@{term [display, indent=10] "R x y \<longrightarrow> R x (Rep (Abs y))"}
+ − 974
2279
+ − 975
Otherwise we introduce an appropriate relation between the subterms
2271
+ − 976
and continue with two subgoals using the lemma:
+ − 977
2273
+ − 978
@{text [display, indent=10] "(R\<^isub>1 \<doublearr> R\<^isub>2) f g \<longrightarrow> R\<^isub>1 x y \<longrightarrow> R\<^isub>2 (f x) (g y)"}
2211
+ − 979
\end{itemize}
2199
+ − 980
2279
+ − 981
We defined the theorem @{text "inj_thm"} in such a way that
+ − 982
establishing the equivalence @{text "inj_thm \<longleftrightarrow> quot_thm"} can be
+ − 983
achieved by rewriting @{text "inj_thm"} with the preservation theorems and quotient
2287
+ − 984
definitions. Then for all lifted constants, their definitions
2271
+ − 985
are used to fold the @{term Rep} with the raw constant. Next for
2279
+ − 986
all abstractions and quantifiers the lambda and
2271
+ − 987
quantifier preservation theorems are used to replace the
2279
+ − 988
variables that include raw types with respects by quantifiers
2271
+ − 989
over variables that include quotient types. We show here only
2279
+ − 990
the lambda preservation theorem. Given
+ − 991
@{term "Quotient R\<^isub>1 Abs\<^isub>1 Rep\<^isub>1"} and @{term "Quotient R\<^isub>2 Abs\<^isub>2 Rep\<^isub>2"}, we have:
2211
+ − 992
2279
+ − 993
@{thm [display, indent=10] (concl) lambda_prs[of _ "Abs\<^isub>1" "Rep\<^isub>1" "Abs\<^isub>2" "Rep\<^isub>2", no_vars]}
2199
+ − 994
2243
+ − 995
\noindent
2279
+ − 996
Next, relations over lifted types are folded to equalities.
+ − 997
For this the following theorem has been shown in Homeier~\cite{Homeier05}:
2211
+ − 998
2271
+ − 999
@{thm [display, indent=10] (concl) Quotient_rel_rep[no_vars]}
2199
+ − 1000
2271
+ − 1001
\noindent
2279
+ − 1002
Finally, we rewrite with the preservation theorems. This will result
+ − 1003
in two equal terms that can be solved by reflexivity.
2246
+ − 1004
*}
1994
+ − 1005
2274
+ − 1006
section {* Examples \label{sec:examples} *}
1994
+ − 1007
2210
+ − 1008
(* Mention why equivalence *)
2206
+ − 1009
2210
+ − 1010
text {*
+ − 1011
2239
+ − 1012
In this section we will show, a complete interaction with the quotient package
2240
+ − 1013
for defining the type of integers by quotienting pairs of natural numbers and
2281
+ − 1014
lifting theorems to integers. Our quotient package is fully compatible with
2240
+ − 1015
Isabelle type classes, but for clarity we will not use them in this example.
+ − 1016
In a larger formalization of integers using the type class mechanism would
+ − 1017
provide many algebraic properties ``for free''.
2210
+ − 1018
2240
+ − 1019
A user of our quotient package first needs to define a relation on
+ − 1020
the raw type, by which the quotienting will be performed. We give
2279
+ − 1021
the same integer relation as the one presented in \eqref{natpairequiv}:
2240
+ − 1022
+ − 1023
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
2279
+ − 1024
\begin{tabular}{@ {}l}
+ − 1025
\isacommand{fun}~~@{text "int_rel :: (nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> (nat \<times> nat)"}\\
+ − 1026
\isacommand{where}~~@{text "int_rel (m, n) (p, q) = (m + q = n + p)"}
+ − 1027
\end{tabular}
2239
+ − 1028
\end{isabelle}
2210
+ − 1029
2239
+ − 1030
\noindent
2279
+ − 1031
Next the quotient type is defined. This generates a proof obligation that the
+ − 1032
relation is an equivalence relation, which is solved automatically using the
+ − 1033
definition and extensionality:
2210
+ − 1034
2240
+ − 1035
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
2279
+ − 1036
\begin{tabular}{@ {}l}
+ − 1037
\isacommand{quotient\_type}~~@{text "int"}~~\isacommand{=}~~@{text "(nat \<times> nat)"}~~\isacommand{/}~~@{text "int_rel"}\\
+ − 1038
\hspace{5mm}@{text "by (auto simp add: equivp_def expand_fun_eq)"}
+ − 1039
\end{tabular}
2239
+ − 1040
\end{isabelle}
2210
+ − 1041
2239
+ − 1042
\noindent
2210
+ − 1043
The user can then specify the constants on the quotient type:
+ − 1044
2240
+ − 1045
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
+ − 1046
\begin{tabular}{@ {}l}
2279
+ − 1047
\isacommand{quotient\_definition}~~@{text "0 :: int"}~~\isacommand{is}~~@{text "(0 :: nat, 0 :: nat)"}\\[3mm]
2287
+ − 1048
\isacommand{fun}~~@{text "add_pair"}~~\isacommand{where}~~%
+ − 1049
@{text "add_pair (m, n) (p, q) \<equiv> (m + p :: nat, n + q :: nat)"}\\
2273
+ − 1050
\isacommand{quotient\_definition}~~@{text "+ :: int \<Rightarrow> int \<Rightarrow> int"}~~%
2287
+ − 1051
\isacommand{is}~~@{text "add_pair"}\\
2240
+ − 1052
\end{tabular}
+ − 1053
\end{isabelle}
2210
+ − 1054
2240
+ − 1055
\noindent
2279
+ − 1056
The following theorem about addition on the raw level can be proved.
2210
+ − 1057
2240
+ − 1058
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
2287
+ − 1059
\isacommand{lemma}~~@{text "add_pair_zero: int_rel (add_pair (0, 0) x) x"}
2240
+ − 1060
\end{isabelle}
2210
+ − 1061
2240
+ − 1062
\noindent
2279
+ − 1063
If the user attempts to lift this theorem, all proof obligations are
+ − 1064
automatically discharged, except the respectfulness
2287
+ − 1065
proof for @{text "add_pair"}:
2210
+ − 1066
2240
+ − 1067
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
2279
+ − 1068
\begin{tabular}{@ {}l}
2287
+ − 1069
\isacommand{lemma}~~@{text "[quot_respect]:"}\\
+ − 1070
@{text "(int_rel \<doublearr> int_rel \<doublearr> int_rel) add_pair add_pair"}
2279
+ − 1071
\end{tabular}
2240
+ − 1072
\end{isabelle}
+ − 1073
+ − 1074
\noindent
2281
+ − 1075
This can be discharged automatically by Isabelle when telling it to unfold the definition
2273
+ − 1076
of @{text "\<doublearr>"}.
2279
+ − 1077
After this, the user can prove the lifted lemma explicitly:
2210
+ − 1078
2240
+ − 1079
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
2287
+ − 1080
\isacommand{lemma}~~@{text "0 + (x :: int) = x"}~~\isacommand{by}~~@{text "lifting add_pair_zero"}
2240
+ − 1081
\end{isabelle}
2210
+ − 1082
2240
+ − 1083
\noindent
2279
+ − 1084
or by the completely automated mode by stating:
2210
+ − 1085
2240
+ − 1086
\begin{isabelle}\ \ \ \ \ \ \ \ \ \ %
2287
+ − 1087
\isacommand{thm}~~@{text "add_pair_zero[quot_lifted]"}
2240
+ − 1088
\end{isabelle}
2210
+ − 1089
2240
+ − 1090
\noindent
2279
+ − 1091
Both methods give the same result, namely
+ − 1092
+ − 1093
@{text [display, indent=10] "0 + x = x"}
+ − 1094
+ − 1095
\noindent
+ − 1096
Although seemingly simple, arriving at this result without the help of a quotient
2287
+ − 1097
package requires a substantial reasoning effort.
2210
+ − 1098
*}
2206
+ − 1099
2256
+ − 1100
section {* Conclusion and Related Work\label{sec:conc}*}
1978
+ − 1101
+ − 1102
text {*
2243
+ − 1103
2267
+ − 1104
The code of the quotient package and the examples described here are
+ − 1105
already included in the
2254
+ − 1106
standard distribution of Isabelle.\footnote{Available from
2237
+ − 1107
\href{http://isabelle.in.tum.de/}{http://isabelle.in.tum.de/}.} It is
2278
+ − 1108
heavily used in the new version of Nominal Isabelle, which provides a convenient reasoning
2287
+ − 1109
infrastructure for programming language calculi involving general binders.
2278
+ − 1110
To achieve this, it builds types representing @{text \<alpha>}-equivalent terms.
+ − 1111
Earlier
2237
+ − 1112
versions of Nominal Isabelle have been used successfully in formalisations
+ − 1113
of an equivalence checking algorithm for LF \cite{UrbanCheneyBerghofer08},
+ − 1114
Typed Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for
+ − 1115
concurrency \cite{BengtsonParow09} and a strong normalisation result for
+ − 1116
cut-elimination in classical logic \cite{UrbanZhu08}.
+ − 1117
2278
+ − 1118
There is a wide range of existing of literature for dealing with
+ − 1119
quotients in theorem provers.
2273
+ − 1120
Slotosch~\cite{Slotosch97} implemented a mechanism that automatically
2278
+ − 1121
defines quotient types for Isabelle/HOL. But he did not include theorem lifting.
+ − 1122
Harrison's quotient package~\cite{harrison-thesis} is the first one that is
+ − 1123
able to automatically lift theorems, however only first-order theorems (that is theorems
2281
+ − 1124
where abstractions, quantifiers and variables do not involve functions that
+ − 1125
include the quotient type).
2278
+ − 1126
There is also some work on quotient types in
+ − 1127
non-HOL based systems and logical frameworks, including theory interpretations
+ − 1128
in PVS~\cite{PVS:Interpretations}, new types in MetaPRL~\cite{Nogin02},
+ − 1129
and setoids in Coq \cite{ChicliPS02}.
+ − 1130
Paulson showed a construction of quotients that does not require the
2281
+ − 1131
Hilbert Choice operator, but also only first-order theorems can be lifted~\cite{Paulson06}.
2278
+ − 1132
The most related work to our package is the package for HOL4 by Homeier~\cite{Homeier05}.
+ − 1133
He introduced most of the abstract notions about quotients and also deals with the
+ − 1134
lifting of higher-order theorems. However, he cannot deal with quotient compositions (needed
2287
+ − 1135
for lifting theorems about @{text flat}). Also, a number of his definitions, like @{text ABS},
+ − 1136
@{text REP} and @{text INJ} etc only exist in \cite{Homeier05} as ML-code, not included
+ − 1137
in the paper.
2224
+ − 1138
2278
+ − 1139
One advantage of our package is that it is modular---in the sense that every step
+ − 1140
in the quotient construction can be done independently (see the criticism of Paulson
+ − 1141
about other quotient packages). This modularity is essential in the context of
+ − 1142
Isabelle, which supports type-classes and locales.
2224
+ − 1143
2287
+ − 1144
Another feature of our quotient package is that when lifting theorems, teh user can
2278
+ − 1145
precisely specify what the lifted theorem should look like. This feature is
2287
+ − 1146
necessary, for example, when lifting an induction principle for two lists.
2278
+ − 1147
This principle has as the conclusion a predicate of the form @{text "P xs ys"},
+ − 1148
and we can precisely specify whether we want to quotient @{text "xs"} or @{text "ys"},
+ − 1149
or both. We found this feature very useful in the new version of Nominal
2287
+ − 1150
Isabelle, where such a choice is required to generate a resoning infrastructure
+ − 1151
for alpha-equated terms.
+ − 1152
%%
+ − 1153
%% give an example for this
+ − 1154
%%
2278
+ − 1155
\medskip
2224
+ − 1156
2263
+ − 1157
\noindent
2287
+ − 1158
{\bf Acknowledgements:} We would like to thank Peter Homeier for the many
2277
+ − 1159
discussions about his HOL4 quotient package and explaining to us
2283
+ − 1160
some of its finer points in the implementation. Without his patient
+ − 1161
help, this work would have been impossible.
2263
+ − 1162
2224
+ − 1163
*}
+ − 1164
+ − 1165
2227
+ − 1166
1975
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 1167
(*<*)
b1281a0051ae
added stub for quotient paper; call with isabelle make qpaper
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 1168
end
1978
+ − 1169
(*>*)