diff -r be23597e81db -r f875a25aa72d ProgTutorial/Readme.thy --- a/ProgTutorial/Readme.thy Fri May 17 07:29:51 2019 +0200 +++ b/ProgTutorial/Readme.thy Fri May 17 10:38:01 2019 +0200 @@ -39,7 +39,7 @@ The following antiquotations are defined: \begin{itemize} - \item[$\bullet$] \@{ML "expr" for vars in structs}\ should be used + \item[$\bullet$] \@{ML \expr\ for vars in structs}\ should be used for displaying any ML-ex\-pression, because the antiquotation checks whether the expression is valid ML-code. The \for\- and \in\-arguments are optional. The former is used for evaluating open expressions by giving a list of free variables. The latter is used to @@ -48,23 +48,23 @@ \begin{center}\small \begin{tabular}{lll} - \@{ML "1 + 3"}\ & & @{ML "1 + 3"}\\ - \@{ML "a + b" for a b}\ & \;\;produce\;\; & @{ML "a + b" for a b}\\ - \@{ML Ident in OuterLex}\ & & @{ML Ident in OuterLex}\\ + \@{ML \1 + 3\}\ & & @{ML \1 + 3\}\\ + \@{ML \a + b\ for a b}\ & \;\;produce\;\; & @{ML \a + b\ for a b}\\ + \@{ML explode in Symbol}\ & & @{ML explode in Symbol}\\ \end{tabular} \end{center} - \item[$\bullet$] \@{ML_matchresult "expr" "pat"}\ should be used to + \item[$\bullet$] \@{ML_matchresult \expr\ \pat\}\ should be used to display ML-expressions and their response. The first expression is checked - like in the antiquotation \@{ML "expr"}\; the second is a pattern + like in the antiquotation \@{ML \expr\}\; the second is a pattern that specifies the result the first expression produces. This pattern can contain @{text [quotes] "\"} for parts that you like to omit. The response of the first expression will be checked against this pattern. Examples are: \begin{center}\small \begin{tabular}{l} - \@{ML_matchresult "1+2" "3"}\\\ - \@{ML_matchresult "(1+2,3)" "(3,\)"}\ + \@{ML_matchresult \1+2\ \3\}\\\ + \@{ML_matchresult \(1+2,3)\ \(3,\)\}\ \end{tabular} \end{center} @@ -72,8 +72,8 @@ \begin{center}\small \begin{tabular}{p{3cm}p{3cm}} - @{ML_matchresult "1+2" "3"} & - @{ML_matchresult "(1+2,3)" "(3,\)"} + @{ML_matchresult \1+2\ \3\} & + @{ML_matchresult \(1+2,3)\ \(3,_)\} \end{tabular} \end{center} @@ -82,16 +82,16 @@ an abstract datatype (like @{ML_type thm} or @{ML_type cterm}). \item[$\bullet$] \@{ML_matchresult_fake "expr" "pat"}\ works just - like the antiquotation \@{ML_matchresult "expr" "pat"}\ above, + like the antiquotation \@{ML_matchresult \expr\ \pat\}\ above, except that the result-specification is not checked. Use this antiquotation when the result cannot be constructed or the code generates an exception. Examples are: \begin{center}\small \begin{tabular}{ll} - \@{ML_matchresult_fake\ & \"cterm_of @{theory} @{term \"a + b = c\"}"}\\\ + \@{ML_matchresult_fake\ & \"cterm_of @{theory} @{term "a + b = c"}"}\\\ & \"a + b = c"}\\smallskip\\ - \@{ML_matchresult_fake\ & \"($$ \"x\") (explode \"world\")"\\\ + \@{ML_matchresult_fake\ & \"($$ "x") (explode "world")"\\\ & \"Exception FAIL raised"}\ \end{tabular} \end{center} @@ -100,8 +100,8 @@ \begin{center}\small \begin{tabular}{p{7.2cm}} - @{ML_matchresult_fake "cterm_of @{theory} @{term \"a + b = c\"}" "a + b = c"}\smallskip\\ - @{ML_matchresult_fake "($$ \"x\") (explode \"world\")" "Exception FAIL raised"} + @{ML_matchresult_fake \Thm.cterm_of @{context} @{term "a + b = c"}\ \a + b = c\}\smallskip\\ + @{ML_matchresult_fake \($$ "x") (Symbol.explode "world")\ \Exception FAIL raised\} \end{tabular} \end{center} @@ -114,7 +114,7 @@ \begin{center}\small \begin{tabular}{ll} - \@{ML_matchresult_fake_both\ & \"@{cterm \"1 + True\"}"\\\ + \@{ML_matchresult_fake_both\ & \"@{cterm "1 + True"}"\\\ & \"Type unification failed \"}\ \end{tabular} \end{center} @@ -123,20 +123,20 @@ referring to a file. It checks whether the file exists. An example is - @{text [display] "@{ML_file \"Pure/General/basics.ML\"}"} + @{text [display] \@{ML_file "Pure/General/basics.ML"}\} \end{itemize} The listed antiquotations honour options including \[display]\ and \[quotes]\. For example \begin{center}\small - \@{ML [quotes] "\"foo\" ^ \"bar\""}\ \;\;produces\;\; @{text [quotes] "foobar"} + \@{ML [quotes] \"foo" ^ "bar"\}\ \;\;produces\;\; @{text [quotes] "foobar"} \end{center} whereas \begin{center}\small - \@{ML "\"foo\" ^ \"bar\""}\ \;\;produces only\;\; \foobar\ + \@{ML \"foo" ^ "bar"\}\ \;\;produces only\;\; \foobar\ \end{center} \item Functions and value bindings cannot be defined inside antiquotations; they need