diff -r 6103b0eadbf2 -r f7c97e64cc2a ProgTutorial/Readme.thy --- a/ProgTutorial/Readme.thy Tue May 14 17:45:13 2019 +0200 +++ b/ProgTutorial/Readme.thy Thu May 16 19:56:12 2019 +0200 @@ -54,7 +54,7 @@ \end{tabular} \end{center} - \item[$\bullet$] \@{ML_response "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 that specifies the result the first expression produces. This pattern can @@ -63,8 +63,8 @@ \begin{center}\small \begin{tabular}{l} - \@{ML_response "1+2" "3"}\\\ - \@{ML_response "(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_response "1+2" "3"} & - @{ML_response "(1+2,3)" "(3,\)"} + @{ML_matchresult "1+2" "3"} & + @{ML_matchresult "(1+2,3)" "(3,\)"} \end{tabular} \end{center} @@ -81,17 +81,17 @@ 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_response_fake "expr" "pat"}\ works just - like the antiquotation \@{ML_response "expr" "pat"}\ above, + \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 exception. Examples are: \begin{center}\small \begin{tabular}{ll} - \@{ML_response_fake\ & \"cterm_of @{theory} @{term \"a + b = c\"}"}\\\ + \@{ML_matchresult_fake\ & \"cterm_of @{theory} @{term \"a + b = c\"}"}\\\ & \"a + b = c"}\\smallskip\\ - \@{ML_response_fake\ & \"($$ \"x\") (explode \"world\")"\\\ + \@{ML_matchresult_fake\ & \"($$ \"x\") (explode \"world\")"\\\ & \"Exception FAIL raised"}\ \end{tabular} \end{center} @@ -100,21 +100,21 @@ \begin{center}\small \begin{tabular}{p{7.2cm}} - @{ML_response_fake "cterm_of @{theory} @{term \"a + b = c\"}" "a + b = c"}\smallskip\\ - @{ML_response_fake "($$ \"x\") (explode \"world\")" "Exception FAIL raised"} + @{ML_matchresult_fake "cterm_of @{theory} @{term \"a + b = c\"}" "a + b = c"}\smallskip\\ + @{ML_matchresult_fake "($$ \"x\") (explode \"world\")" "Exception FAIL raised"} \end{tabular} \end{center} This output mimics to some extend what the user sees when running the code. - \item[$\bullet$] \@{ML_response_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: \begin{center}\small \begin{tabular}{ll} - \@{ML_response_fake_both\ & \"@{cterm \"1 + True\"}"\\\ + \@{ML_matchresult_fake_both\ & \"@{cterm \"1 + True\"}"\\\ & \"Type unification failed \"}\ \end{tabular} \end{center}