doc-src/isac/jrocnik/eJMT-paper/jrocnik_eJMT.tex
changeset 42498 149043b0685f
parent 42497 261c4bc7fe38
child 42499 ce5df8efc5fb
child 42500 3d3cfbf87c55
equal deleted inserted replaced
42497:261c4bc7fe38 42498:149043b0685f
   467 etc as long as the first {\it term} is true.
   467 etc as long as the first {\it term} is true.
   468 \end{description}
   468 \end{description}
   469 The tacticals are not treated as break-points by Lucas-Interpretation
   469 The tacticals are not treated as break-points by Lucas-Interpretation
   470 and thus do not contribute to the calculation nor to interaction.
   470 and thus do not contribute to the calculation nor to interaction.
   471 
   471 
   472 \section{Development of a Program on Trial}\label{trial} 
   472 \section{Concepts and Tasks in TP-based Programming}\label{trial}
   473 As mentioned above, {\sisac} is an experimental system for a proof of
   473 %\section{Development of a Program on Trial}
   474 concept for Lucas-Interpretation~\cite{wn:lucas-interp-12}.  The
   474 
   475 latter interprets a specific kind of TP-based programming language,
   475 This section presents all the concepts involved in TP-based
   476 which is as experimental as the whole prototype --- so programming in
   476 programming and all the tasks to be accomplished by programmers. The
   477 this language can be only ``on trial'', presently.  However, as a
   477 presentation uses the running example which has been introduced in
   478 prototype, the language addresses essentials described below.
   478 Fig.\ref{fig-interactive} on p.\pageref{fig-interactive}.
   479 
   479 
   480 \subsection{Mechanization of Math --- Domain Engineering}\label{isabisac}
   480 \subsection{Mechanization of Math --- Domain Engineering}\label{isabisac}
   481 
   481 
   482 %WN was Fachleute unter obigem Titel interessiert findet sich
   482 %WN was Fachleute unter obigem Titel interessiert findet sich
   483 %WN unterhalb des auskommentierten Textes.
   483 %WN unterhalb des auskommentierten Textes.
   623 % \textbf{theories} in Isabelle. A theorem must be proven; fortunately
   623 % \textbf{theories} in Isabelle. A theorem must be proven; fortunately
   624 % Isabelle comprises a mechanism (called ``axiomatization''), which
   624 % Isabelle comprises a mechanism (called ``axiomatization''), which
   625 % allows to omit proofs. Such a theorem is shown in
   625 % allows to omit proofs. Such a theorem is shown in
   626 % Example~\ref{eg:neuper1}.
   626 % Example~\ref{eg:neuper1}.
   627 
   627 
   628 The running example, introduced by Fig.\ref{fig-interactive} on
   628 The running example requires to determine the inverse $\cal
   629 p.\pageref{fig-interactive}, requires to determine the inverse $\cal
       
   630 Z$-transform for a class of functions. The domain of Signal Processing
   629 Z$-transform for a class of functions. The domain of Signal Processing
   631 is accustomed to specific notation for the resulting functions, which
   630 is accustomed to specific notation for the resulting functions, which
   632 are absolutely summable and are called TODO: $u[n]$, where $u$ is the
   631 are absolutely summable and are called TODO: $u[n]$, where $u$ is the
   633 function, $n$ is the argument and the brackets indicate that the
   632 function, $n$ is the argument and the brackets indicate that the
   634 arguments are TODO. Surprisingly, Isabelle accepts the rules for
   633 arguments are TODO. Surprisingly, Isabelle accepts the rules for
   748   \begin{verbatim}
   747   \begin{verbatim}
   749   val inverse_Z = append_rls "inverse_Z" e_rls
   748   val inverse_Z = append_rls "inverse_Z" e_rls
   750     [ Thm ("rule1",num_str @{thm rule1}),
   749     [ Thm ("rule1",num_str @{thm rule1}),
   751       Thm ("rule2",num_str @{thm rule2}),
   750       Thm ("rule2",num_str @{thm rule2}),
   752       Thm ("rule3",num_str @{thm rule3})
   751       Thm ("rule3",num_str @{thm rule3})
   753     ];\end{verbatim}
   752     ];
       
   753   \end{verbatim}
   754   \item Define exression:
   754   \item Define exression:
   755   \begin{verbatim}
   755   \begin{verbatim}
   756   val sample_term = str2term "z/(z-1)+z/(z-</delta>)+1";\end{verbatim}
   756   val sample_term = str2term "z/(z-1)+z/(z-</delta>)+1";
       
   757   \end{verbatim}
   757   \item Apply ruleset:
   758   \item Apply ruleset:
   758   \begin{verbatim}
   759   \begin{verbatim}
   759   val SOME (sample_term', asm) = 
   760   val SOME (sample_term', asm) = 
   760     rewrite_set_ thy true inverse_Z sample_term;\end{verbatim}
   761     rewrite_set_ thy true inverse_Z sample_term;
       
   762   \end{verbatim}
   761   \end{enumerate}
   763   \end{enumerate}
   762 %\end{example}
   764 %\end{example}
   763  
   765  
   764 The use of rulesets makes it much easier to develop our designated applications,
   766 The use of rulesets makes it much easier to develop our designated applications,
   765 but the programmer has to be careful and patient. When applying rulesets
   767 but the programmer has to be careful and patient. When applying rulesets
   774 In our special case of Signal Processing and the rules defined in
   776 In our special case of Signal Processing and the rules defined in
   775 Example~\ref{eg:ruledef} we have to apply rule~1 first of all to transform all
   777 Example~\ref{eg:ruledef} we have to apply rule~1 first of all to transform all
   776 constants. After this step has been done it no mather which rule fit's next.
   778 constants. After this step has been done it no mather which rule fit's next.
   777 
   779 
   778 \subsection{Preparation of ML-Functions}\label{funs}
   780 \subsection{Preparation of ML-Functions}\label{funs}
   779 
   781 The prototype's Lucas-Interpreter uses the {\sisac}-rewrite-engine for
   780 \paragraph{Explicit Problems} require explicit methods to solve them, and within
   782 all kinds of evaluation. Some functionality required in programming,
   781 this methods we have some explicit steps to do. This steps can be unique for
   783 however, cannot be accomplished by rewriting. So the prototype has a
   782 a special problem or refindable in other problems. No mather what case, such
   784 mechanism to call ML-functions during rewriting, and the programmer has
   783 steps often require some technical functions behind. For the solving process
   785 to use this mechanism.
   784 of the Inverse Z Transformation and the corresponding partial fraction it was
   786 
   785 neccessary to build helping functions like \texttt{get\_denominator},
   787 In the running example's program on p.\pageref{s:impl} the lines {\rm
   786 \texttt{get\_numerator} or \texttt{argument\_in}. First two functions help us
   788 05} and {\rm 06} contain such functions; we go into the details with
   787 to filter the denominator or numerator out of a fraction, last one helps us to
   789 \textit{argument\_in X\_z;}. This function fetches the argument from a
   788 get to know the bound variable in a equation.
   790 function application: Line {\rm 03} in the example calculation on
   789 \par
   791 p.\pageref{exp-calc} is created by line {\rm 06} of the example
   790 By taking \texttt{get\_denominator} as an example, we want to explain how to 
   792 program on p.\pageref{s:impl} where the program's environment assigns
   791 implement new functions into the existing system and how we can later use them
   793 the value \textit{X z} to the variable \textit{X\_z}; so the function
   792 in our program.
   794 shall extract the argument \textit{z}.
   793 
   795 
   794 \subsubsection{Find a place to Store the Function}
   796 \medskip In order to be recognised as a function constant in the
   795 
   797 program source the function needs to be declared in a theory, here in
   796 The whole system builds up on a well defined structure of Knowledge. This
   798 \textit{Build\_Inverse\_Z\_Transform.thy}; then it can be parsed in
   797 Knowledge sets up at the Path:
   799 the context \textit{ctxt} of that theory:
   798 \begin{center}\ttfamily src/Tools/isac/Knowledge\normalfont\end{center}
   800 {\footnotesize
   799 For implementing the Function \texttt{get\_denominator} (which let us extract
       
   800 the denominator out of a fraction) we have choosen the Theory (file)
       
   801 \texttt{Rational.thy}.
       
   802 
       
   803 \subsubsection{Write down the new Function}
       
   804 
       
   805 In upper Theory we now define the new function and its purpose:
       
   806 \begin{verbatim}
   801 \begin{verbatim}
   807   get_denominator :: "real => real"
   802    consts
   808 \end{verbatim}
   803      argument'_in     :: "real => real"            ("argument'_in _" 10)
   809 This command tells the machine that a function with the name
   804    
   810 \texttt{get\_denominator} exists which gets a real expression as argument and
   805    ML {* val SOME t = parse ctxt "argument_in (X z)"; *}
   811 returns once again a real expression. Now we are able to implement the function
   806 
   812 itself, upcoming example now shows the implementation of
   807    val t = Const ("Build_Inverse_Z_Transform.argument'_in", "RealDef.real ⇒ RealDef.real") 
   813 \texttt{get\_denominator}.
   808              $ (Free ("X", "RealDef.real ⇒ RealDef.real") $ Free ("z", "RealDef.real")): term
   814 
   809 \end{verbatim}}
   815 %\begin{example}
   810 
   816   \label{eg:getdenom}
   811 \noindent Parsing produces a term \texttt{t} in internal
   817   \begin{verbatim}
   812 representation, consisting of \texttt{Const ("argument'\_in", type)}
   818 
   813 and the two variables \texttt{Free ("X", type)} and \texttt{Free ("z",
   819 01  (*
   814 type)}, \texttt{\$} is the term constructor. The function body below is
   820 02   *("get_denominator",
   815 implemented directly in ML, i.e in an \texttt{ML \{* *\}} block; the
   821 03   *  ("Rational.get_denominator", eval_get_denominator ""))
   816 function definition provides a unique prefix \texttt{eval\_} to the
   822 04   *)
   817 function name:
   823 05  fun eval_get_denominator (thmid:string) _ 
   818 
   824 06            (t as Const ("Rational.get_denominator", _) $
   819 {\footnotesize
   825 07                (Const ("Rings.inverse_class.divide", _) $num 
       
   826 08                  $denom)) thy = 
       
   827 09          SOME (mk_thmid thmid "" 
       
   828 10              (Print_Mode.setmp [] 
       
   829 11                (Syntax.string_of_term (thy2ctxt thy)) denom) "", 
       
   830 12              Trueprop $ (mk_equality (t, denom)))
       
   831 13    | eval_get_denominator _ _ _ _ = NONE;\end{verbatim}
       
   832 %\end{example}
       
   833 
       
   834 Line \texttt{07} and \texttt{08} are describing the mode of operation the best -
       
   835 there is a fraction\\ (\ttfamily Rings.inverse\_class.divide\normalfont) 
       
   836 splittet
       
   837 into its two parts (\texttt{\$num \$denom}). The lines before are additionals
       
   838 commands for declaring the function and the lines after are modeling and 
       
   839 returning a real variable out of \texttt{\$denom}.
       
   840 
       
   841 \subsubsection{Add a test for the new Function}
       
   842 
       
   843 \paragraph{Everytime when adding} a new function it is essential also to add
       
   844 a test for it. Tests for all functions are sorted in the same structure as the
       
   845 knowledge it self and can be found up from the path:
       
   846 \begin{center}\ttfamily test/Tools/isac/Knowledge\normalfont\end{center}
       
   847 This tests are nothing very special, as a first prototype the functionallity
       
   848 of a function can be checked by evaluating the result of a simple expression
       
   849 passed to the function. Example~\ref{eg:getdenomtest} shows the test for our
       
   850 \textit{just} created function \texttt{get\_denominator}.
       
   851 
       
   852 %\begin{example}
       
   853 \label{eg:getdenomtest}
       
   854 \begin{verbatim}
   820 \begin{verbatim}
   855 
   821    ML {*
   856 01 val thy = @{theory Isac};
   822      fun eval_argument_in _ 
   857 02 val t = term_of (the (parse thy "get_denominator ((a +x)/b)"));
   823        "Build_Inverse_Z_Transform.argument'_in" 
   858 03 val SOME (_, t') = eval_get_denominator "" 0 t thy;
   824        (t as (Const ("Build_Inverse_Z_Transform.argument'_in", _) $ (f $ arg))) _ =
   859 04 if term2str t' = "get_denominator ((a + x) / b) = b" then ()
   825          if is_Free arg (*could be something to be simplified before*)
   860 05 else error "get_denominator ((a + x) / b) = b" \end{verbatim}
   826          then SOME (term2str t ^ " = " ^ term2str arg, Trueprop $ (mk_equality (t, arg)))
   861 %\end{example}
   827          else NONE
   862 
   828      | eval_argument_in _ _ _ _ = NONE;
   863 \begin{description}
   829    *}
   864 \item[01] checks if the proofer set up on our {\sisac{}} System.
   830 \end{verbatim}}
   865 \item[02] passes a simple expression (fraction) to our suddenly created
   831 
   866           function.
   832 \noindent The function body creates either creates \texttt{NONE}
   867 \item[04] checks if the resulting variable is the correct one (in this case
   833 telling the rewrite-engine to search for the next redex, or creates an
   868           ``b'' the denominator) and returns.
   834 ad-hoc theorem for rewriting, thus the programmer needs to adopt many
   869 \item[05] handels the error case and reports that the function is not able to
   835 technicalities of Isabelle, for instance, the \textit{Trueprop}
   870           solve the given problem.
   836 constant.
   871 \end{description}
   837 
       
   838 \bigskip This sub-task particularly sheds light on basic issues in the
       
   839 design of a programming language, the integration of diffent language
       
   840 layers, the layer of Isabelle/Isar and Isabelle/ML.
       
   841 
       
   842 Another point of improvement for the prototype is the rewrite-engine: The
       
   843 program on p.\pageref{s:impl} would not allow to contract the two lines {\rm 05}
       
   844 and {\rm 06} to
       
   845 
       
   846 {\small\it\label{s:impl}
       
   847 \begin{tabbing}
       
   848 123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill
       
   849 \>{\rm 05/6}\>\>\>  (z::real) = argument\_in (lhs X\_eq) ;
       
   850 \end{tabbing}}
       
   851 
       
   852 \noindent because nested function calls would require creating redexes
       
   853 inside-out; however, the prototype's rewrite-engine only works top down
       
   854 from the root of a term down to the leaves.
       
   855 
       
   856 How all these ugly technicalities are to be checked in the prototype is 
       
   857 shown in \S\ref{flow-prep} below.
       
   858 
       
   859 % \paragraph{Explicit Problems} require explicit methods to solve them, and within
       
   860 % this methods we have some explicit steps to do. This steps can be unique for
       
   861 % a special problem or refindable in other problems. No mather what case, such
       
   862 % steps often require some technical functions behind. For the solving process
       
   863 % of the Inverse Z Transformation and the corresponding partial fraction it was
       
   864 % neccessary to build helping functions like \texttt{get\_denominator},
       
   865 % \texttt{get\_numerator} or \texttt{argument\_in}. First two functions help us
       
   866 % to filter the denominator or numerator out of a fraction, last one helps us to
       
   867 % get to know the bound variable in a equation.
       
   868 % \par
       
   869 % By taking \texttt{get\_denominator} as an example, we want to explain how to 
       
   870 % implement new functions into the existing system and how we can later use them
       
   871 % in our program.
       
   872 % 
       
   873 % \subsubsection{Find a place to Store the Function}
       
   874 % 
       
   875 % The whole system builds up on a well defined structure of Knowledge. This
       
   876 % Knowledge sets up at the Path:
       
   877 % \begin{center}\ttfamily src/Tools/isac/Knowledge\normalfont\end{center}
       
   878 % For implementing the Function \texttt{get\_denominator} (which let us extract
       
   879 % the denominator out of a fraction) we have choosen the Theory (file)
       
   880 % \texttt{Rational.thy}.
       
   881 % 
       
   882 % \subsubsection{Write down the new Function}
       
   883 % 
       
   884 % In upper Theory we now define the new function and its purpose:
       
   885 % \begin{verbatim}
       
   886 %   get_denominator :: "real => real"
       
   887 % \end{verbatim}
       
   888 % This command tells the machine that a function with the name
       
   889 % \texttt{get\_denominator} exists which gets a real expression as argument and
       
   890 % returns once again a real expression. Now we are able to implement the function
       
   891 % itself, upcoming example now shows the implementation of
       
   892 % \texttt{get\_denominator}.
       
   893 % 
       
   894 % %\begin{example}
       
   895 %   \label{eg:getdenom}
       
   896 %   \begin{verbatim}
       
   897 % 
       
   898 % 01  (*
       
   899 % 02   *("get_denominator",
       
   900 % 03   *  ("Rational.get_denominator", eval_get_denominator ""))
       
   901 % 04   *)
       
   902 % 05  fun eval_get_denominator (thmid:string) _ 
       
   903 % 06            (t as Const ("Rational.get_denominator", _) $
       
   904 % 07                (Const ("Rings.inverse_class.divide", _) $num 
       
   905 % 08                  $denom)) thy = 
       
   906 % 09          SOME (mk_thmid thmid "" 
       
   907 % 10              (Print_Mode.setmp [] 
       
   908 % 11                (Syntax.string_of_term (thy2ctxt thy)) denom) "", 
       
   909 % 12              Trueprop $ (mk_equality (t, denom)))
       
   910 % 13    | eval_get_denominator _ _ _ _ = NONE;\end{verbatim}
       
   911 % %\end{example}
       
   912 % 
       
   913 % Line \texttt{07} and \texttt{08} are describing the mode of operation the best -
       
   914 % there is a fraction\\ (\ttfamily Rings.inverse\_class.divide\normalfont) 
       
   915 % splittet
       
   916 % into its two parts (\texttt{\$num \$denom}). The lines before are additionals
       
   917 % commands for declaring the function and the lines after are modeling and 
       
   918 % returning a real variable out of \texttt{\$denom}.
       
   919 % 
       
   920 % \subsubsection{Add a test for the new Function}
       
   921 % 
       
   922 % \paragraph{Everytime when adding} a new function it is essential also to add
       
   923 % a test for it. Tests for all functions are sorted in the same structure as the
       
   924 % knowledge it self and can be found up from the path:
       
   925 % \begin{center}\ttfamily test/Tools/isac/Knowledge\normalfont\end{center}
       
   926 % This tests are nothing very special, as a first prototype the functionallity
       
   927 % of a function can be checked by evaluating the result of a simple expression
       
   928 % passed to the function. Example~\ref{eg:getdenomtest} shows the test for our
       
   929 % \textit{just} created function \texttt{get\_denominator}.
       
   930 % 
       
   931 % %\begin{example}
       
   932 % \label{eg:getdenomtest}
       
   933 % \begin{verbatim}
       
   934 % 
       
   935 % 01 val thy = @{theory Isac};
       
   936 % 02 val t = term_of (the (parse thy "get_denominator ((a +x)/b)"));
       
   937 % 03 val SOME (_, t') = eval_get_denominator "" 0 t thy;
       
   938 % 04 if term2str t' = "get_denominator ((a + x) / b) = b" then ()
       
   939 % 05 else error "get_denominator ((a + x) / b) = b" \end{verbatim}
       
   940 % %\end{example}
       
   941 % 
       
   942 % \begin{description}
       
   943 % \item[01] checks if the proofer set up on our {\sisac{}} System.
       
   944 % \item[02] passes a simple expression (fraction) to our suddenly created
       
   945 %           function.
       
   946 % \item[04] checks if the resulting variable is the correct one (in this case
       
   947 %           ``b'' the denominator) and returns.
       
   948 % \item[05] handels the error case and reports that the function is not able to
       
   949 %           solve the given problem.
       
   950 % \end{description}
   872 
   951 
   873 \subsection{Specification of the Problem}\label{spec}
   952 \subsection{Specification of the Problem}\label{spec}
   874 %WN <--> \chapter 7 der Thesis
   953 %WN <--> \chapter 7 der Thesis
   875 %WN die Argumentation unten sollte sich NUR auf Verifikation beziehen..
   954 %WN die Argumentation unten sollte sich NUR auf Verifikation beziehen..
   876 
   955 
  1157 simplify verification tasks in the future; on the other hand, this
  1236 simplify verification tasks in the future; on the other hand, this
  1158 fact causes troubles in error detectetion which are discussed as part
  1237 fact causes troubles in error detectetion which are discussed as part
  1159 of the workflow in the subsequent section.
  1238 of the workflow in the subsequent section.
  1160 
  1239 
  1161 \section{Workflow of Programming in the Prototype}\label{workflow}
  1240 \section{Workflow of Programming in the Prototype}\label{workflow}
  1162 The previous section presented all the duties and tasks to be accomplished by
  1241 The new prover IDE Isabelle/jEdit~\cite{makar-jedit-12} is a great
  1163 programmers of TP-based languages. Some tasks are interrelated and comprehensive,
  1242 step forward for interactive theory and proof development. The
  1164 so first experiences with the workflow in programming are noted below. The notes
  1243 {\sisac}-prototype re-uses this IDE as a programming environment.  The
  1165 also capture requirements for future language development.
  1244 experiences from this re-use show, that the essential components are
       
  1245 available from Isabelle/jEdit. However, additional tools and features
       
  1246 are required to acchieve acceptable usability.
       
  1247 
       
  1248 So notable experiences are reported here, also as a requirement
       
  1249 capture for further development of TP-based languages and respective
       
  1250 IDEs.
  1166 
  1251 
  1167 \subsection{Preparations and Trials}\label{flow-prep}
  1252 \subsection{Preparations and Trials}\label{flow-prep}
  1168 % Build\_Inverse\_Z\_Transform.thy ... ``imports PolyEq DiffApp Partial\_Fractions''
  1253 
  1169 The new graphical user-interface of Isabelle~\cite{makar-jedit-12} is a great
  1254 
  1170 step forward for interactive theory and proof development --- and so it is for
  1255  --- the re-use
       
  1256 of
       
  1257 
       
  1258 
       
  1259 
       
  1260 
       
  1261 and so it is for
  1171 interactive program development; the specific requirements raised by interactive
  1262 interactive program development; the specific requirements raised by interactive
  1172 programming will be mentioned separately.
  1263 programming will be mentioned separately.
  1173 
  1264 
  1174 The development in the {\sisac}-prototype was done in a separate
  1265 The development in the {\sisac}-prototype was done in a separate
  1175 theory~\footnote{http://www.ist.tugraz.at/projects/isac/publ/Build\_Inverse\_Z\_Transform.thy}.
  1266 theory~\footnote{http://www.ist.tugraz.at/projects/isac/publ/Build\_Inverse\_Z\_Transform.thy}.
  1178 the interactivity of Isabelle/jEdit is very supportive. For instance,
  1269 the interactivity of Isabelle/jEdit is very supportive. For instance,
  1179 as soon as the theorems for the Z-transform are established (see
  1270 as soon as the theorems for the Z-transform are established (see
  1180 \S\ref{isabisac}) it is tempting to see them at work: First we need
  1271 \S\ref{isabisac}) it is tempting to see them at work: First we need
  1181 technical prerequisites not worth to mention and parse a string to a
  1272 technical prerequisites not worth to mention and parse a string to a
  1182 term using {\sisac}'s function \textit{str2term}:
  1273 term using {\sisac}'s function \textit{str2term}:
       
  1274 
       
  1275 .\\.\\.\\
       
  1276 
       
  1277 \cite{jrocnik-bakk}
       
  1278 
       
  1279 .\\.\\.\\
       
  1280 
  1183 {\footnotesize\label{exp-spec}
  1281 {\footnotesize\label{exp-spec}
  1184 \begin{verbatim}
  1282 \begin{verbatim}
  1185    ML {*
  1283    ML {*
  1186      val (thy, ro, er) = (@{theory}, tless_true, eval_rls);
  1284      val (thy, ro, er) = (@{theory}, tless_true, eval_rls);
  1187      val t = str2term "z / (z - 1) + z / (z - \<alpha>) + 1";
  1285      val t = str2term "z / (z - 1) + z / (z - \<alpha>) + 1";
  1236 \subparagraph{By writing down} each of this neccesarry steps we are describing
  1334 \subparagraph{By writing down} each of this neccesarry steps we are describing
  1237 one line of our upcoming program. In the following example we show the 
  1335 one line of our upcoming program. In the following example we show the 
  1238 Calculation on the left and on the right the tactics in the program which
  1336 Calculation on the left and on the right the tactics in the program which
  1239 created the respective formula on the left.
  1337 created the respective formula on the left.
  1240 
  1338 
  1241 \begin{example}
  1339 {\small\it\label{exp-calc}
  1242 \hfill\\
       
  1243 {\small\it
       
  1244 \begin{tabbing}
  1340 \begin{tabbing}
  1245 123l\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill
  1341 123l\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill
  1246 \>{\rm 01}\> $\bullet$  \> {\tt Problem } (Inverse\_Z\_Transform, [Inverse, Z\_Transform, SignalProcessing])       \`\\
  1342 \>{\rm 01}\> $\bullet$  \> {\tt Problem } (Inverse\_Z\_Transform, [Inverse, Z\_Transform, SignalProcessing])       \`\\
  1247 \>{\rm 02}\>\> $\vdash\;\;X z = \frac{3}{z - \frac{1}{4} - \frac{1}{8} \cdot z^{-1}}$       \`{\footnotesize {\tt Take} X\_eq}\\
  1343 \>{\rm 02}\>\> $\vdash\;\;X z = \frac{3}{z - \frac{1}{4} - \frac{1}{8} \cdot z^{-1}}$       \`{\footnotesize {\tt Take} X\_eq}\\
  1248 \>{\rm 03}\>\> $X z = \frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}$          \`{\footnotesize {\tt Rewrite} ruleZY X\_eq}\\
  1344 \>{\rm 03}\>\> $X z = \frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}$          \`{\footnotesize {\tt Rewrite} ruleZY X\_eq}\\
  1258 \>{\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)}\\
  1354 \>{\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)}\\
  1259 \>{\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 }\\
  1355 \>{\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 }\\
  1260 \>{\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}\\
  1356 \>{\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}\\
  1261 \>{\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}}
  1357 \>{\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}}
  1262 \end{tabbing}}
  1358 \end{tabbing}}
  1263 
       
  1264 \end{example}
       
  1265 
       
  1266 % ORIGINAL FROM Inverse_Z_Transform.thy
  1359 % ORIGINAL FROM Inverse_Z_Transform.thy
  1267 %    "Script InverseZTransform (X_eq::bool) =            "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*)
  1360 %    "Script InverseZTransform (X_eq::bool) =            "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*)
  1268 %    "(let X = Take X_eq;                                "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*)
  1361 %    "(let X = Take X_eq;                                "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*)
  1269 %    "  X' = Rewrite ruleZY False X;                     "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*)
  1362 %    "  X' = Rewrite ruleZY False X;                     "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*)
  1270 %    "  (X'_z::real) = lhs X';                           "^(*            ?X' z*)
  1363 %    "  (X'_z::real) = lhs X';                           "^(*            ?X' z*)