Section 5.3.
This commit is contained in:
parent
37f4ce73b0
commit
e58f0b33d4
|
@ -155,30 +155,27 @@ text\<Open>as defined in <@>{docitem \<Open>d1\<Close>} ...\<Close>
|
||||||
|
|
||||||
section\<open>Implementing Second-level Type-Checking\<close>
|
section\<open>Implementing Second-level Type-Checking\<close>
|
||||||
text\<open>
|
text\<open>
|
||||||
On expressions for attribute values, for which we chose to use HOL syntax
|
On expressions for attribute values, for which we chose to use HOL syntax to avoid that users
|
||||||
to avoid that users need to learn another syntax, we implemented
|
need to learn another syntax, we implemented an own pass over type-checked terms. Stored in the
|
||||||
an own pass over type-checked terms. Stored in the late-binding table
|
late-binding table \inlineisar+ISA_transformer_tab+, we register for each inner-syntax-annotation
|
||||||
\inlineisar+ISA_transformer_tab+, we register for each inner-syntax-annotation (ISA's),
|
(ISA's), a function of type
|
||||||
a function of type
|
|
||||||
|
|
||||||
\begin{sml}
|
\begin{sml}
|
||||||
theory -> term * typ * Position.T -> term option
|
theory -> term * typ * Position.T -> term option
|
||||||
\end{sml}
|
\end{sml}
|
||||||
|
|
||||||
Executed in a second pass of term parsing, ISA's may just return
|
Executed in a second pass of term parsing, ISA's may just return \inlineisar+None+. This is
|
||||||
\inlineisar+None+. This is adequate for ISA's just performing some checking in
|
adequate for ISA's just performing some checking in the logical context \inlineisar+theory+;
|
||||||
the logical context \inlineisar+theory+; ISA's of this kind report errors
|
ISA's of this kind report errors by exceptions. In contrast, \<^emph>\<open>transforming\<close> ISA's will
|
||||||
by exceptions. In contrast, \emph{transforming} ISA's will yield a term; this
|
yield a term; this is adequate, for example, by replacing a string-reference to some term denoted
|
||||||
is adequate, for example, by replacing a string-reference to some term denoted by it.
|
by it. This late-binding table is also used to generate standard inner-syntax-antiquotations from
|
||||||
This late-binding table is also used to generate standard
|
a \inlineisar+doc_class+.
|
||||||
inner-syntax-antiquotations from a \inlineisar+doc_class+.
|
|
||||||
\<close>
|
\<close>
|
||||||
|
|
||||||
section\<open>Programming Class Invariants\<close>
|
section\<open>Programming Class Invariants\<close>
|
||||||
text\<open>
|
text\<open>
|
||||||
For the moment, there is no high-level syntax for the definition of
|
For the moment, there is no high-level syntax for the definition of class invariants. A
|
||||||
class invariants. A formulation, in SML, of the first class-invariant
|
formulation, in SML, of the first class-invariant in @{docref "sec:class_inv"} is straight-forward:
|
||||||
in \autoref{sec:class_inv} is straight-forward:
|
|
||||||
|
|
||||||
\begin{sml}
|
\begin{sml}
|
||||||
fun check_result_inv oid {is_monitor:bool} ctxt =
|
fun check_result_inv oid {is_monitor:bool} ctxt =
|
||||||
|
|
Loading…
Reference in New Issue