test/Tools/isac/Knowledge/Inverse_Z_Transform/inverse_z_transform.sml
changeset 59248 5eba5e6d5266
parent 59188 c477d0f79ab9
child 59370 b829919afd7b
equal deleted inserted replaced
59247:7f29665daeb2 59248:5eba5e6d5266
   244 val (dI, pI, mI) = ("Isac", ["Inverse", "Z_Transform", "SignalProcessing"], 
   244 val (dI, pI, mI) = ("Isac", ["Inverse", "Z_Transform", "SignalProcessing"], 
   245    ["SignalProcessing", "Z_Transform", "Inverse_sub"]);
   245    ["SignalProcessing", "Z_Transform", "Inverse_sub"]);
   246 CalcTree [(fmz, (dI,pI,mI))];
   246 CalcTree [(fmz, (dI,pI,mI))];
   247 Iterator 1;
   247 Iterator 1;
   248 moveActiveRoot 1;
   248 moveActiveRoot 1;
   249 autoCalculate' 1 CompleteCalc; 
   249 autoCalculate 1 CompleteCalc; 
   250 
   250 
   251 val ((pt,_),_) = get_calc 1; val p = get_pos 1 1;
   251 val ((pt,_),_) = get_calc 1; val p = get_pos 1 1;
   252 val (Form f, tac, asms) = pt_extract (pt, p);
   252 val (Form f, tac, asms) = pt_extract (pt, p);
   253 if term2str f = "X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]"
   253 if term2str f = "X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]"
   254   andalso p = ([], Res) then ()
   254   andalso p = ([], Res) then ()
   255   else error "inv Z, exp 1 autoCalculate' changed"
   255   else error "inv Z, exp 1 autoCalculate changed"
   256 
   256 
   257 
   257 
   258 "----------- test [SignalProcessing,Z_Transform,inverse] autocalc-";
   258 "----------- test [SignalProcessing,Z_Transform,inverse] autocalc-";
   259 "----------- test [SignalProcessing,Z_Transform,inverse] autocalc-";
   259 "----------- test [SignalProcessing,Z_Transform,inverse] autocalc-";
   260 "----------- test [SignalProcessing,Z_Transform,inverse] autocalc-";
   260 "----------- test [SignalProcessing,Z_Transform,inverse] autocalc-";
   264 val (dI, pI, mI) = ("Isac", ["Inverse", "Z_Transform", "SignalProcessing"], 
   264 val (dI, pI, mI) = ("Isac", ["Inverse", "Z_Transform", "SignalProcessing"], 
   265    ["SignalProcessing", "Z_Transform", "Inverse"]);
   265    ["SignalProcessing", "Z_Transform", "Inverse"]);
   266 CalcTree [(fmz, (dI,pI,mI))];
   266 CalcTree [(fmz, (dI,pI,mI))];
   267 Iterator 1;
   267 Iterator 1;
   268 moveActiveRoot 1;
   268 moveActiveRoot 1;
   269 autoCalculate' 1 CompleteCalc; 
   269 autoCalculate 1 CompleteCalc; 
   270 
   270 
   271 val ((pt,_),_) = get_calc 1; val p = get_pos 1 1;
   271 val ((pt,_),_) = get_calc 1; val p = get_pos 1 1;
   272 val (Form f, tac, asms) = pt_extract (pt, p);
   272 val (Form f, tac, asms) = pt_extract (pt, p);
   273 if term2str f = "X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]"
   273 if term2str f = "X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]"
   274   andalso p = ([], Res) then ()
   274   andalso p = ([], Res) then ()
   275   else error "inv Z, exp 1 autoCalculate' changed"
   275   else error "inv Z, exp 1 autoCalculate changed"
   276 
   276 
   277 show_pt pt;
   277 show_pt pt;
   278 (*[
   278 (*[
   279 (([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])),
   279 (([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])),
   280 (([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))),
   280 (([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))),
   349 ML {* Iterator 1; *}
   349 ML {* Iterator 1; *}
   350 ML {* moveActiveRoot 1; *}
   350 ML {* moveActiveRoot 1; *}
   351 ML {* getFormulaeFromTo 1 ([],Pbl) ([],Pbl) 0 false; *}
   351 ML {* getFormulaeFromTo 1 ([],Pbl) ([],Pbl) 0 false; *}
   352 text {* getFormulaeFromTo 1 ([],Pbl) ([],Pbl) 0 false; *}
   352 text {* getFormulaeFromTo 1 ([],Pbl) ([],Pbl) 0 false; *}
   353 ML {* "##### 1.<NEXT> ############################################" *}
   353 ML {* "##### 1.<NEXT> ############################################" *}
   354 ML {* (*completeCalcHead*)autoCalculate' 1 CompleteCalcHead; *}
   354 ML {* (*completeCalcHead*)autoCalculate 1 CompleteCalcHead; *}
   355 text {* (*completeCalcHead*)getActiveFormula 1 ; *}
   355 text {* (*completeCalcHead*)getActiveFormula 1 ; *}
   356 text {* (*completeCalcHead*)refFormula 1 ([],Met); *}
   356 text {* (*completeCalcHead*)refFormula 1 ([],Met); *}
   357 text {* refFormula 1 ([],Pbl); *}
   357 text {* refFormula 1 ([],Pbl); *}
   358 text {* fetchProposedTactic 1; *}
   358 text {* fetchProposedTactic 1; *}
   359 ML {* autoCalculate' 1 (Step 1); *}
   359 ML {* autoCalculate 1 (Step 1); *}
   360 text {* getFormulaeFromTo 1 ([],Met) ([1],Frm) 0 false; *}
   360 text {* getFormulaeFromTo 1 ([],Met) ([1],Frm) 0 false; *}
   361 text {* getFormulaeFromTo 1 ([],Met) ([1],Frm) 0 false; *}
   361 text {* getFormulaeFromTo 1 ([],Met) ([1],Frm) 0 false; *}
   362 ML {* refFormula 1 ([1],Frm); *}
   362 ML {* refFormula 1 ([1],Frm); *}
   363 text {*<ISA> ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z))) </ISA>*}
   363 text {*<ISA> ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z))) </ISA>*}
   364 text {* refFormula 1 ([1],Frm); *}
   364 text {* refFormula 1 ([1],Frm); *}
   365 ML {* "##### 2.<NEXT> ############################################" *}
   365 ML {* "##### 2.<NEXT> ############################################" *}
   366 text {* refFormula 1 ([1],Frm); *}
   366 text {* refFormula 1 ([1],Frm); *}
   367 ML {* autoCalculate' 1 (Step 1); *}
   367 ML {* autoCalculate 1 (Step 1); *}
   368 text {* getFormulaeFromTo 1 ([1],Frm) ([1],Res) 0 false; *}
   368 text {* getFormulaeFromTo 1 ([1],Frm) ([1],Res) 0 false; *}
   369 text {* getFormulaeFromTo 1 ([1],Frm) ([1],Res) 0 false; *}
   369 text {* getFormulaeFromTo 1 ([1],Frm) ([1],Res) 0 false; *}
   370 ML {* refFormula 1 ([1],Res); *}
   370 ML {* refFormula 1 ([1],Res); *}
   371 text {*<ISA> ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z))) </ISA>*}
   371 text {*<ISA> ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z))) </ISA>*}
   372 ML {* refFormula 1 ([1],Res); *}
   372 ML {* refFormula 1 ([1],Res); *}
   373 ML {* "##### 3.<NEXT> ############################################" *}
   373 ML {* "##### 3.<NEXT> ############################################" *}
   374 text {* refFormula 1 ([1],Res); *}
   374 text {* refFormula 1 ([1],Res); *}
   375 ML {* autoCalculate' 1 (Step 1); *}
   375 ML {* autoCalculate 1 (Step 1); *}
   376 text {* getFormulaeFromTo 1 ([1],Res) ([2],Res) 0 false; *}
   376 text {* getFormulaeFromTo 1 ([1],Res) ([2],Res) 0 false; *}
   377 text {* getFormulaeFromTo 1 ([1],Res) ([2],Res) 0 false; *}
   377 text {* getFormulaeFromTo 1 ([1],Res) ([2],Res) 0 false; *}
   378 ML {* refFormula 1 ([2],Res); *}
   378 ML {* refFormula 1 ([2],Res); *}
   379 text {*<ISA> rhs (?X' z = 24 / (-1 + -2 * z + 8 * z ^ 2)) </ISA>*}
   379 text {*<ISA> rhs (?X' z = 24 / (-1 + -2 * z + 8 * z ^ 2)) </ISA>*}
   380 text {* refFormula 1 ([2],Res); *}
   380 text {* refFormula 1 ([2],Res); *}
   381 ML {* "##### 4.<NEXT> ############################################" *}
   381 ML {* "##### 4.<NEXT> ############################################" *}
   382 text {* refFormula 1 ([2],Res); *}
   382 text {* refFormula 1 ([2],Res); *}
   383 ML {* autoCalculate' 1 (Step 1); *}
   383 ML {* autoCalculate 1 (Step 1); *}
   384 text {* getFormulaeFromTo 1 ([2],Res) ([3],Frm) 0 false; *}
   384 text {* getFormulaeFromTo 1 ([2],Res) ([3],Frm) 0 false; *}
   385 text {* getFormulaeFromTo 1 ([2],Res) ([3],Frm) 0 false; *}
   385 text {* getFormulaeFromTo 1 ([2],Res) ([3],Frm) 0 false; *}
   386 ML {* refFormula 1 ([3],Frm); *}
   386 ML {* refFormula 1 ([3],Frm); *}
   387 text {*<ISA> rhs (?X' z = 24 / (-1 + -2 * z + 8 * z ^ 2)) </ISA>*}
   387 text {*<ISA> rhs (?X' z = 24 / (-1 + -2 * z + 8 * z ^ 2)) </ISA>*}
   388 text {* refFormula 1 ([3],Frm); *}
   388 text {* refFormula 1 ([3],Frm); *}
   389 ML {* "##### 5.<NEXT> ############################################" *}
   389 ML {* "##### 5.<NEXT> ############################################" *}
   390 text {* refFormula 1 ([3],Frm); *}
   390 text {* refFormula 1 ([3],Frm); *}
   391 ML {* autoCalculate' 1 (Step 1); *}
   391 ML {* autoCalculate 1 (Step 1); *}
   392 text {*<CALCMESSAGE> helpless </CALCMESSAGE>*}
   392 text {*<CALCMESSAGE> helpless </CALCMESSAGE>*}
   393 ====================================================================*)
   393 ====================================================================*)
   394 
   394 
   395 
   395