doc-src/isac/jrocnik/eJMT-paper/jrocnik_eJMT.tex
changeset 42507 629324e62a24
parent 42506 480aee713e3d
child 42508 373a9b713684
child 42509 89ce7be69cfa
equal deleted inserted replaced
42506:480aee713e3d 42507:629324e62a24
   134 the latter, uses a novel kind of programming language. This language
   134 the latter, uses a novel kind of programming language. This language
   135 is based on (Computer) Theorem Proving (TP), thus called a ``TP-based
   135 is based on (Computer) Theorem Proving (TP), thus called a ``TP-based
   136 programming language''.
   136 programming language''.
   137 
   137 
   138 This paper is the experience report of the first ``application
   138 This paper is the experience report of the first ``application
   139 programmer'' using this language, the experience gained from a
   139 programmer'' using this language for creating exercises in step-wise
   140 prototype of the programming language and of it's interpreter.
   140 problem solving for an advanced lab in Signal Processing. The tasks
       
   141 involved in TP-based programming are described together with the
       
   142 experience gained from a prototype of the programming language and of
       
   143 it's interpreter.
   141 
   144 
   142 The report concludes with a positive proof of concept, states
   145 The report concludes with a positive proof of concept, states
   143 insuggicient usability of the prototype and captures the requirements
   146 insuggicient usability of the prototype and captures the requirements
   144 for further development of both, the programming language and the
   147 for further development of both, the programming language and the
   145 interpreter.
   148 interpreter.
   700 % knowledge, in {\sisac} represented by Isabelle's theories.
   703 % knowledge, in {\sisac} represented by Isabelle's theories.
   701 
   704 
   702 \subsection{Preparation of Simplifiers for the Program}\label{simp}
   705 \subsection{Preparation of Simplifiers for the Program}\label{simp}
   703 
   706 
   704 All evaluation in the prototyp's Lucas-Interpreter is done by term rewriting on
   707 All evaluation in the prototyp's Lucas-Interpreter is done by term rewriting on
   705 Isabelle's terms, see \S\ref{math} below; in this section some of respective
   708 Isabelle's terms, see \S\ref{meth} below; in this section some of respective
   706 preparations are described. In order to work reliably with term rewriting, the
   709 preparations are described. In order to work reliably with term rewriting, the
   707 respective rule-sets must be confluent and terminating~\cite{nipk:rew-all-that},
   710 respective rule-sets must be confluent and terminating~\cite{nipk:rew-all-that},
   708 then they are called (canonical) simplifiers. These properties do not go without
   711 then they are called (canonical) simplifiers. These properties do not go without
   709 saying, their establishment is a difficult task for the programmer; this task is
   712 saying, their establishment is a difficult task for the programmer; this task is
   710 not yet supported in the prototype.\par
   713 not yet supported in the prototype.\par
   930 
   933 
   931 {\footnotesize
   934 {\footnotesize
   932 \begin{verbatim}
   935 \begin{verbatim}
   933    consts
   936    consts
   934      argument'_in :: "real => real" ("argument'_in _" 10)
   937      argument'_in :: "real => real" ("argument'_in _" 10)
       
   938 \end{verbatim}}
   935    
   939    
   936    ML {* val SOME t = parse ctxt "argument_in (X z)"; *}
   940 %^3.2^    ML {* val SOME t = parse ctxt "argument_in (X z)"; *}
   937    val t = Const ("Build_Inverse_Z_Transform.argument'_in", "RealDef.real ⇒ RealDef.real") 
   941 %^3.2^    val t = Const ("Build_Inverse_Z_Transform.argument'_in", "RealDef.real ⇒ RealDef.real") 
   938              $ (Free ("X", "RealDef.real ⇒ RealDef.real") $ Free ("z", "RealDef.real")): term
   942 %^3.2^              $ (Free ("X", "RealDef.real ⇒ RealDef.real") $ Free ("z", "RealDef.real")): term
   939 \end{verbatim}}
   943 %^3.2^ \end{verbatim}}
   940 
   944 %^3.2^ 
   941 \noindent Parsing produces a term \texttt{t} in internal
   945 %^3.2^ \noindent Parsing produces a term \texttt{t} in internal
   942 representation~\footnote{The attentive reader realizes the 
   946 %^3.2^ representation~\footnote{The attentive reader realizes the 
   943 differences between interal and extermal representation even in the
   947 %^3.2^ differences between interal and extermal representation even in the
   944 strings, i.e \texttt{'\_}}, consisting of \texttt{Const
   948 %^3.2^ strings, i.e \texttt{'\_}}, consisting of \texttt{Const
   945 ("argument'\_in", type)} and the two variables \texttt{Free ("X",
   949 %^3.2^ ("argument'\_in", type)} and the two variables \texttt{Free ("X",
   946 type)} and \texttt{Free ("z", type)}, \texttt{\$} is the term
   950 %^3.2^ type)} and \texttt{Free ("z", type)}, \texttt{\$} is the term
   947 constructor. The function body below is implemented directly in SML,
   951 %^3.2^ constructor. 
       
   952 The function body below is implemented directly in SML,
   948 i.e in an \texttt{ML \{* *\}} block; the function definition provides
   953 i.e in an \texttt{ML \{* *\}} block; the function definition provides
   949 a unique prefix \texttt{eval\_} to the function name:
   954 a unique prefix \texttt{eval\_} to the function name:
   950 
   955 
   951 {\footnotesize
   956 {\footnotesize
   952 \begin{verbatim}
   957 \begin{verbatim}
  1100 \label{eg:neuper2}
  1105 \label{eg:neuper2}
  1101 {\small\begin{tabbing}
  1106 {\small\begin{tabbing}
  1102   123\=123\=postcond \=: \= $\forall \,A^\prime\, u^\prime \,v^\prime.\,$\=\kill
  1107   123\=123\=postcond \=: \= $\forall \,A^\prime\, u^\prime \,v^\prime.\,$\=\kill
  1103   %\hfill \\
  1108   %\hfill \\
  1104   \>Specification:\\
  1109   \>Specification:\\
  1105   \>  \>input    \>: ${\it filterExpression} \;\;X\;z=\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}$\\
  1110   \>  \>input    \>: ${\it filterExpression} \;\;X\;z=\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}, \;{\it domain}\;\mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$\\
  1106   \>\>precond  \>: $\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}\;\; {\it continuous\_on}\; \mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$ \\
  1111   \>\>precond  \>: $\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}\;\; {\it continuous\_on}\; \mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$ \\
  1107   \>\>output   \>: stepResponse $x[n]$ \\
  1112   \>\>output   \>: stepResponse $x[n]$ \\
  1108   \>\>postcond \>: TODO
  1113   \>\>postcond \>: TODO
  1109 \end{tabbing}}
  1114 \end{tabbing}}
  1110 
  1115 
  1131    02    (prepare_specification
  1136    02    (prepare_specification
  1132    03      "pbl_SP_Ztrans_inv"
  1137    03      "pbl_SP_Ztrans_inv"
  1133    04      ["Jan Rocnik"]
  1138    04      ["Jan Rocnik"]
  1134    05      thy
  1139    05      thy
  1135    06      ( ["Inverse", "Z_Transform", "SignalProcessing"],
  1140    06      ( ["Inverse", "Z_Transform", "SignalProcessing"],
  1136    07        [ ("#Given", ["filterExpression X_eq"]),
  1141    07        [ ("#Given", ["filterExpression X_eq", "domain D"]),
  1137    08          ("#Pre"  , ["(rhs X_eq) is_continuous_in R\{1/2, -1/4}"]),
  1142    08          ("#Pre"  , ["(rhs X_eq) is_continuous_in D"]),
  1138    09          ("#Find" , ["stepResponse n_eq"]),
  1143    09          ("#Find" , ["stepResponse n_eq"]),
  1139    10          ("#Post" , [" TODO "])],
  1144    10          ("#Post" , [" TODO "])])
  1140    11        append_rls Erls [Calc ("Atools.is_continuous", eval_is_continuous)], 
  1145    11        prls
  1141    12        NONE, 
  1146    12        NONE
  1142    13        [["SignalProcessing","Z_Transform","Inverse"]]));
  1147    13        [["SignalProcessing","Z_Transform","Inverse"]]);
  1143    14 *}
  1148    14 *}
  1144 \end{verbatim}}
  1149 \end{verbatim}}
  1145 
  1150 
  1146 Although the above details are partly very technical, we explain them
  1151 Although the above details are partly very technical, we explain them
  1147 in order to document some intricacies of TP-based programming in the
  1152 in order to document some intricacies of TP-based programming in the
  1163 specification in lines {\rm 07..10}.
  1168 specification in lines {\rm 07..10}.
  1164 \item[06] is a key into the tree of all specifications as presented to
  1169 \item[06] is a key into the tree of all specifications as presented to
  1165 the user (where some branches might be hidden by the dialog
  1170 the user (where some branches might be hidden by the dialog
  1166 component).
  1171 component).
  1167 \item[07..10] are the specification with input, pre-condition, output
  1172 \item[07..10] are the specification with input, pre-condition, output
  1168 and post-condition respectively; the post-condition is not handled in
  1173 and post-condition respectively; note that the specification contains
       
  1174 variables to be instantiated with concrete values for a concrete problem ---
       
  1175 thus the specification actually captures a class of problems. The post-condition is not handled in
  1169 the prototype presently.
  1176 the prototype presently.
  1170 \item[11] creates a rule-set (abbreviated \textit{rls} in
  1177 \item[11] is a rule-set (defined elsewhere) for evaluation of the pre-condition: \textit{(rhs X\_eq) is\_continuous\_in D}, instantiated with the values of a concrete problem, evaluates to true or false --- and all evaluation is done by
  1171 {\sisac}) which evaluates the pre-condition for the actual input data.
  1178 rewriting determined by rule-sets.
  1172 Only if the evaluation yields \textit{True}, a program can be started.
       
  1173 \item[12]\textit{NONE:} could be \textit{SOME ``solve ...''} for a
  1179 \item[12]\textit{NONE:} could be \textit{SOME ``solve ...''} for a
  1174 problem associated to a function from Computer Algebra (like an
  1180 problem associated to a function from Computer Algebra (like an
  1175 equation solver) which is not the case here.
  1181 equation solver) which is not the case here.
  1176 \item[13] is a list of methods solving the specified problem (here
  1182 \item[13] is a list of methods solving the specified problem (here
  1177 only one list item) represented analogously to {\rm 06}.
  1183 only one list item) represented analogously to {\rm 06}.
  1231 % }
  1237 % }
  1232 
  1238 
  1233 \subsection{Implementation of the Method}\label{meth}
  1239 \subsection{Implementation of the Method}\label{meth}
  1234 A method collects all data required to interpret a certain program by
  1240 A method collects all data required to interpret a certain program by
  1235 Lucas-Interpretation. The \texttt{program} from p.\pageref{s:impl} of
  1241 Lucas-Interpretation. The \texttt{program} from p.\pageref{s:impl} of
  1236 the running example is embedded in the following method:
  1242 the running example is embedded on the last line in the following method:
  1237 %The methods represent the different ways a problem can be solved. This can
  1243 %The methods represent the different ways a problem can be solved. This can
  1238 %include mathematical tactics as well as tactics taught in different courses.
  1244 %include mathematical tactics as well as tactics taught in different courses.
  1239 %Declaring the Method itself gives us the possibilities to describe the way of 
  1245 %Declaring the Method itself gives us the possibilities to describe the way of 
  1240 %calculation in deep, as well we get the oppertunities to build in different
  1246 %calculation in deep, as well we get the oppertunities to build in different
  1241 %rulesets.
  1247 %rulesets.
  1246    01  store_method
  1252    01  store_method
  1247    02    (prep_method
  1253    02    (prep_method
  1248    03      "SP_InverseZTransformation_classic" 
  1254    03      "SP_InverseZTransformation_classic" 
  1249    04      ["Jan Rocnik"]
  1255    04      ["Jan Rocnik"]
  1250    05      thy 
  1256    05      thy 
  1251    06      (["SignalProcessing", "Z_Transform", "Inverse"], 
  1257    06      ( ["SignalProcessing", "Z_Transform", "Inverse"], 
  1252    07       [("#Given" ,["filterExpression (X_eq::bool)"]),
  1258    07        [ ("#Given", ["filterExpression X_eq", "domain D"]),
  1253    08        ("#Pre"  , ["(rhs X_eq) is_continuous_in R\{1/2, -1/4}"]),
  1259    08          ("#Pre"  , ["(rhs X_eq) is_continuous_in D"]),
  1254    09        ("#Find"  ,["stepResponse (n_eq::bool)"])],
  1260    09          ("#Find" , ["stepResponse n_eq"]),
  1255    10       {rew_ord = tless_true, rls  = rls, 
  1261    10        rew_ord  erls
  1256    11        srls = srls, calc = [],
  1262    11        srls  prls  nrls
  1257    12        prls = prls, crls = crls,
  1263    12        errpats 
  1258    13        nrls = nrls,
  1264    13        program);
  1259    14        errpats = []},
  1265    14 *}
  1260    15        program));
       
  1261    16 *}
       
  1262 \end{verbatim}}
  1266 \end{verbatim}}
  1263 
  1267 
  1264 \noindent The above code stores the whole structure analogously to a
  1268 \noindent The above code stores the whole structure analogously to a
  1265 specification,
  1269 specification as described above:
  1266 \begin{description}
  1270 \begin{description}
  1267 \item[01..06] are identical to those for the example specification on
  1271 \item[01..06] are identical to those for the example specification on
  1268 p.\pageref{exp-spec}.
  1272 p.\pageref{exp-spec}.
  1269 
  1273 
  1270 \item[07..09] show something looking like the specification; this is a
  1274 \item[07..09] show something looking like the specification; this is a
  1271 {\em guard}: as long as not all \texttt{Given} items are present and
  1275 {\em guard}: as long as not all \textit{Given} items are present and
  1272 the \texttt{Pre}-conditions is not true, interpretation of the program
  1276 the \textit{Pre}-conditions is not true, interpretation of the program
  1273 is not started.
  1277 is not started.
  1274 
  1278 
  1275 \item[01..09]
  1279 \item[10..11] all concern rewriting (the respective data are defined elsewhere): \textit{rew\_ord} is the rewrite order~\cite{nipk:rew-all-that} in case
  1276 
  1280 \textit{program} contains a \textit{Rewrite} tactic; and in case the respective rule is a conditional rewrite-rule, \textit{erls} features evaluating the conditions. The rule-sets 
  1277 \item[01..09]
  1281 \textit{srls, prls, nrls} feature evaluating (a) the ML-functions in the program (e.g.
  1278 
  1282 \textit{lhs, argument\_in, rhs} in the program on p.\pageref{s:impl}, (b) the pre-condition analoguous to the specification in line 11 on p.\pageref{exp-spec}
  1279 \item[01..09]
  1283 and (c) is required for the derivation-machinery checking user-input formulas.
  1280 
  1284 
  1281 \item[01..09]
  1285 \item[12..13] \textit{errpats} are error-patterns~\cite{gdaroczy-EP-13} for this method and \textit{program} is the variable holding the example from p.\pageref {s:impl}.
  1282 \end{description}
  1286 \end{description}
  1283 
  1287 The many rule-sets above cause considerable efforts for the
  1284 
  1288 programmers, in particular, because there are no tools for checking
  1285 .\\.\\.\\
  1289 essential features of rule-sets.
  1286 
  1290 
  1287 % is again very technical and goes hard in detail. Unfortunataly
  1291 % is again very technical and goes hard in detail. Unfortunataly
  1288 % most declerations are not essential for a basic programm but leads us to a huge
  1292 % most declerations are not essential for a basic programm but leads us to a huge
  1289 % range of powerful possibilities.
  1293 % range of powerful possibilities.
  1290 % 
  1294 % 
  1319 % empty. Follow up \S\ref{progr} for informations on how to implement this
  1323 % empty. Follow up \S\ref{progr} for informations on how to implement this
  1320 % \textit{main} part.
  1324 % \textit{main} part.
  1321 % \end{description}
  1325 % \end{description}
  1322 
  1326 
  1323 \subsection{Implementation of the TP-based Program}\label{progr} 
  1327 \subsection{Implementation of the TP-based Program}\label{progr} 
  1324 So finally all the prerequisites are described and the very topic can
  1328 So finally all the prerequisites are described and the final task can
  1325 be addressed. The program below comes back to the running example: it
  1329 be addressed. The program below comes back to the running example: it
  1326 computes a solution for the problem from Fig.\ref{fig-interactive} on
  1330 computes a solution for the problem from Fig.\ref{fig-interactive} on
  1327 p.\pageref{fig-interactive}. The reader is reminded of
  1331 p.\pageref{fig-interactive}. The reader is reminded of
  1328 \S\ref{PL-isab}, the introduction of the programming language:
  1332 \S\ref{PL-isab}, the introduction of the programming language:
  1329 
  1333 
  1330 {\footnotesize\it\label{s:impl}
  1334 {\footnotesize\it\label{s:impl}
  1331 \begin{tabbing}
  1335 \begin{tabbing}
  1332 123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill
  1336 123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill
  1333 \>        \>ML \{*
  1337 \>{\rm 00}\>ML \{*\\
  1334 \>{\rm 00}\>val program =\\
  1338 \>{\rm 00}\>val program =\\
  1335 \>{\rm 01}\>  "{\tt Program} InverseZTransform (X\_eq::bool) =   \\
  1339 \>{\rm 01}\>  "{\tt Program} InverseZTransform (X\_eq::bool) =   \\
  1336 \>{\rm 02}\>\>  {\tt let}                                       \\
  1340 \>{\rm 02}\>\>  {\tt let}                                       \\
  1337 \>{\rm 03}\>\>\>  X\_eq = {\tt Take} X\_eq ;   \\
  1341 \>{\rm 03}\>\>\>  X\_eq = {\tt Take} X\_eq ;   \\
  1338 \>{\rm 04}\>\>\>  X\_eq = {\tt Rewrite} ruleZY X\_eq ; \\
  1342 \>{\rm 04}\>\>\>  X\_eq = {\tt Rewrite} prep\_for\_part\_frac X\_eq ; \\
  1339 \>{\rm 05}\>\>\>  (X\_z::real) = lhs X\_eq ;       \\ %no inside-out evaluation
  1343 \>{\rm 05}\>\>\>  (X\_z::real) = lhs X\_eq ;       \\ %no inside-out evaluation
  1340 \>{\rm 06}\>\>\>  (z::real) = argument\_in X\_z; \\
  1344 \>{\rm 06}\>\>\>  (z::real) = argument\_in X\_z; \\
  1341 \>{\rm 07}\>\>\>  (part\_frac::real) = {\tt SubProblem} \\
  1345 \>{\rm 07}\>\>\>  (part\_frac::real) = {\tt SubProblem} \\
  1342 \>{\rm 08}\>\>\>\>\>\>\>\>  ( Isac, [partial\_fraction, rational, simplification], [] )\\
  1346 \>{\rm 08}\>\>\>\>\>\>\>\>  ( Isac, [partial\_fraction, rational, simplification], [] )\\
  1343 %\>{\rm 10}\>\>\>\>\>\>\>\>\>  [simplification, of\_rationals, to\_partial\_fraction] ) \\
  1347 %\>{\rm 10}\>\>\>\>\>\>\>\>\>  [simplification, of\_rationals, to\_partial\_fraction] ) \\
  1344 \>{\rm 09}\>\>\>\>\>\>\>\>  [ (rhs X\_eq)::real, z::real ]; \\
  1348 \>{\rm 09}\>\>\>\>\>\>\>\>  [ (rhs X\_eq)::real, z::real ]; \\
  1345 \>{\rm 10}\>\>\>  (X'\_eq::bool) = {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac) ; \\
  1349 \>{\rm 10}\>\>\>  (X'\_eq::bool) = {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac) ; \\
  1346 \>{\rm 11}\>\>\>  X'\_eq = (({\tt Rewrite\_Set} ruleYZ) @@   \\
  1350 \>{\rm 11}\>\>\>  X'\_eq = (({\tt Rewrite\_Set} prep\_for\_inverse\_z) @@   \\
  1347 \>{\rm 12}\>\>\>\>\>  $\;\;$ ({\tt Rewrite\_Set} inverse\_z)) X'\_eq \\
  1351 \>{\rm 12}\>\>\>\>\>  $\;\;$ ({\tt Rewrite\_Set} inverse\_z)) X'\_eq \\
  1348 \>{\rm 13}\>\>  {\tt in } \\
  1352 \>{\rm 13}\>\>  {\tt in } \\
  1349 \>{\rm 14}\>\>\>  X'\_eq"\\
  1353 \>{\rm 14}\>\>\>  X'\_eq"\\
  1350 \>        \>*\}
  1354 \>{\rm 15}\>*\}
  1351 \end{tabbing}}
  1355 \end{tabbing}}
  1352 % ORIGINAL FROM Inverse_Z_Transform.thy
  1356 % ORIGINAL FROM Inverse_Z_Transform.thy
  1353 % "Script InverseZTransform (X_eq::bool) =            "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*)
  1357 % "Script InverseZTransform (X_eq::bool) =            "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*)
  1354 % "(let X = Take X_eq;                                "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*)
  1358 % "(let X = Take X_eq;                                "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*)
  1355 % "  X' = Rewrite ruleZY False X;                     "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*)
  1359 % "  X' = Rewrite ruleZY False X;                     "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*)
  1375 the steps of calculation towards a solution (and interactive tutoring
  1379 the steps of calculation towards a solution (and interactive tutoring
  1376 in step-wise problem solving) are created as a side-effect by
  1380 in step-wise problem solving) are created as a side-effect by
  1377 Lucas-Interpretation.  The side-effects are triggered by the tactics
  1381 Lucas-Interpretation.  The side-effects are triggered by the tactics
  1378 \texttt{Take}, \texttt{Rewrite}, \texttt{SubProblem} and
  1382 \texttt{Take}, \texttt{Rewrite}, \texttt{SubProblem} and
  1379 \texttt{Rewrite\_Set} in the above lines {\rm 03, 04, 07, 10, 11} and
  1383 \texttt{Rewrite\_Set} in the above lines {\rm 03, 04, 07, 10, 11} and
  1380 {\rm 12} respectively. These tactics produce the lines in the
  1384 {\rm 12} respectively. These tactics produce the respective lines in the
  1381 calculation on p.\pageref{flow-impl}.
  1385 calculation on p.\pageref{flow-impl}.
  1382 
  1386 
  1383 The above lines {\rm 05, 06} do not contain a tactics, so they do not
  1387 The above lines {\rm 05, 06} do not contain a tactics, so they do not
  1384 immediately contribute to the calculation on p.\pageref{flow-impl};
  1388 immediately contribute to the calculation on p.\pageref{flow-impl};
  1385 rather, they compute actual arguments for the \texttt{SubProblem} in
  1389 rather, they compute actual arguments for the \texttt{SubProblem} in
  1574 kinds of rule-sets (see \S\ref{meth}), the interpreter-state, in
  1578 kinds of rule-sets (see \S\ref{meth}), the interpreter-state, in
  1575 particular the environment and the context at the states position ---
  1579 particular the environment and the context at the states position ---
  1576 all checks have to rely on simple functions accessing the
  1580 all checks have to rely on simple functions accessing the
  1577 \texttt{ctree}. So getting the calculation below (which resembles the
  1581 \texttt{ctree}. So getting the calculation below (which resembles the
  1578 calculation in Fig.\ref{fig-interactive} on p.\pageref{fig-interactive})
  1582 calculation in Fig.\ref{fig-interactive} on p.\pageref{fig-interactive})
  1579 finished successfully is a relief:
  1583 is the result of several weeks of development:
  1580 
  1584 
  1581 {\small\it\label{exp-calc}
  1585 {\small\it\label{exp-calc}
  1582 \begin{tabbing}
  1586 \begin{tabbing}
  1583 123l\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill
  1587 123l\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill
  1584 \>{\rm 01}\> $\bullet$  \> {\tt Problem } (Inverse\_Z\_Transform, [Inverse, Z\_Transform, SignalProcessing])       \`\\
  1588 \>{\rm 01}\> $\bullet$  \> {\tt Problem } (Inverse\_Z\_Transform, [Inverse, Z\_Transform, SignalProcessing])       \`\\
  1585 \>{\rm 02}\>\> $\vdash\;\;X z = \frac{3}{z - \frac{1}{4} - \frac{1}{8} \cdot z^{-1}}$       \`{\footnotesize {\tt Take} X\_eq}\\
  1589 \>{\rm 02}\>\> $\vdash\;\;X z = \frac{3}{z - \frac{1}{4} - \frac{1}{8} \cdot z^{-1}}$       \`{\footnotesize {\tt Take} X\_eq}\\
  1586 \>{\rm 03}\>\> $X z = \frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}$          \`{\footnotesize {\tt Rewrite} ruleZY X\_eq}\\
  1590 \>{\rm 03}\>\> $X z = \frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}$          \`{\footnotesize {\tt Rewrite} prep\_for\_part\_frac X\_eq}\\
  1587 \>{\rm 04}\>\> $\bullet$\> {\tt Problem } [partial\_fraction,rational,simplification]        \`{\footnotesize {\tt SubProblem} \dots}\\
  1591 \>{\rm 04}\>\> $\bullet$\> {\tt Problem } [partial\_fraction,rational,simplification]        \`{\footnotesize {\tt SubProblem} \dots}\\
  1588 \>{\rm 05}\>\>\>  $\vdash\;\;\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=$    \`- - -\\
  1592 \>{\rm 05}\>\>\>  $\vdash\;\;\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=$    \`- - -\\
  1589 \>{\rm 06}\>\>\>  $\frac{24}{-1 + -2 \cdot z + 8 \cdot z^2}$                                   \`- - -\\
  1593 \>{\rm 06}\>\>\>  $\frac{24}{-1 + -2 \cdot z + 8 \cdot z^2}$                                   \`- - -\\
  1590 \>{\rm 07}\>\>\>  $\bullet$\> solve ($-1 + -2 \cdot z + 8 \cdot z^2,\;z$ )                      \`- - -\\
  1594 \>{\rm 07}\>\>\>  $\bullet$\> solve ($-1 + -2 \cdot z + 8 \cdot z^2,\;z$ )                      \`- - -\\
  1591 \>{\rm 08}\>\>\>\>   $\vdash$ \> $\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=0$ \`- - -\\
  1595 \>{\rm 08}\>\>\>\>   $\vdash$ \> $\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=0$ \`- - -\\
  1592 \>{\rm 09}\>\>\>\>   $z = \frac{2+\sqrt{-4+8}}{16}\;\lor\;z = \frac{2-\sqrt{-4+8}}{16}$           \`- - -\\
  1596 \>{\rm 09}\>\>\>\>   $z = \frac{2+\sqrt{-4+8}}{16}\;\lor\;z = \frac{2-\sqrt{-4+8}}{16}$           \`- - -\\
  1593 \>{\rm 10}\>\>\>\>   $z = \frac{1}{2}\;\lor\;z =$ \_\_\_                                           \`- - -\\
  1597 \>{\rm 10}\>\>\>\>   $z = \frac{1}{2}\;\lor\;z =$ \_\_\_                                           \`- - -\\
  1594 \>        \>\>\>\>   \_\_\_                                                                        \`- - -\\
  1598 \>        \>\>\>\>   \_\_\_                                                                        \`- - -\\
  1595 \>{\rm 11}\>\> \dots\> $\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}}$                   \`\\
  1599 \>{\rm 11}\>\> \dots\> $\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}}$                   \`\\
  1596 \>{\rm 12}\>\> $X^\prime z = {\cal Z}^{-1} (\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}})$ \`{\footnotesize {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac)}\\
  1600 \>{\rm 12}\>\> $X^\prime z = {\cal Z}^{-1} (\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}})$ \`{\footnotesize {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac)}\\
  1597 \>{\rm 13}\>\> $X^\prime z = {\cal Z}^{-1} (4\cdot\frac{z}{z - \frac{1}{2}} + -4\cdot\frac{z}{z - \frac{-1}{4}})$ \`{\footnotesize{\tt Rewrite\_Set} ruleYZ X'\_eq }\\
  1601 \>{\rm 13}\>\> $X^\prime z = {\cal Z}^{-1} (4\cdot\frac{z}{z - \frac{1}{2}} + -4\cdot\frac{z}{z - \frac{-1}{4}})$ \`{\footnotesize{\tt Rewrite\_Set} prep\_for\_inverse\_z X'\_eq }\\
  1598 \>{\rm 14}\>\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$  \`{\footnotesize {\tt Rewrite\_Set} inverse\_z X'\_eq}\\
  1602 \>{\rm 14}\>\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$  \`{\footnotesize {\tt Rewrite\_Set} inverse\_z X'\_eq}\\
  1599 \>{\rm 15}\> \dots\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$ \`{\footnotesize {\tt Check\_Postcond}}
  1603 \>{\rm 15}\> \dots\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$ \`{\footnotesize {\tt Check\_Postcond}}
  1600 \end{tabbing}}
  1604 \end{tabbing}}
       
  1605 The tactics on the right margin of the above calculation are those in
       
  1606 the program on p.\pageref{s:impl} which create the respective formulas
       
  1607 on the left.
  1601 % ORIGINAL FROM Inverse_Z_Transform.thy
  1608 % ORIGINAL FROM Inverse_Z_Transform.thy
  1602 %    "Script InverseZTransform (X_eq::bool) =            "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*)
  1609 %    "Script InverseZTransform (X_eq::bool) =            "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*)
  1603 %    "(let X = Take X_eq;                                "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*)
  1610 %    "(let X = Take X_eq;                                "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*)
  1604 %    "  X' = Rewrite ruleZY False X;                     "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*)
  1611 %    "  X' = Rewrite ruleZY False X;                     "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*)
  1605 %    "  (X'_z::real) = lhs X';                           "^(*            ?X' z*)
  1612 %    "  (X'_z::real) = lhs X';                           "^(*            ?X' z*)
  2006 self-contained. The main section describes all the main concepts
  2013 self-contained. The main section describes all the main concepts
  2007 involved in TP-based programming and all the sub-tasks concerning
  2014 involved in TP-based programming and all the sub-tasks concerning
  2008 respective implementation: mechanisation of mathematics and domain
  2015 respective implementation: mechanisation of mathematics and domain
  2009 modelling, implementation of term rewriting systems for the
  2016 modelling, implementation of term rewriting systems for the
  2010 rewriting-engine, formal (implicit) specification of the problem to be
  2017 rewriting-engine, formal (implicit) specification of the problem to be
  2011 (explicitly) described by the program, implement the many components
  2018 (explicitly) described by the program, implementation of the many components
  2012 required for Lucas-Interpretation and finally implementation of the
  2019 required for Lucas-Interpretation and finally implementation of the
  2013 program itself.
  2020 program itself.
  2014 
  2021 
  2015 The many concepts and sub-tasks involved in programming require a
  2022 The many concepts and sub-tasks involved in programming require a
  2016 comprehensive workflow; first experiences with the workflow as
  2023 comprehensive workflow; first experiences with the workflow as
  2039 pattern-matching features; include parallel execution on multi-core
  2046 pattern-matching features; include parallel execution on multi-core
  2040 machines into the language desing.
  2047 machines into the language desing.
  2041 \item Extend the prototype's Lucas-Interpreter such that it also
  2048 \item Extend the prototype's Lucas-Interpreter such that it also
  2042 handles functions defined by use of Isabelle's functions package; and
  2049 handles functions defined by use of Isabelle's functions package; and
  2043 generalize Isabelle's code generator such that efficient code for the
  2050 generalize Isabelle's code generator such that efficient code for the
  2044 whole of the defined programming language can be generated (for
  2051 whole definition of the programming language can be generated (for
  2045 multi-core machines).
  2052 multi-core machines).
  2046 \item Develop an efficient development environment with
  2053 \item Develop an efficient development environment with
  2047 integration of programming and proving, with management not only of
  2054 integration of programming and proving, with management not only of
  2048 Isabelle theories, but also of large collections of specifications and
  2055 Isabelle theories, but also of large collections of specifications and
  2049 of programs.
  2056 of programs.
  2050 \end{itemize} 
  2057 \end{itemize} 
  2051 Provided successful accomplishment, these points provide distinguished
  2058 Provided successful accomplishment, these points provide distinguished
  2052 components for virtual workbenches appealing to practictioner of
  2059 components for virtual workbenches appealing to practictioner of
  2053 engineering in the near future.
  2060 engineering in the near future.
  2054 
  2061 
  2055 \medskip And all programming with a TP-based language will
  2062 \medskip Interactive couse material, as addressed by the title, then
  2056 subsequently create interactive tutoring as a side-effect:
  2063 can comprise step-wise problem solving created as a side-effect of a
  2057 Lucas-Interpretation not only provides an interactive programming
  2064 TP-based program: Lucas-Interpretation not only provides an
  2058 environment, Lucas-Interpretation also can provide TP-based services
  2065 interactive programming environment, Lucas-Interpretation also can
  2059 for a flexible dialog component with adaptive user guidance for
  2066 provide TP-based services for a flexible dialog component with
  2060 independent and inquiry-based learning.
  2067 adaptive user guidance for independent and inquiry-based learning.
  2061 
  2068 
  2062 
  2069 
  2063 \bibliographystyle{alpha}
  2070 \bibliographystyle{alpha}
  2064 \bibliography{references}
  2071 {\small\bibliography{references}}
  2065 
  2072 
  2066 \end{document}
  2073 \end{document}