693 add ``algorithmic knowledge'' in Fig.\ref{fig:mathuni} on |
693 add ``algorithmic knowledge'' in Fig.\ref{fig:mathuni} on |
694 p.\pageref{fig:mathuni}. As we shall see below, TP-based programming |
694 p.\pageref{fig:mathuni}. As we shall see below, TP-based programming |
695 starts with a formal {\em specification} of the problem to be solved. |
695 starts with a formal {\em specification} of the problem to be solved. |
696 \begin{figure} |
696 \begin{figure} |
697 \begin{center} |
697 \begin{center} |
698 %\includegraphics[width=110mm]{fig/math-universe-small} |
698 \includegraphics[width=110mm]{../../fig/jrocnik/math-universe-small} |
699 \caption{The three-dimensional universe of mathematics knowledge} |
699 \caption{The three-dimensional universe of mathematics knowledge} |
700 \label{fig:mathuni} |
700 \label{fig:mathuni} |
701 \end{center} |
701 \end{center} |
702 \end{figure} |
702 \end{figure} |
703 The language for both axes is defined in the axis at the bottom, deductive |
703 The language for both axes is defined in the axis at the bottom, deductive |
971 \hfill \\ |
971 \hfill \\ |
972 Specification:\\ |
972 Specification:\\ |
973 \>input \>: filterExpression $X=\frac{3}{(z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}$\\ |
973 \>input \>: filterExpression $X=\frac{3}{(z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}$\\ |
974 \>precond \>: filterExpression continius on $\mathbb{R}$ \\ |
974 \>precond \>: filterExpression continius on $\mathbb{R}$ \\ |
975 \>output \>: stepResponse $x[n]$ \\ |
975 \>output \>: stepResponse $x[n]$ \\ |
976 \>postcond \>: TODO - (Mind the following remark)\\ \end{tabbing}} |
976 \>postcond \>: TODO\\ \end{tabbing}} |
977 |
977 |
978 \begin{remark} |
978 %JR wie besprochen, kein remark, keine begründung, nur simples "nicht behandelt" |
979 Defining the postcondition requires a high amount mathematical |
979 |
980 knowledge, the difficult part in our case is not to set up this condition |
980 % \begin{remark} |
981 nor it is more to define it in a way the interpreter is able to handle it. |
981 % Defining the postcondition requires a high amount mathematical |
982 Due the fact that implementing that mechanisms is quite the same amount as |
982 % knowledge, the difficult part in our case is not to set up this condition |
983 creating the programm itself, it is not avaible in our prototype. |
983 % nor it is more to define it in a way the interpreter is able to handle it. |
984 \label{rm:postcond} |
984 % Due the fact that implementing that mechanisms is quite the same amount as |
985 \end{remark} |
985 % creating the programm itself, it is not avaible in our prototype. |
|
986 % \label{rm:postcond} |
|
987 % \end{remark} |
986 |
988 |
987 \paragraph{The implementation} of the formal specification in the present |
989 \paragraph{The implementation} of the formal specification in the present |
988 prototype, still bar-bones without support for authoring: |
990 prototype, still bar-bones without support for authoring: |
989 %WN Kopie von Inverse_Z_Transform.thy, leicht versch"onert: |
991 %WN Kopie von Inverse_Z_Transform.thy, leicht versch"onert: |
990 {\footnotesize\label{exp-spec} |
992 {\footnotesize\label{exp-spec} |
1092 % \end{example} |
1094 % \end{example} |
1093 % } |
1095 % } |
1094 |
1096 |
1095 \subsection{Implementation of the Method}\label{meth} |
1097 \subsection{Implementation of the Method}\label{meth} |
1096 |
1098 |
1097 \paragraph{After specifieing the problem} we start to implement the method(s) of |
1099 The methods represent the different ways a problem can be solved. This can |
1098 the problem. The methods represent the different ways a problem can be solved, |
1100 include mathematical tactics as well as tactics taught in different courses. |
1099 this can include different mathematical tactics as well as different tactics |
1101 Declaring the Method itself gives us the possibilities to describe the way of |
1100 taught in different courses. |
1102 calculation in deep, as well we get the oppertunities to build in different |
1101 |
1103 rulesets. |
1102 |
1104 |
|
1105 {\small |
1103 \begin{verbatim} |
1106 \begin{verbatim} |
1104 01 store_met |
1107 01 store_met |
1105 02 (prep_met thy "SP_InverseZTransformation_classic" [] e_metID |
1108 02 (prep_met thy "SP_InverseZTransformation_classic" [] e_metID |
1106 03 (["SignalProcessing", "Z_Transform", "Inverse"], |
1109 03 (["SignalProcessing", "Z_Transform", "Inverse"], |
1107 04 [("#Given" ,["filterExpression (X_eq::bool)"]), |
1110 04 [("#Given" ,["filterExpression (X_eq::bool)"]), |
1108 05 ("#Find" ,["stepResponse (n_eq::bool)"])], |
1111 05 ("#Find" ,["stepResponse (n_eq::bool)"])], |
1109 06 {rew_ord'="tless_true", |
1112 06 {rew_ord'="tless_true", |
1110 07 rls'= e_rls, |
1113 07 rls = rls, |
1111 08 calc = [], |
1114 08 calc = [], |
1112 09 srls = e_rls, |
1115 09 srls = e_rls, |
1113 10 prls = e_rls, |
1116 10 prls = e_rls, |
1114 11 crls = e_rls, |
1117 11 crls = e_rls, |
1115 12 errpats = [], |
1118 12 errpats = [], |
1116 13 nrls = e_rls}, |
1119 13 nrls = e_rls}, |
1117 14 "empty_programm" |
1120 14 "empty_program" |
1118 15 )); |
1121 15 )); |
1119 \end{verbatim} |
1122 \end{verbatim} |
1120 |
1123 } |
1121 The above code is again very technical and goes hard in detail. But to document |
1124 |
1122 and present the neccessary steps follow up the description of the above code: |
1125 The above code is again very technical and goes hard in detail. Unfortunataly |
|
1126 most declerations are not essential for a basic programm but leads us to a huge |
|
1127 range of powerful possibilities. |
1123 |
1128 |
1124 \begin{description} |
1129 \begin{description} |
1125 |
1130 \item[01..02] stores the method with the given name into the system under a global |
1126 \item[01-02] this to lines store the method with the given name into the system |
1131 reference. |
1127 \item[03] here, the path is specifiet; which capitel this method is belonging to |
1132 \item[03] specifies the topic under which the method can be used. |
1128 \item[04-05] as the requirements for different methods can be different we |
1133 \item[04..05] as the requirements for different methods can deviant we |
1129 specify again the \emph{given} and the \emph{find} element. |
1134 declare what is \emph{given} and and what to \emph{find} for this specific method. |
1130 \item[06] |
1135 \item[06] \emph{rewrite order} is the order of this rls, which one theorem of is |
1131 \item[07] |
1136 used for rewriting one single step. |
1132 \item[08] |
1137 \item[07] \texttt{rls} is the currently used ruleset for this method, |
1133 \item[09] |
1138 \texttt{e\_rls} specifies a |
1134 \item[10] |
1139 ruleset where conditions can be used within it. |
1135 \item[11] |
1140 \item[08] we can add this method to a predefined tree of calculations ore leave |
1136 \item[12] |
1141 it independend. |
1137 \item[13] |
1142 \item[09] \texttt{srls}, can be used to evaluate list expressions in the source |
|
1143 \item[10] \texttt{prls} indicates predicates which can be used in model patterns. |
|
1144 \item[11] \texttt{crls}, gives us the possibility for checking formulas |
|
1145 lementwise |
|
1146 \item[12] \emph{error patterns} which are expected in this kind of method can be |
|
1147 specified. |
|
1148 \item[13] \texttt{crls}, declares the canonical simplifier for the specific method |
1138 \item[14] for this time we don't specify the programm itself and keep it empty. |
1149 \item[14] for this time we don't specify the programm itself and keep it empty. |
1139 Follow up \S\ref{progr} for informations on how to implement this \textit{main} |
1150 Follow up \S\ref{progr} for informations on how to implement this \textit{main} |
1140 part. |
1151 part. |
1141 |
|
1142 |
|
1143 \end{description} |
1152 \end{description} |
1144 |
1153 |
1145 \subsection{Implementation of the TP-based Program}\label{progr} |
1154 \subsection{Implementation of the TP-based Program}\label{progr} |
1146 So finally all the prerequisites are described and the very topic can |
1155 So finally all the prerequisites are described and the very topic can |
1147 be addressed. The program below comes back to the running example: it |
1156 be addressed. The program below comes back to the running example: it |