# HG changeset patch # User Norbert Schirmer # Date 1558084869 -7200 # Node ID 95b42288294e201e6fc60f0700b10e9a6eac3c09 # Parent ff14d64c07fd46c8982f98e522b011aedf30de24 reactivated Readme.thy for authors diff -r ff14d64c07fd -r 95b42288294e ProgTutorial/Readme.thy --- a/ProgTutorial/Readme.thy Fri May 17 10:50:53 2019 +0200 +++ b/ProgTutorial/Readme.thy Fri May 17 11:21:09 2019 +0200 @@ -9,7 +9,7 @@ \begin{itemize} \item This tutorial can be compiled on the command-line with: - @{text [display] "$ isabelle make"} + @{text [display] "$ isabelle build -c -v -d . Cookbook"} You very likely need a recent snapshot of Isabelle in order to compile the tutorial. Some parts of the tutorial also rely on compilation with @@ -58,13 +58,14 @@ display ML-expressions and their response. The first expression is checked 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 + contain @{text [quotes] "_"} (which will be printed as @{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)\ \(3,_)\}\ \end{tabular} \end{center} @@ -81,7 +82,7 @@ constructed: it does not work when the code produces an exception or returns an abstract datatype (like @{ML_type thm} or @{ML_type cterm}). - \item[$\bullet$] \@{ML_matchresult_fake "expr" "pat"}\ works just + \item[$\bullet$] \@{ML_matchresult_fake \expr\ \pat\}\ works just 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 @@ -89,10 +90,10 @@ \begin{center}\small \begin{tabular}{ll} - \@{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\ & \\term_of @{theory} @{term "a + b = c"}\}\\\ + & \\a + b = c\}\\smallskip\\ + \@{ML_matchresult_fake\ & \\($$ "x") (explode "world")\\\\ + & \\Exception FAIL raised\}\ \end{tabular} \end{center} @@ -108,7 +109,7 @@ This output mimics to some extend what the user sees when running the code. - \item[$\bullet$] \@{ML_matchresult_fake_both "expr" "pat"}\ can be + \item[$\bullet$] \@{ML_matchresult_fake_both \expr\ \pat\}\ can be used to show erroneous code. Neither the code nor the response will be checked. An example is: @@ -119,6 +120,24 @@ \end{tabular} \end{center} + \item[$\bullet$] \@{ML_response \expr\}\ can be + used to show the expression and the corresponding output. An example is: + + \begin{center}\small + \begin{tabular}{ll} + \@{ML_response\ & \\1 upto 10\}\ + \end{tabular} + \end{center} + + which produce respectively + + \begin{center}\small + \begin{tabular}{p{3cm}p{3cm}} + @{ML_response \1 upto 10\} + \end{tabular} + \end{center} + + \item[$\bullet$] \@{ML_file "name"}\ should be used when referring to a file. It checks whether the file exists. An example is @@ -127,17 +146,8 @@ \end{itemize} The listed antiquotations honour options including \[display]\ and - \[quotes]\. For example - - \begin{center}\small - \@{ML [quotes] \"foo" ^ "bar"\}\ \;\;produces\;\; @{text [quotes] "foobar"} - \end{center} + \[gray]\. For example - whereas - - \begin{center}\small - \@{ML \"foo" ^ "bar"\}\ \;\;produces only\;\; \foobar\ - \end{center} \item Functions and value bindings cannot be defined inside antiquotations; they need to be included inside \isacommand{ML}~\\ \ \\ diff -r ff14d64c07fd -r 95b42288294e ROOT --- a/ROOT Fri May 17 10:50:53 2019 +0200 +++ b/ROOT Fri May 17 11:21:09 2019 +0200 @@ -25,6 +25,7 @@ "Recipes/Sat" "Recipes/USTypes" "Solutions" + "Readme" document_files "root.bib" "root.tex"