28213
|
1 |
theory Further
|
|
2 |
imports Setup
|
|
3 |
begin
|
|
4 |
|
28447
|
5 |
section {* Further issues \label{sec:further} *}
|
28419
|
6 |
|
|
7 |
subsection {* Further reading *}
|
|
8 |
|
|
9 |
text {*
|
|
10 |
Do dive deeper into the issue of code generation, you should visit
|
|
11 |
the Isabelle/Isar Reference Manual \cite{isabelle-isar-ref} which
|
|
12 |
constains exhaustive syntax diagrams.
|
|
13 |
*}
|
|
14 |
|
|
15 |
subsection {* Modules *}
|
|
16 |
|
|
17 |
text {*
|
|
18 |
When invoking the @{command export_code} command it is possible to leave
|
|
19 |
out the @{keyword "module_name"} part; then code is distributed over
|
|
20 |
different modules, where the module name space roughly is induced
|
|
21 |
by the @{text Isabelle} theory namespace.
|
28213
|
22 |
|
28419
|
23 |
Then sometimes the awkward situation occurs that dependencies between
|
|
24 |
definitions introduce cyclic dependencies between modules, which in the
|
|
25 |
@{text Haskell} world leaves you to the mercy of the @{text Haskell} implementation
|
|
26 |
you are using, while for @{text SML}/@{text OCaml} code generation is not possible.
|
|
27 |
|
|
28 |
A solution is to declare module names explicitly.
|
|
29 |
Let use assume the three cyclically dependent
|
|
30 |
modules are named \emph{A}, \emph{B} and \emph{C}.
|
|
31 |
Then, by stating
|
|
32 |
*}
|
|
33 |
|
|
34 |
code_modulename SML
|
|
35 |
A ABC
|
|
36 |
B ABC
|
|
37 |
C ABC
|
|
38 |
|
|
39 |
text {*
|
|
40 |
we explicitly map all those modules on \emph{ABC},
|
|
41 |
resulting in an ad-hoc merge of this three modules
|
|
42 |
at serialisation time.
|
|
43 |
*}
|
28213
|
44 |
|
|
45 |
subsection {* Evaluation oracle *}
|
|
46 |
|
|
47 |
subsection {* Code antiquotation *}
|
|
48 |
|
|
49 |
subsection {* Creating new targets *}
|
|
50 |
|
|
51 |
text {* extending targets, adding targets *}
|
|
52 |
|
28419
|
53 |
subsection {* Imperative data structures *}
|
|
54 |
|
28213
|
55 |
end
|