author | nipkow |
Wed, 10 Jan 2018 15:25:09 +0100 | |
changeset 67399 | eab6ce8368fa |
parent 67386 | 998e01d6f8fd |
child 67463 | a5ca98950a91 |
permissions | -rw-r--r-- |
30293 | 1 |
(*<*) |
30401 | 2 |
theory Main_Doc |
30293 | 3 |
imports Main |
4 |
begin |
|
5 |
||
61996 | 6 |
setup \<open> |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
7 |
let |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
8 |
fun pretty_term_type_only ctxt (t, T) = |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
9 |
(if fastype_of t = Sign.certify_typ (Proof_Context.theory_of ctxt) T then () |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
10 |
else error "term_type_only: type mismatch"; |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
11 |
Syntax.pretty_typ ctxt T) |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
12 |
in |
67386 | 13 |
Document_Antiquotation.setup @{binding term_type_only} |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
14 |
(Args.term -- Args.typ_abbrev) |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
15 |
(fn {source, context = ctxt, ...} => fn arg => |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
16 |
Thy_Output.output ctxt |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
17 |
(Thy_Output.maybe_pretty_source pretty_term_type_only ctxt source [arg])) |
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42361
diff
changeset
|
18 |
end |
61996 | 19 |
\<close> |
20 |
setup \<open> |
|
67386 | 21 |
Document_Antiquotation.setup @{binding expanded_typ} (Args.typ >> single) |
47189
e9a3dd1c4cf9
improved robustness with new antiquoation by Makarius
nipkow
parents:
47187
diff
changeset
|
22 |
(fn {source, context, ...} => Thy_Output.output context o |
e9a3dd1c4cf9
improved robustness with new antiquoation by Makarius
nipkow
parents:
47187
diff
changeset
|
23 |
Thy_Output.maybe_pretty_source Syntax.pretty_typ context source) |
61996 | 24 |
\<close> |
30293 | 25 |
(*>*) |
61996 | 26 |
text\<open> |
30293 | 27 |
|
28 |
\begin{abstract} |
|
63680 | 29 |
This document lists the main types, functions and syntax provided by theory @{theory Main}. It is meant as a quick overview of what is available. For infix operators and their precedences see the final section. The sophisticated class structure is only hinted at. For details see \<^url>\<open>http://isabelle.in.tum.de/library/HOL\<close>. |
30293 | 30 |
\end{abstract} |
31 |
||
50581 | 32 |
\section*{HOL} |
30293 | 33 |
|
63902 | 34 |
The basic logic: @{prop "x = y"}, @{const True}, @{const False}, @{prop "\<not> P"}, @{prop"P \<and> Q"}, |
35 |
@{prop "P \<or> Q"}, @{prop "P \<longrightarrow> Q"}, @{prop "\<forall>x. P"}, @{prop "\<exists>x. P"}, @{prop"\<exists>! x. P"}, |
|
36 |
@{term"THE x. P"}. |
|
61996 | 37 |
\<^smallskip> |
30440 | 38 |
|
39 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
40 |
@{const HOL.undefined} & @{typeof HOL.undefined}\\ |
|
41 |
@{const HOL.default} & @{typeof HOL.default}\\ |
|
42 |
\end{tabular} |
|
43 |
||
44 |
\subsubsection*{Syntax} |
|
30293 | 45 |
|
30440 | 46 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
63902 | 47 |
@{term"\<not> (x = y)"} & @{term[source]"\<not> (x = y)"} & (\<^verbatim>\<open>~=\<close>)\\ |
30440 | 48 |
@{term[source]"P \<longleftrightarrow> Q"} & @{term"P \<longleftrightarrow> Q"} \\ |
49 |
@{term"If x y z"} & @{term[source]"If x y z"}\\ |
|
63902 | 50 |
@{term"Let e\<^sub>1 (\<lambda>x. e\<^sub>2)"} & @{term[source]"Let e\<^sub>1 (\<lambda>x. e\<^sub>2)"}\\ |
30440 | 51 |
\end{supertabular} |
52 |
||
53 |
||
50581 | 54 |
\section*{Orderings} |
30440 | 55 |
|
56 |
A collection of classes defining basic orderings: |
|
57 |
preorder, partial order, linear order, dense linear order and wellorder. |
|
61996 | 58 |
\<^smallskip> |
30293 | 59 |
|
30425 | 60 |
\begin{supertabular}{@ {} l @ {~::~} l l @ {}} |
61996 | 61 |
@{const Orderings.less_eq} & @{typeof Orderings.less_eq} & (\<^verbatim>\<open><=\<close>)\\ |
35277 | 62 |
@{const Orderings.less} & @{typeof Orderings.less}\\ |
30440 | 63 |
@{const Orderings.Least} & @{typeof Orderings.Least}\\ |
65964 | 64 |
@{const Orderings.Greatest} & @{typeof Orderings.Greatest}\\ |
30440 | 65 |
@{const Orderings.min} & @{typeof Orderings.min}\\ |
66 |
@{const Orderings.max} & @{typeof Orderings.max}\\ |
|
67 |
@{const[source] top} & @{typeof Orderings.top}\\ |
|
68 |
@{const[source] bot} & @{typeof Orderings.bot}\\ |
|
69 |
@{const Orderings.mono} & @{typeof Orderings.mono}\\ |
|
70 |
@{const Orderings.strict_mono} & @{typeof Orderings.strict_mono}\\ |
|
30293 | 71 |
\end{supertabular} |
72 |
||
73 |
\subsubsection*{Syntax} |
|
74 |
||
30440 | 75 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
61996 | 76 |
@{term[source]"x \<ge> y"} & @{term"x \<ge> y"} & (\<^verbatim>\<open>>=\<close>)\\ |
30293 | 77 |
@{term[source]"x > y"} & @{term"x > y"}\\ |
63902 | 78 |
@{term "\<forall>x\<le>y. P"} & @{term[source]"\<forall>x. x \<le> y \<longrightarrow> P"}\\ |
79 |
@{term "\<exists>x\<le>y. P"} & @{term[source]"\<exists>x. x \<le> y \<and> P"}\\ |
|
30440 | 80 |
\multicolumn{2}{@ {}l@ {}}{Similarly for $<$, $\ge$ and $>$}\\ |
63902 | 81 |
@{term "LEAST x. P"} & @{term[source]"Least (\<lambda>x. P)"}\\ |
65964 | 82 |
@{term "GREATEST x. P"} & @{term[source]"Greatest (\<lambda>x. P)"}\\ |
30293 | 83 |
\end{supertabular} |
84 |
||
30401 | 85 |
|
50581 | 86 |
\section*{Lattices} |
30401 | 87 |
|
88 |
Classes semilattice, lattice, distributive lattice and complete lattice (the |
|
89 |
latter in theory @{theory Set}). |
|
90 |
||
91 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
92 |
@{const Lattices.inf} & @{typeof Lattices.inf}\\ |
|
93 |
@{const Lattices.sup} & @{typeof Lattices.sup}\\ |
|
44969 | 94 |
@{const Complete_Lattices.Inf} & @{term_type_only Complete_Lattices.Inf "'a set \<Rightarrow> 'a::Inf"}\\ |
95 |
@{const Complete_Lattices.Sup} & @{term_type_only Complete_Lattices.Sup "'a set \<Rightarrow> 'a::Sup"}\\ |
|
30401 | 96 |
\end{tabular} |
97 |
||
98 |
\subsubsection*{Syntax} |
|
99 |
||
61996 | 100 |
Available by loading theory \<open>Lattice_Syntax\<close> in directory \<open>Library\<close>. |
30401 | 101 |
|
102 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
103 |
@{text[source]"x \<sqsubseteq> y"} & @{term"x \<le> y"}\\ |
|
104 |
@{text[source]"x \<sqsubset> y"} & @{term"x < y"}\\ |
|
105 |
@{text[source]"x \<sqinter> y"} & @{term"inf x y"}\\ |
|
106 |
@{text[source]"x \<squnion> y"} & @{term"sup x y"}\\ |
|
62204 | 107 |
@{text[source]"\<Sqinter>A"} & @{term"Inf A"}\\ |
108 |
@{text[source]"\<Squnion>A"} & @{term"Sup A"}\\ |
|
30440 | 109 |
@{text[source]"\<top>"} & @{term[source] top}\\ |
110 |
@{text[source]"\<bottom>"} & @{term[source] bot}\\ |
|
30401 | 111 |
\end{supertabular} |
112 |
||
113 |
||
50581 | 114 |
\section*{Set} |
30293 | 115 |
|
30425 | 116 |
\begin{supertabular}{@ {} l @ {~::~} l l @ {}} |
30370 | 117 |
@{const Set.empty} & @{term_type_only "Set.empty" "'a set"}\\ |
32142 | 118 |
@{const Set.insert} & @{term_type_only insert "'a\<Rightarrow>'a set\<Rightarrow>'a set"}\\ |
30293 | 119 |
@{const Collect} & @{term_type_only Collect "('a\<Rightarrow>bool)\<Rightarrow>'a set"}\\ |
61996 | 120 |
@{const Set.member} & @{term_type_only Set.member "'a\<Rightarrow>'a set\<Rightarrow>bool"} & (\<^verbatim>\<open>:\<close>)\\ |
121 |
@{const Set.union} & @{term_type_only Set.union "'a set\<Rightarrow>'a set \<Rightarrow> 'a set"} & (\<^verbatim>\<open>Un\<close>)\\ |
|
122 |
@{const Set.inter} & @{term_type_only Set.inter "'a set\<Rightarrow>'a set \<Rightarrow> 'a set"} & (\<^verbatim>\<open>Int\<close>)\\ |
|
30293 | 123 |
@{const UNION} & @{term_type_only UNION "'a set\<Rightarrow>('a \<Rightarrow> 'b set) \<Rightarrow> 'b set"}\\ |
124 |
@{const INTER} & @{term_type_only INTER "'a set\<Rightarrow>('a \<Rightarrow> 'b set) \<Rightarrow> 'b set"}\\ |
|
125 |
@{const Union} & @{term_type_only Union "'a set set\<Rightarrow>'a set"}\\ |
|
126 |
@{const Inter} & @{term_type_only Inter "'a set set\<Rightarrow>'a set"}\\ |
|
127 |
@{const Pow} & @{term_type_only Pow "'a set \<Rightarrow>'a set set"}\\ |
|
128 |
@{const UNIV} & @{term_type_only UNIV "'a set"}\\ |
|
129 |
@{const image} & @{term_type_only image "('a\<Rightarrow>'b)\<Rightarrow>'a set\<Rightarrow>'b set"}\\ |
|
130 |
@{const Ball} & @{term_type_only Ball "'a set\<Rightarrow>('a\<Rightarrow>bool)\<Rightarrow>bool"}\\ |
|
131 |
@{const Bex} & @{term_type_only Bex "'a set\<Rightarrow>('a\<Rightarrow>bool)\<Rightarrow>bool"}\\ |
|
132 |
\end{supertabular} |
|
133 |
||
134 |
\subsubsection*{Syntax} |
|
135 |
||
30425 | 136 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
61996 | 137 |
\<open>{a\<^sub>1,\<dots>,a\<^sub>n}\<close> & \<open>insert a\<^sub>1 (\<dots> (insert a\<^sub>n {})\<dots>)\<close>\\ |
63902 | 138 |
@{term "a \<notin> A"} & @{term[source]"\<not>(x \<in> A)"}\\ |
139 |
@{term "A \<subseteq> B"} & @{term[source]"A \<le> B"}\\ |
|
140 |
@{term "A \<subset> B"} & @{term[source]"A < B"}\\ |
|
30293 | 141 |
@{term[source]"A \<supseteq> B"} & @{term[source]"B \<le> A"}\\ |
142 |
@{term[source]"A \<supset> B"} & @{term[source]"B < A"}\\ |
|
63902 | 143 |
@{term "{x. P}"} & @{term[source]"Collect (\<lambda>x. P)"}\\ |
61996 | 144 |
\<open>{t | x\<^sub>1 \<dots> x\<^sub>n. P}\<close> & \<open>{v. \<exists>x\<^sub>1 \<dots> x\<^sub>n. v = t \<and> P}\<close>\\ |
61995
74709e9c4f17
clarified print modes: Isabelle symbols are used by default, but "latex" mode needs to be for some syntax forms;
wenzelm
parents:
61943
diff
changeset
|
145 |
@{term[source]"\<Union>x\<in>I. A"} & @{term[source]"UNION I (\<lambda>x. A)"} & (\texttt{UN})\\ |
74709e9c4f17
clarified print modes: Isabelle symbols are used by default, but "latex" mode needs to be for some syntax forms;
wenzelm
parents:
61943
diff
changeset
|
146 |
@{term[source]"\<Union>x. A"} & @{term[source]"UNION UNIV (\<lambda>x. A)"}\\ |
74709e9c4f17
clarified print modes: Isabelle symbols are used by default, but "latex" mode needs to be for some syntax forms;
wenzelm
parents:
61943
diff
changeset
|
147 |
@{term[source]"\<Inter>x\<in>I. A"} & @{term[source]"INTER I (\<lambda>x. A)"} & (\texttt{INT})\\ |
74709e9c4f17
clarified print modes: Isabelle symbols are used by default, but "latex" mode needs to be for some syntax forms;
wenzelm
parents:
61943
diff
changeset
|
148 |
@{term[source]"\<Inter>x. A"} & @{term[source]"INTER UNIV (\<lambda>x. A)"}\\ |
63902 | 149 |
@{term "\<forall>x\<in>A. P"} & @{term[source]"Ball A (\<lambda>x. P)"}\\ |
150 |
@{term "\<exists>x\<in>A. P"} & @{term[source]"Bex A (\<lambda>x. P)"}\\ |
|
151 |
@{term "range f"} & @{term[source]"f ` UNIV"}\\ |
|
30293 | 152 |
\end{supertabular} |
153 |
||
154 |
||
50581 | 155 |
\section*{Fun} |
30293 | 156 |
|
32933 | 157 |
\begin{supertabular}{@ {} l @ {~::~} l l @ {}} |
30293 | 158 |
@{const "Fun.id"} & @{typeof Fun.id}\\ |
32933 | 159 |
@{const "Fun.comp"} & @{typeof Fun.comp} & (\texttt{o})\\ |
30293 | 160 |
@{const "Fun.inj_on"} & @{term_type_only Fun.inj_on "('a\<Rightarrow>'b)\<Rightarrow>'a set\<Rightarrow>bool"}\\ |
161 |
@{const "Fun.inj"} & @{typeof Fun.inj}\\ |
|
162 |
@{const "Fun.surj"} & @{typeof Fun.surj}\\ |
|
163 |
@{const "Fun.bij"} & @{typeof Fun.bij}\\ |
|
164 |
@{const "Fun.bij_betw"} & @{term_type_only Fun.bij_betw "('a\<Rightarrow>'b)\<Rightarrow>'a set\<Rightarrow>'b set\<Rightarrow>bool"}\\ |
|
165 |
@{const "Fun.fun_upd"} & @{typeof Fun.fun_upd}\\ |
|
166 |
\end{supertabular} |
|
167 |
||
168 |
\subsubsection*{Syntax} |
|
169 |
||
170 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
171 |
@{term"fun_upd f x y"} & @{term[source]"fun_upd f x y"}\\ |
|
61996 | 172 |
\<open>f(x\<^sub>1:=y\<^sub>1,\<dots>,x\<^sub>n:=y\<^sub>n)\<close> & \<open>f(x\<^sub>1:=y\<^sub>1)\<dots>(x\<^sub>n:=y\<^sub>n)\<close>\\ |
30293 | 173 |
\end{tabular} |
174 |
||
175 |
||
50581 | 176 |
\section*{Hilbert\_Choice} |
33019 | 177 |
|
178 |
Hilbert's selection ($\varepsilon$) operator: @{term"SOME x. P"}. |
|
61996 | 179 |
\<^smallskip> |
33019 | 180 |
|
181 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
33057 | 182 |
@{const Hilbert_Choice.inv_into} & @{term_type_only Hilbert_Choice.inv_into "'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a)"} |
33019 | 183 |
\end{tabular} |
184 |
||
185 |
\subsubsection*{Syntax} |
|
186 |
||
187 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
33057 | 188 |
@{term inv} & @{term[source]"inv_into UNIV"} |
33019 | 189 |
\end{tabular} |
190 |
||
50581 | 191 |
\section*{Fixed Points} |
30293 | 192 |
|
193 |
Theory: @{theory Inductive}. |
|
194 |
||
195 |
Least and greatest fixed points in a complete lattice @{typ 'a}: |
|
196 |
||
197 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
198 |
@{const Inductive.lfp} & @{typeof Inductive.lfp}\\ |
|
199 |
@{const Inductive.gfp} & @{typeof Inductive.gfp}\\ |
|
200 |
\end{tabular} |
|
201 |
||
202 |
Note that in particular sets (@{typ"'a \<Rightarrow> bool"}) are complete lattices. |
|
203 |
||
50581 | 204 |
\section*{Sum\_Type} |
30293 | 205 |
|
61996 | 206 |
Type constructor \<open>+\<close>. |
30293 | 207 |
|
208 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
209 |
@{const Sum_Type.Inl} & @{typeof Sum_Type.Inl}\\ |
|
210 |
@{const Sum_Type.Inr} & @{typeof Sum_Type.Inr}\\ |
|
211 |
@{const Sum_Type.Plus} & @{term_type_only Sum_Type.Plus "'a set\<Rightarrow>'b set\<Rightarrow>('a+'b)set"} |
|
212 |
\end{tabular} |
|
213 |
||
214 |
||
50581 | 215 |
\section*{Product\_Type} |
30293 | 216 |
|
61996 | 217 |
Types @{typ unit} and \<open>\<times>\<close>. |
30293 | 218 |
|
219 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
220 |
@{const Product_Type.Unity} & @{typeof Product_Type.Unity}\\ |
|
221 |
@{const Pair} & @{typeof Pair}\\ |
|
222 |
@{const fst} & @{typeof fst}\\ |
|
223 |
@{const snd} & @{typeof snd}\\ |
|
61424
c3658c18b7bc
prod_case as canonical name for product type eliminator
haftmann
parents:
60352
diff
changeset
|
224 |
@{const case_prod} & @{typeof case_prod}\\ |
30293 | 225 |
@{const curry} & @{typeof curry}\\ |
226 |
@{const Product_Type.Sigma} & @{term_type_only Product_Type.Sigma "'a set\<Rightarrow>('a\<Rightarrow>'b set)\<Rightarrow>('a*'b)set"}\\ |
|
227 |
\end{supertabular} |
|
228 |
||
229 |
\subsubsection*{Syntax} |
|
230 |
||
30440 | 231 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} ll @ {}} |
63902 | 232 |
@{term "Pair a b"} & @{term[source]"Pair a b"}\\ |
233 |
@{term "case_prod (\<lambda>x y. t)"} & @{term[source]"case_prod (\<lambda>x y. t)"}\\ |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63902
diff
changeset
|
234 |
@{term "A \<times> B"} & \<open>Sigma A (\<lambda>\<^latex>\<open>\_\<close>. B)\<close> |
30293 | 235 |
\end{tabular} |
236 |
||
237 |
Pairs may be nested. Nesting to the right is printed as a tuple, |
|
63902 | 238 |
e.g.\ \mbox{@{term "(a,b,c)"}} is really \mbox{\<open>(a, (b, c))\<close>.} |
30293 | 239 |
Pattern matching with pairs and tuples extends to all binders, |
63902 | 240 |
e.g.\ \mbox{@{prop "\<forall>(x,y)\<in>A. P"},} @{term "{(x,y). P}"}, etc. |
30293 | 241 |
|
242 |
||
50581 | 243 |
\section*{Relation} |
30293 | 244 |
|
47187 | 245 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
30293 | 246 |
@{const Relation.converse} & @{term_type_only Relation.converse "('a * 'b)set \<Rightarrow> ('b*'a)set"}\\ |
47682 | 247 |
@{const Relation.relcomp} & @{term_type_only Relation.relcomp "('a*'b)set\<Rightarrow>('b*'c)set\<Rightarrow>('a*'c)set"}\\ |
30293 | 248 |
@{const Relation.Image} & @{term_type_only Relation.Image "('a*'b)set\<Rightarrow>'a set\<Rightarrow>'b set"}\\ |
249 |
@{const Relation.inv_image} & @{term_type_only Relation.inv_image "('a*'a)set\<Rightarrow>('b\<Rightarrow>'a)\<Rightarrow>('b*'b)set"}\\ |
|
250 |
@{const Relation.Id_on} & @{term_type_only Relation.Id_on "'a set\<Rightarrow>('a*'a)set"}\\ |
|
251 |
@{const Relation.Id} & @{term_type_only Relation.Id "('a*'a)set"}\\ |
|
252 |
@{const Relation.Domain} & @{term_type_only Relation.Domain "('a*'b)set\<Rightarrow>'a set"}\\ |
|
253 |
@{const Relation.Range} & @{term_type_only Relation.Range "('a*'b)set\<Rightarrow>'b set"}\\ |
|
254 |
@{const Relation.Field} & @{term_type_only Relation.Field "('a*'a)set\<Rightarrow>'a set"}\\ |
|
255 |
@{const Relation.refl_on} & @{term_type_only Relation.refl_on "'a set\<Rightarrow>('a*'a)set\<Rightarrow>bool"}\\ |
|
256 |
@{const Relation.refl} & @{term_type_only Relation.refl "('a*'a)set\<Rightarrow>bool"}\\ |
|
257 |
@{const Relation.sym} & @{term_type_only Relation.sym "('a*'a)set\<Rightarrow>bool"}\\ |
|
258 |
@{const Relation.antisym} & @{term_type_only Relation.antisym "('a*'a)set\<Rightarrow>bool"}\\ |
|
259 |
@{const Relation.trans} & @{term_type_only Relation.trans "('a*'a)set\<Rightarrow>bool"}\\ |
|
260 |
@{const Relation.irrefl} & @{term_type_only Relation.irrefl "('a*'a)set\<Rightarrow>bool"}\\ |
|
261 |
@{const Relation.total_on} & @{term_type_only Relation.total_on "'a set\<Rightarrow>('a*'a)set\<Rightarrow>bool"}\\ |
|
30440 | 262 |
@{const Relation.total} & @{term_type_only Relation.total "('a*'a)set\<Rightarrow>bool"}\\ |
47187 | 263 |
\end{tabular} |
30293 | 264 |
|
265 |
\subsubsection*{Syntax} |
|
266 |
||
30440 | 267 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
61996 | 268 |
@{term"converse r"} & @{term[source]"converse r"} & (\<^verbatim>\<open>^-1\<close>) |
30293 | 269 |
\end{tabular} |
61996 | 270 |
\<^medskip> |
47187 | 271 |
|
272 |
\noindent |
|
61996 | 273 |
Type synonym \ @{typ"'a rel"} \<open>=\<close> @{expanded_typ "'a rel"} |
30293 | 274 |
|
50581 | 275 |
\section*{Equiv\_Relations} |
30293 | 276 |
|
277 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
278 |
@{const Equiv_Relations.equiv} & @{term_type_only Equiv_Relations.equiv "'a set \<Rightarrow> ('a*'a)set\<Rightarrow>bool"}\\ |
|
279 |
@{const Equiv_Relations.quotient} & @{term_type_only Equiv_Relations.quotient "'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> 'a set set"}\\ |
|
280 |
@{const Equiv_Relations.congruent} & @{term_type_only Equiv_Relations.congruent "('a*'a)set\<Rightarrow>('a\<Rightarrow>'b)\<Rightarrow>bool"}\\ |
|
281 |
@{const Equiv_Relations.congruent2} & @{term_type_only Equiv_Relations.congruent2 "('a*'a)set\<Rightarrow>('b*'b)set\<Rightarrow>('a\<Rightarrow>'b\<Rightarrow>'c)\<Rightarrow>bool"}\\ |
|
282 |
%@ {const Equiv_Relations.} & @ {term_type_only Equiv_Relations. ""}\\ |
|
283 |
\end{supertabular} |
|
284 |
||
285 |
\subsubsection*{Syntax} |
|
286 |
||
287 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
288 |
@{term"congruent r f"} & @{term[source]"congruent r f"}\\ |
|
289 |
@{term"congruent2 r r f"} & @{term[source]"congruent2 r r f"}\\ |
|
290 |
\end{tabular} |
|
291 |
||
292 |
||
50581 | 293 |
\section*{Transitive\_Closure} |
30293 | 294 |
|
295 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
296 |
@{const Transitive_Closure.rtrancl} & @{term_type_only Transitive_Closure.rtrancl "('a*'a)set\<Rightarrow>('a*'a)set"}\\ |
|
297 |
@{const Transitive_Closure.trancl} & @{term_type_only Transitive_Closure.trancl "('a*'a)set\<Rightarrow>('a*'a)set"}\\ |
|
298 |
@{const Transitive_Closure.reflcl} & @{term_type_only Transitive_Closure.reflcl "('a*'a)set\<Rightarrow>('a*'a)set"}\\ |
|
45618 | 299 |
@{const Transitive_Closure.acyclic} & @{term_type_only Transitive_Closure.acyclic "('a*'a)set\<Rightarrow>bool"}\\ |
67399 | 300 |
@{const compower} & @{term_type_only "(^^) :: ('a*'a)set\<Rightarrow>nat\<Rightarrow>('a*'a)set" "('a*'a)set\<Rightarrow>nat\<Rightarrow>('a*'a)set"}\\ |
30293 | 301 |
\end{tabular} |
302 |
||
303 |
\subsubsection*{Syntax} |
|
304 |
||
30440 | 305 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
61996 | 306 |
@{term"rtrancl r"} & @{term[source]"rtrancl r"} & (\<^verbatim>\<open>^*\<close>)\\ |
307 |
@{term"trancl r"} & @{term[source]"trancl r"} & (\<^verbatim>\<open>^+\<close>)\\ |
|
308 |
@{term"reflcl r"} & @{term[source]"reflcl r"} & (\<^verbatim>\<open>^=\<close>) |
|
30293 | 309 |
\end{tabular} |
310 |
||
311 |
||
50581 | 312 |
\section*{Algebra} |
30293 | 313 |
|
35061 | 314 |
Theories @{theory Groups}, @{theory Rings}, @{theory Fields} and @{theory |
30440 | 315 |
Divides} define a large collection of classes describing common algebraic |
316 |
structures from semigroups up to fields. Everything is done in terms of |
|
317 |
overloaded operators: |
|
318 |
||
319 |
\begin{supertabular}{@ {} l @ {~::~} l l @ {}} |
|
61996 | 320 |
\<open>0\<close> & @{typeof zero}\\ |
321 |
\<open>1\<close> & @{typeof one}\\ |
|
30440 | 322 |
@{const plus} & @{typeof plus}\\ |
323 |
@{const minus} & @{typeof minus}\\ |
|
61996 | 324 |
@{const uminus} & @{typeof uminus} & (\<^verbatim>\<open>-\<close>)\\ |
30440 | 325 |
@{const times} & @{typeof times}\\ |
326 |
@{const inverse} & @{typeof inverse}\\ |
|
327 |
@{const divide} & @{typeof divide}\\ |
|
328 |
@{const abs} & @{typeof abs}\\ |
|
329 |
@{const sgn} & @{typeof sgn}\\ |
|
63950
cdc1e59aa513
syntactic type class for operation mod named after mod;
haftmann
parents:
63935
diff
changeset
|
330 |
@{const Rings.dvd} & @{typeof Rings.dvd}\\ |
cdc1e59aa513
syntactic type class for operation mod named after mod;
haftmann
parents:
63935
diff
changeset
|
331 |
@{const divide} & @{typeof divide}\\ |
cdc1e59aa513
syntactic type class for operation mod named after mod;
haftmann
parents:
63935
diff
changeset
|
332 |
@{const modulo} & @{typeof modulo}\\ |
30440 | 333 |
\end{supertabular} |
334 |
||
335 |
\subsubsection*{Syntax} |
|
336 |
||
337 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
63902 | 338 |
@{term "\<bar>x\<bar>"} & @{term[source] "abs x"} |
30440 | 339 |
\end{tabular} |
30293 | 340 |
|
341 |
||
50581 | 342 |
\section*{Nat} |
30293 | 343 |
|
344 |
@{datatype nat} |
|
61996 | 345 |
\<^bigskip> |
30293 | 346 |
|
347 |
\begin{tabular}{@ {} lllllll @ {}} |
|
67399 | 348 |
@{term "(+) :: nat \<Rightarrow> nat \<Rightarrow> nat"} & |
349 |
@{term "(-) :: nat \<Rightarrow> nat \<Rightarrow> nat"} & |
|
350 |
@{term "( * ) :: nat \<Rightarrow> nat \<Rightarrow> nat"} & |
|
351 |
@{term "(^) :: nat \<Rightarrow> nat \<Rightarrow> nat"} & |
|
352 |
@{term "(div) :: nat \<Rightarrow> nat \<Rightarrow> nat"}& |
|
353 |
@{term "(mod) :: nat \<Rightarrow> nat \<Rightarrow> nat"}& |
|
354 |
@{term "(dvd) :: nat \<Rightarrow> nat \<Rightarrow> bool"}\\ |
|
355 |
@{term "(\<le>) :: nat \<Rightarrow> nat \<Rightarrow> bool"} & |
|
356 |
@{term "(<) :: nat \<Rightarrow> nat \<Rightarrow> bool"} & |
|
30293 | 357 |
@{term "min :: nat \<Rightarrow> nat \<Rightarrow> nat"} & |
358 |
@{term "max :: nat \<Rightarrow> nat \<Rightarrow> nat"} & |
|
359 |
@{term "Min :: nat set \<Rightarrow> nat"} & |
|
360 |
@{term "Max :: nat set \<Rightarrow> nat"}\\ |
|
361 |
\end{tabular} |
|
362 |
||
363 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
30988 | 364 |
@{const Nat.of_nat} & @{typeof Nat.of_nat}\\ |
67399 | 365 |
@{term "(^^) :: ('a \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> 'a"} & |
366 |
@{term_type_only "(^^) :: ('a \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> 'a" "('a \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> 'a"} |
|
30293 | 367 |
\end{tabular} |
368 |
||
50581 | 369 |
\section*{Int} |
30293 | 370 |
|
371 |
Type @{typ int} |
|
61996 | 372 |
\<^bigskip> |
30293 | 373 |
|
374 |
\begin{tabular}{@ {} llllllll @ {}} |
|
67399 | 375 |
@{term "(+) :: int \<Rightarrow> int \<Rightarrow> int"} & |
376 |
@{term "(-) :: int \<Rightarrow> int \<Rightarrow> int"} & |
|
30293 | 377 |
@{term "uminus :: int \<Rightarrow> int"} & |
67399 | 378 |
@{term "( * ) :: int \<Rightarrow> int \<Rightarrow> int"} & |
379 |
@{term "(^) :: int \<Rightarrow> nat \<Rightarrow> int"} & |
|
380 |
@{term "(div) :: int \<Rightarrow> int \<Rightarrow> int"}& |
|
381 |
@{term "(mod) :: int \<Rightarrow> int \<Rightarrow> int"}& |
|
382 |
@{term "(dvd) :: int \<Rightarrow> int \<Rightarrow> bool"}\\ |
|
383 |
@{term "(\<le>) :: int \<Rightarrow> int \<Rightarrow> bool"} & |
|
384 |
@{term "(<) :: int \<Rightarrow> int \<Rightarrow> bool"} & |
|
30293 | 385 |
@{term "min :: int \<Rightarrow> int \<Rightarrow> int"} & |
386 |
@{term "max :: int \<Rightarrow> int \<Rightarrow> int"} & |
|
387 |
@{term "Min :: int set \<Rightarrow> int"} & |
|
388 |
@{term "Max :: int set \<Rightarrow> int"}\\ |
|
389 |
@{term "abs :: int \<Rightarrow> int"} & |
|
390 |
@{term "sgn :: int \<Rightarrow> int"}\\ |
|
391 |
\end{tabular} |
|
392 |
||
30440 | 393 |
\begin{tabular}{@ {} l @ {~::~} l l @ {}} |
30293 | 394 |
@{const Int.nat} & @{typeof Int.nat}\\ |
395 |
@{const Int.of_int} & @{typeof Int.of_int}\\ |
|
61996 | 396 |
@{const Int.Ints} & @{term_type_only Int.Ints "'a::ring_1 set"} & (\<^verbatim>\<open>Ints\<close>) |
30293 | 397 |
\end{tabular} |
398 |
||
399 |
\subsubsection*{Syntax} |
|
400 |
||
401 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
402 |
@{term"of_nat::nat\<Rightarrow>int"} & @{term[source]"of_nat"}\\ |
|
403 |
\end{tabular} |
|
404 |
||
405 |
||
50581 | 406 |
\section*{Finite\_Set} |
30401 | 407 |
|
408 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
409 |
@{const Finite_Set.finite} & @{term_type_only Finite_Set.finite "'a set\<Rightarrow>bool"}\\ |
|
63902 | 410 |
@{const Finite_Set.card} & @{term_type_only Finite_Set.card "'a set \<Rightarrow> nat"}\\ |
30401 | 411 |
@{const Finite_Set.fold} & @{term_type_only Finite_Set.fold "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a set \<Rightarrow> 'b"}\\ |
64281
bfc2e92d9b4c
restored document structure after theory refactoring
haftmann
parents:
64272
diff
changeset
|
412 |
\end{supertabular} |
bfc2e92d9b4c
restored document structure after theory refactoring
haftmann
parents:
64272
diff
changeset
|
413 |
|
bfc2e92d9b4c
restored document structure after theory refactoring
haftmann
parents:
64272
diff
changeset
|
414 |
|
65952 | 415 |
\section*{Lattices\_Big} |
416 |
||
417 |
\begin{supertabular}{@ {} l @ {~::~} l l @ {}} |
|
418 |
@{const Lattices_Big.Min} & @{typeof Lattices_Big.Min}\\ |
|
419 |
@{const Lattices_Big.Max} & @{typeof Lattices_Big.Max}\\ |
|
420 |
@{const Lattices_Big.arg_min} & @{typeof Lattices_Big.arg_min}\\ |
|
65953 | 421 |
@{const Lattices_Big.is_arg_min} & @{typeof Lattices_Big.is_arg_min}\\ |
65954 | 422 |
@{const Lattices_Big.arg_max} & @{typeof Lattices_Big.arg_max}\\ |
423 |
@{const Lattices_Big.is_arg_max} & @{typeof Lattices_Big.is_arg_max}\\ |
|
65952 | 424 |
\end{supertabular} |
425 |
||
426 |
\subsubsection*{Syntax} |
|
427 |
||
428 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
|
429 |
@{term "ARG_MIN f x. P"} & @{term[source]"arg_min f (\<lambda>x. P)"}\\ |
|
65954 | 430 |
@{term "ARG_MAX f x. P"} & @{term[source]"arg_max f (\<lambda>x. P)"}\\ |
65952 | 431 |
\end{supertabular} |
432 |
||
433 |
||
64281
bfc2e92d9b4c
restored document structure after theory refactoring
haftmann
parents:
64272
diff
changeset
|
434 |
\section*{Groups\_Big} |
bfc2e92d9b4c
restored document structure after theory refactoring
haftmann
parents:
64272
diff
changeset
|
435 |
|
bfc2e92d9b4c
restored document structure after theory refactoring
haftmann
parents:
64272
diff
changeset
|
436 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
64267 | 437 |
@{const Groups_Big.sum} & @{term_type_only Groups_Big.sum "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b::comm_monoid_add"}\\ |
64272 | 438 |
@{const Groups_Big.prod} & @{term_type_only Groups_Big.prod "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b::comm_monoid_mult"}\\ |
30401 | 439 |
\end{supertabular} |
440 |
||
441 |
||
442 |
\subsubsection*{Syntax} |
|
443 |
||
30440 | 444 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l l @ {}} |
64267 | 445 |
@{term "sum (\<lambda>x. x) A"} & @{term[source]"sum (\<lambda>x. x) A"} & (\<^verbatim>\<open>SUM\<close>)\\ |
446 |
@{term "sum (\<lambda>x. t) A"} & @{term[source]"sum (\<lambda>x. t) A"}\\ |
|
63902 | 447 |
@{term[source] "\<Sum>x|P. t"} & @{term"\<Sum>x|P. t"}\\ |
61996 | 448 |
\multicolumn{2}{@ {}l@ {}}{Similarly for \<open>\<Prod>\<close> instead of \<open>\<Sum>\<close>} & (\<^verbatim>\<open>PROD\<close>)\\ |
30401 | 449 |
\end{supertabular} |
450 |
||
451 |
||
50581 | 452 |
\section*{Wellfounded} |
30293 | 453 |
|
454 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
455 |
@{const Wellfounded.wf} & @{term_type_only Wellfounded.wf "('a*'a)set\<Rightarrow>bool"}\\ |
|
456 |
@{const Wellfounded.acc} & @{term_type_only Wellfounded.acc "('a*'a)set\<Rightarrow>'a set"}\\ |
|
457 |
@{const Wellfounded.measure} & @{term_type_only Wellfounded.measure "('a\<Rightarrow>nat)\<Rightarrow>('a*'a)set"}\\ |
|
458 |
@{const Wellfounded.lex_prod} & @{term_type_only Wellfounded.lex_prod "('a*'a)set\<Rightarrow>('b*'b)set\<Rightarrow>(('a*'b)*('a*'b))set"}\\ |
|
459 |
@{const Wellfounded.mlex_prod} & @{term_type_only Wellfounded.mlex_prod "('a\<Rightarrow>nat)\<Rightarrow>('a*'a)set\<Rightarrow>('a*'a)set"}\\ |
|
460 |
@{const Wellfounded.less_than} & @{term_type_only Wellfounded.less_than "(nat*nat)set"}\\ |
|
461 |
@{const Wellfounded.pred_nat} & @{term_type_only Wellfounded.pred_nat "(nat*nat)set"}\\ |
|
462 |
\end{supertabular} |
|
463 |
||
464 |
||
50581 | 465 |
\section*{Set\_Interval} % @{theory Set_Interval} |
30321 | 466 |
|
467 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
30370 | 468 |
@{const lessThan} & @{term_type_only lessThan "'a::ord \<Rightarrow> 'a set"}\\ |
469 |
@{const atMost} & @{term_type_only atMost "'a::ord \<Rightarrow> 'a set"}\\ |
|
470 |
@{const greaterThan} & @{term_type_only greaterThan "'a::ord \<Rightarrow> 'a set"}\\ |
|
471 |
@{const atLeast} & @{term_type_only atLeast "'a::ord \<Rightarrow> 'a set"}\\ |
|
472 |
@{const greaterThanLessThan} & @{term_type_only greaterThanLessThan "'a::ord \<Rightarrow> 'a \<Rightarrow> 'a set"}\\ |
|
473 |
@{const atLeastLessThan} & @{term_type_only atLeastLessThan "'a::ord \<Rightarrow> 'a \<Rightarrow> 'a set"}\\ |
|
474 |
@{const greaterThanAtMost} & @{term_type_only greaterThanAtMost "'a::ord \<Rightarrow> 'a \<Rightarrow> 'a set"}\\ |
|
475 |
@{const atLeastAtMost} & @{term_type_only atLeastAtMost "'a::ord \<Rightarrow> 'a \<Rightarrow> 'a set"}\\ |
|
30321 | 476 |
\end{supertabular} |
477 |
||
478 |
\subsubsection*{Syntax} |
|
479 |
||
480 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
481 |
@{term "lessThan y"} & @{term[source] "lessThan y"}\\ |
|
482 |
@{term "atMost y"} & @{term[source] "atMost y"}\\ |
|
483 |
@{term "greaterThan x"} & @{term[source] "greaterThan x"}\\ |
|
484 |
@{term "atLeast x"} & @{term[source] "atLeast x"}\\ |
|
485 |
@{term "greaterThanLessThan x y"} & @{term[source] "greaterThanLessThan x y"}\\ |
|
486 |
@{term "atLeastLessThan x y"} & @{term[source] "atLeastLessThan x y"}\\ |
|
487 |
@{term "greaterThanAtMost x y"} & @{term[source] "greaterThanAtMost x y"}\\ |
|
488 |
@{term "atLeastAtMost x y"} & @{term[source] "atLeastAtMost x y"}\\ |
|
61995
74709e9c4f17
clarified print modes: Isabelle symbols are used by default, but "latex" mode needs to be for some syntax forms;
wenzelm
parents:
61943
diff
changeset
|
489 |
@{term[source] "\<Union>i\<le>n. A"} & @{term[source] "\<Union>i \<in> {..n}. A"}\\ |
74709e9c4f17
clarified print modes: Isabelle symbols are used by default, but "latex" mode needs to be for some syntax forms;
wenzelm
parents:
61943
diff
changeset
|
490 |
@{term[source] "\<Union>i<n. A"} & @{term[source] "\<Union>i \<in> {..<n}. A"}\\ |
61996 | 491 |
\multicolumn{2}{@ {}l@ {}}{Similarly for \<open>\<Inter>\<close> instead of \<open>\<Union>\<close>}\\ |
64267 | 492 |
@{term "sum (\<lambda>x. t) {a..b}"} & @{term[source] "sum (\<lambda>x. t) {a..b}"}\\ |
493 |
@{term "sum (\<lambda>x. t) {a..<b}"} & @{term[source] "sum (\<lambda>x. t) {a..<b}"}\\ |
|
494 |
@{term "sum (\<lambda>x. t) {..b}"} & @{term[source] "sum (\<lambda>x. t) {..b}"}\\ |
|
495 |
@{term "sum (\<lambda>x. t) {..<b}"} & @{term[source] "sum (\<lambda>x. t) {..<b}"}\\ |
|
61996 | 496 |
\multicolumn{2}{@ {}l@ {}}{Similarly for \<open>\<Prod>\<close> instead of \<open>\<Sum>\<close>}\\ |
30321 | 497 |
\end{supertabular} |
498 |
||
499 |
||
50581 | 500 |
\section*{Power} |
30293 | 501 |
|
502 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
503 |
@{const Power.power} & @{typeof Power.power} |
|
504 |
\end{tabular} |
|
505 |
||
506 |
||
50581 | 507 |
\section*{Option} |
30293 | 508 |
|
509 |
@{datatype option} |
|
61996 | 510 |
\<^bigskip> |
30293 | 511 |
|
512 |
\begin{tabular}{@ {} l @ {~::~} l @ {}} |
|
513 |
@{const Option.the} & @{typeof Option.the}\\ |
|
55466 | 514 |
@{const map_option} & @{typ[source]"('a \<Rightarrow> 'b) \<Rightarrow> 'a option \<Rightarrow> 'b option"}\\ |
55518
1ddb2edf5ceb
folded 'Option.set' into BNF-generated 'set_option'
blanchet
parents:
55466
diff
changeset
|
515 |
@{const set_option} & @{term_type_only set_option "'a option \<Rightarrow> 'a set"}\\ |
41532 | 516 |
@{const Option.bind} & @{term_type_only Option.bind "'a option \<Rightarrow> ('a \<Rightarrow> 'b option) \<Rightarrow> 'b option"} |
30293 | 517 |
\end{tabular} |
518 |
||
50581 | 519 |
\section*{List} |
30293 | 520 |
|
521 |
@{datatype list} |
|
61996 | 522 |
\<^bigskip> |
30293 | 523 |
|
524 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
525 |
@{const List.append} & @{typeof List.append}\\ |
|
526 |
@{const List.butlast} & @{typeof List.butlast}\\ |
|
527 |
@{const List.concat} & @{typeof List.concat}\\ |
|
528 |
@{const List.distinct} & @{typeof List.distinct}\\ |
|
529 |
@{const List.drop} & @{typeof List.drop}\\ |
|
530 |
@{const List.dropWhile} & @{typeof List.dropWhile}\\ |
|
531 |
@{const List.filter} & @{typeof List.filter}\\ |
|
47187 | 532 |
@{const List.find} & @{typeof List.find}\\ |
46133
d9fe85d3d2cd
incorporated canonical fold combinator on lists into body of List theory; refactored passages on List.fold(l/r)
haftmann
parents:
45618
diff
changeset
|
533 |
@{const List.fold} & @{typeof List.fold}\\ |
d9fe85d3d2cd
incorporated canonical fold combinator on lists into body of List theory; refactored passages on List.fold(l/r)
haftmann
parents:
45618
diff
changeset
|
534 |
@{const List.foldr} & @{typeof List.foldr}\\ |
30293 | 535 |
@{const List.foldl} & @{typeof List.foldl}\\ |
536 |
@{const List.hd} & @{typeof List.hd}\\ |
|
537 |
@{const List.last} & @{typeof List.last}\\ |
|
538 |
@{const List.length} & @{typeof List.length}\\ |
|
539 |
@{const List.lenlex} & @{term_type_only List.lenlex "('a*'a)set\<Rightarrow>('a list * 'a list)set"}\\ |
|
540 |
@{const List.lex} & @{term_type_only List.lex "('a*'a)set\<Rightarrow>('a list * 'a list)set"}\\ |
|
541 |
@{const List.lexn} & @{term_type_only List.lexn "('a*'a)set\<Rightarrow>nat\<Rightarrow>('a list * 'a list)set"}\\ |
|
542 |
@{const List.lexord} & @{term_type_only List.lexord "('a*'a)set\<Rightarrow>('a list * 'a list)set"}\\ |
|
46488 | 543 |
@{const List.listrel} & @{term_type_only List.listrel "('a*'b)set\<Rightarrow>('a list * 'b list)set"}\\ |
40272 | 544 |
@{const List.listrel1} & @{term_type_only List.listrel1 "('a*'a)set\<Rightarrow>('a list * 'a list)set"}\\ |
30293 | 545 |
@{const List.lists} & @{term_type_only List.lists "'a set\<Rightarrow>'a list set"}\\ |
546 |
@{const List.listset} & @{term_type_only List.listset "'a set list \<Rightarrow> 'a list set"}\\ |
|
63884 | 547 |
@{const Groups_List.sum_list} & @{typeof Groups_List.sum_list}\\ |
548 |
@{const Groups_List.prod_list} & @{typeof Groups_List.prod_list}\\ |
|
30293 | 549 |
@{const List.list_all2} & @{typeof List.list_all2}\\ |
550 |
@{const List.list_update} & @{typeof List.list_update}\\ |
|
551 |
@{const List.map} & @{typeof List.map}\\ |
|
552 |
@{const List.measures} & @{term_type_only List.measures "('a\<Rightarrow>nat)list\<Rightarrow>('a*'a)set"}\\ |
|
32933 | 553 |
@{const List.nth} & @{typeof List.nth}\\ |
65956
639eb3617a86
reorganised material on sublists
eberlm <eberlm@in.tum.de>
parents:
65954
diff
changeset
|
554 |
@{const List.nths} & @{typeof List.nths}\\ |
30293 | 555 |
@{const List.remdups} & @{typeof List.remdups}\\ |
556 |
@{const List.removeAll} & @{typeof List.removeAll}\\ |
|
557 |
@{const List.remove1} & @{typeof List.remove1}\\ |
|
558 |
@{const List.replicate} & @{typeof List.replicate}\\ |
|
559 |
@{const List.rev} & @{typeof List.rev}\\ |
|
560 |
@{const List.rotate} & @{typeof List.rotate}\\ |
|
561 |
@{const List.rotate1} & @{typeof List.rotate1}\\ |
|
562 |
@{const List.set} & @{term_type_only List.set "'a list \<Rightarrow> 'a set"}\\ |
|
65956
639eb3617a86
reorganised material on sublists
eberlm <eberlm@in.tum.de>
parents:
65954
diff
changeset
|
563 |
@{const List.shuffle} & @{typeof List.shuffle}\\ |
30293 | 564 |
@{const List.sort} & @{typeof List.sort}\\ |
565 |
@{const List.sorted} & @{typeof List.sorted}\\ |
|
66435 | 566 |
@{const List.sorted_wrt} & @{typeof List.sorted_wrt}\\ |
30293 | 567 |
@{const List.splice} & @{typeof List.splice}\\ |
568 |
@{const List.take} & @{typeof List.take}\\ |
|
569 |
@{const List.takeWhile} & @{typeof List.takeWhile}\\ |
|
570 |
@{const List.tl} & @{typeof List.tl}\\ |
|
571 |
@{const List.upt} & @{typeof List.upt}\\ |
|
572 |
@{const List.upto} & @{typeof List.upto}\\ |
|
573 |
@{const List.zip} & @{typeof List.zip}\\ |
|
574 |
\end{supertabular} |
|
575 |
||
576 |
\subsubsection*{Syntax} |
|
577 |
||
578 |
\begin{supertabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
61996 | 579 |
\<open>[x\<^sub>1,\<dots>,x\<^sub>n]\<close> & \<open>x\<^sub>1 # \<dots> # x\<^sub>n # []\<close>\\ |
30293 | 580 |
@{term"[m..<n]"} & @{term[source]"upt m n"}\\ |
581 |
@{term"[i..j]"} & @{term[source]"upto i j"}\\ |
|
61996 | 582 |
\<open>[e. x \<leftarrow> xs]\<close> & @{term"map (%x. e) xs"}\\ |
30293 | 583 |
@{term"[x \<leftarrow> xs. b]"} & @{term[source]"filter (\<lambda>x. b) xs"} \\ |
584 |
@{term"xs[n := x]"} & @{term[source]"list_update xs n x"}\\ |
|
585 |
@{term"\<Sum>x\<leftarrow>xs. e"} & @{term[source]"listsum (map (\<lambda>x. e) xs)"}\\ |
|
586 |
\end{supertabular} |
|
61996 | 587 |
\<^medskip> |
30293 | 588 |
|
61996 | 589 |
List comprehension: \<open>[e. q\<^sub>1, \<dots>, q\<^sub>n]\<close> where each |
590 |
qualifier \<open>q\<^sub>i\<close> is either a generator \mbox{\<open>pat \<leftarrow> e\<close>} or a |
|
30293 | 591 |
guard, i.e.\ boolean expression. |
592 |
||
50581 | 593 |
\section*{Map} |
30293 | 594 |
|
595 |
Maps model partial functions and are often used as finite tables. However, |
|
596 |
the domain of a map may be infinite. |
|
597 |
||
598 |
\begin{supertabular}{@ {} l @ {~::~} l @ {}} |
|
599 |
@{const Map.empty} & @{typeof Map.empty}\\ |
|
600 |
@{const Map.map_add} & @{typeof Map.map_add}\\ |
|
601 |
@{const Map.map_comp} & @{typeof Map.map_comp}\\ |
|
602 |
@{const Map.restrict_map} & @{term_type_only Map.restrict_map "('a\<Rightarrow>'b option)\<Rightarrow>'a set\<Rightarrow>('a\<Rightarrow>'b option)"}\\ |
|
603 |
@{const Map.dom} & @{term_type_only Map.dom "('a\<Rightarrow>'b option)\<Rightarrow>'a set"}\\ |
|
604 |
@{const Map.ran} & @{term_type_only Map.ran "('a\<Rightarrow>'b option)\<Rightarrow>'b set"}\\ |
|
605 |
@{const Map.map_le} & @{typeof Map.map_le}\\ |
|
606 |
@{const Map.map_of} & @{typeof Map.map_of}\\ |
|
607 |
@{const Map.map_upds} & @{typeof Map.map_upds}\\ |
|
608 |
\end{supertabular} |
|
609 |
||
610 |
\subsubsection*{Syntax} |
|
611 |
||
612 |
\begin{tabular}{@ {} l @ {\quad$\equiv$\quad} l @ {}} |
|
30403 | 613 |
@{term"Map.empty"} & @{term"\<lambda>x. None"}\\ |
30293 | 614 |
@{term"m(x:=Some y)"} & @{term[source]"m(x:=Some y)"}\\ |
61996 | 615 |
\<open>m(x\<^sub>1\<mapsto>y\<^sub>1,\<dots>,x\<^sub>n\<mapsto>y\<^sub>n)\<close> & @{text[source]"m(x\<^sub>1\<mapsto>y\<^sub>1)\<dots>(x\<^sub>n\<mapsto>y\<^sub>n)"}\\ |
616 |
\<open>[x\<^sub>1\<mapsto>y\<^sub>1,\<dots>,x\<^sub>n\<mapsto>y\<^sub>n]\<close> & @{text[source]"Map.empty(x\<^sub>1\<mapsto>y\<^sub>1,\<dots>,x\<^sub>n\<mapsto>y\<^sub>n)"}\\ |
|
30293 | 617 |
@{term"map_upds m xs ys"} & @{term[source]"map_upds m xs ys"}\\ |
618 |
\end{tabular} |
|
619 |
||
50581 | 620 |
\section*{Infix operators in Main} % @{theory Main} |
621 |
||
622 |
\begin{center} |
|
50605 | 623 |
\begin{tabular}{llll} |
624 |
& Operator & precedence & associativity \\ |
|
625 |
\hline |
|
61996 | 626 |
Meta-logic & \<open>\<Longrightarrow>\<close> & 1 & right \\ |
627 |
& \<open>\<equiv>\<close> & 2 \\ |
|
50605 | 628 |
\hline |
61996 | 629 |
Logic & \<open>\<and>\<close> & 35 & right \\ |
630 |
&\<open>\<or>\<close> & 30 & right \\ |
|
631 |
&\<open>\<longrightarrow>\<close>, \<open>\<longleftrightarrow>\<close> & 25 & right\\ |
|
632 |
&\<open>=\<close>, \<open>\<noteq>\<close> & 50 & left\\ |
|
50605 | 633 |
\hline |
61996 | 634 |
Orderings & \<open>\<le>\<close>, \<open><\<close>, \<open>\<ge>\<close>, \<open>>\<close> & 50 \\ |
50605 | 635 |
\hline |
61996 | 636 |
Sets & \<open>\<subseteq>\<close>, \<open>\<subset>\<close>, \<open>\<supseteq>\<close>, \<open>\<supset>\<close> & 50 \\ |
637 |
&\<open>\<in>\<close>, \<open>\<notin>\<close> & 50 \\ |
|
638 |
&\<open>\<inter>\<close> & 70 & left \\ |
|
639 |
&\<open>\<union>\<close> & 65 & left \\ |
|
50605 | 640 |
\hline |
61996 | 641 |
Functions and Relations & \<open>\<circ>\<close> & 55 & left\\ |
642 |
&\<open>`\<close> & 90 & right\\ |
|
643 |
&\<open>O\<close> & 75 & right\\ |
|
644 |
&\<open>``\<close> & 90 & right\\ |
|
645 |
&\<open>^^\<close> & 80 & right\\ |
|
50605 | 646 |
\hline |
61996 | 647 |
Numbers & \<open>+\<close>, \<open>-\<close> & 65 & left \\ |
648 |
&\<open>*\<close>, \<open>/\<close> & 70 & left \\ |
|
649 |
&\<open>div\<close>, \<open>mod\<close> & 70 & left\\ |
|
650 |
&\<open>^\<close> & 80 & right\\ |
|
651 |
&\<open>dvd\<close> & 50 \\ |
|
50605 | 652 |
\hline |
61996 | 653 |
Lists & \<open>#\<close>, \<open>@\<close> & 65 & right\\ |
654 |
&\<open>!\<close> & 100 & left |
|
50581 | 655 |
\end{tabular} |
656 |
\end{center} |
|
61996 | 657 |
\<close> |
30293 | 658 |
(*<*) |
659 |
end |
|
65956
639eb3617a86
reorganised material on sublists
eberlm <eberlm@in.tum.de>
parents:
65954
diff
changeset
|
660 |
(*>*) |