test/Tools/isac/MathEngBasic/ctree-navi.sml
author Walther Neuper <walther.neuper@jku.at>
Sat, 26 Oct 2019 13:03:16 +0200
changeset 59674 3da177a07c3e
parent 59659 test/Tools/isac/Specify/ctree-navi.sml@f3f0b8d66cc8
child 59749 cc3b1807f72e
permissions -rw-r--r--
separate common base for Specify and Interpret

note: much to disentangle between Specify -- MathEngBasic -- CalcElements
neuper@38036
     1
(* Title: tests for Interpret/mstools.sml
e0726734@41957
     2
   Author: Walther Neuper 100930, Mathias Lehnfeld
neuper@38036
     3
   (c) copyright due to lincense terms.
neuper@38036
     4
*)
wneuper@59582
     5
"-----------------------------------------------------------------------------------------------";
wneuper@59582
     6
"table of contents -----------------------------------------------------------------------------";
wneuper@59582
     7
"-----------------------------------------------------------------------------------------------";
wneuper@59582
     8
"----------- go through Model_Problem until nxt_tac --------------------------------------------";
wneuper@59309
     9
"----------- fun comp_dts -- fun split_dts -----------------------------------------------------";
wneuper@59309
    10
"----------- type penv -------------------------------------------------------------------------";
wneuper@59309
    11
"----------- fun untouched ---------------------------------------------------------------------";
wneuper@59309
    12
"----------- fun pbl_ids -----------------------------------------------------------------------";
wneuper@59309
    13
"----------- fun upd_penv ----------------------------------------------------------------------";
wneuper@59309
    14
"----------- fun upd ---------------------------------------------------------------------------";
wneuper@59309
    15
"----------- fun upds_envv ---------------------------------------------------------------------";
wneuper@59515
    16
"----------- fun common_subthy -----------------------------------------------------------------";
neuper@38036
    17
"--------------------------------------------------------";
neuper@38036
    18
"--------------------------------------------------------";
neuper@38036
    19
"--------------------------------------------------------";
bonzai@41941
    20
"--------------------------------------------------------";
neuper@37906
    21
neuper@37906
    22
wneuper@59582
    23
"----------- go through Model_Problem until nxt_tac --------------------------------------------";
wneuper@59582
    24
"----------- go through Model_Problem until nxt_tac --------------------------------------------";
wneuper@59582
    25
"----------- go through Model_Problem until nxt_tac --------------------------------------------";
neuper@41982
    26
(*FIXME.WN110511 delete this test? (goes through "Model_Problem until nxt_tac)*)
neuper@41982
    27
val fmz = ["equality (x+1=(2::real))", "solveFor x","solutions L"];
neuper@41982
    28
val (dI',pI',mI') =
neuper@41982
    29
  ("Test", ["sqroot-test","univariate","equation","test"],
neuper@41982
    30
   ["Test","squ-equ-test-subpbl1"]);
akargl@42188
    31
(*========== inhibit exn AK110725 ================================================
akargl@42188
    32
(* ERROR: same as above, see lines 120- 123 *)
neuper@41982
    33
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
akargl@42188
    34
========== inhibit exn AK110725 ================================================*)
akargl@42188
    35
akargl@42188
    36
(*========== inhibit exn AK110725 ================================================
akargl@42188
    37
(* ERROR: p, nxt, pt not declared due to above error *)
neuper@41982
    38
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    39
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    40
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    41
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    42
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    43
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    44
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    45
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    46
val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
neuper@41982
    47
val (p,_,f,nxt,_,pt) = me nxt p [1] pt; (*nxt = ("Subproblem",*)
neuper@41982
    48
val (p,_,f,nxt,_,pt) = me nxt p [1] pt; (*nxt = ("Model_Problem",*)
neuper@41982
    49
"~~~~~ fun me, args:"; val (_,tac) = nxt;
neuper@41982
    50
val (pt, p) = case locatetac tac (pt,p) of
neuper@41982
    51
	("ok", (_, _, ptp))  => ptp | _ => error "script.sml locatetac";
neuper@41982
    52
"~~~~~ fun step, args:"; val (ip as (_,p_), (ptp as (pt,p), tacis)) = (p, ((pt, e_pos'), []))
neuper@41982
    53
val pIopt = get_pblID (pt,ip);
neuper@41982
    54
tacis; (*= []*)
neuper@41982
    55
pIopt; (*= SOME ["sqroot-test", "univariate", ...]*)
neuper@41982
    56
member op = [Pbl,Met] p_ andalso is_none (get_obj g_env pt (fst p)); (*= true*)
neuper@41982
    57
"~~~~~ fun nxt_specify_, args:"; val (ptp as (pt, pos as (p,p_))) = (pt, ip);
neuper@41982
    58
val pblobj as (PblObj{meth,origin=origin as (oris,(dI',pI',mI'),_),
neuper@41982
    59
			  probl,spec=(dI,pI,mI),...}) = get_obj I pt p;
neuper@41982
    60
just_created_ pblobj (*by Subproblem*) andalso origin <> e_origin; (*false=oldNB*)
neuper@41982
    61
val cpI = if pI = e_pblID then pI' else pI;
neuper@41982
    62
		val cmI = if mI = e_metID then mI' else mI;
neuper@41982
    63
		val {ppc, prls, where_, ...} = get_pbt cpI;
neuper@41982
    64
		val pre = check_preconds "thy 100820" prls where_ probl;
neuper@41982
    65
		val pb = foldl and_ (true, map fst pre);
neuper@41982
    66
val (_,tac) = nxt_spec p_ pb oris (dI',pI',mI') (probl, meth) 
neuper@41982
    67
			    (ppc, (#ppc o get_met) cmI) (dI, pI, mI); (*tac = Add_Given "equality (-1 + x = 0)"*)
neuper@41982
    68
"~~~~~ fun nxt_specif, args:"; val (Add_Given ct, ptp) = (tac, ptp);
neuper@41982
    69
"~~~~~ fun nxt_specif_additem, args:"; val (sel, ct, ptp as (pt, (p, Pbl))) = ("#Given", ct, ptp);
neuper@41982
    70
val (PblObj{meth=met,origin=(oris,(dI',pI',_),_),
neuper@41982
    71
		  probl=pbl,spec=(dI,pI,_),...}) = get_obj I pt p;
neuper@41982
    72
val thy = if dI = e_domID then assoc_thy dI' else assoc_thy dI;
neuper@41982
    73
val cpI = if pI = e_pblID then pI' else pI;
neuper@41982
    74
val ctxt = get_ctxt pt (p, Pbl);
neuper@41982
    75
"~~~~~ fun appl_add, args:"; val (ctxt, sel, oris, ppc, pbt, str) = (ctxt, sel, oris, pbl, ((#ppc o get_pbt) cpI), ct);
neuper@41982
    76
val SOME t = parseNEW ctxt str;
neuper@41982
    77
is_known ctxt sel oris t;
neuper@41982
    78
"~~~~~ fun is_known, args:"; val (ctxt, sel, ori, t) = (ctxt, sel, oris, t);
neuper@41982
    79
val _ = tracing ("RM is_known: t=" ^ term2str t);
neuper@41982
    80
val ots = (distinct o flat o (map #5)) (ori:ori list);
neuper@41982
    81
val oids = ((map (fst o dest_Free)) o distinct o flat o (map vars)) ots;
neuper@41982
    82
val (d, ts) = split_dts t;
neuper@41982
    83
"~~~~~ fun split_dts, args:"; val (t as d $ arg) = t;
neuper@41982
    84
(*if is_dsc d then () else error "TODO";*)
neuper@41990
    85
if is_dsc d then () else error "TODO";
neuper@41982
    86
"----- these were the errors (call hierarchy from bottom up)";
neuper@41982
    87
appl_add ctxt sel oris pbl ((#ppc o get_pbt) cpI) ct;(*WAS
neuper@41982
    88
Err "[error] appl_add: is_known: identifiers [equality] not in example"*)
neuper@41982
    89
nxt_specif_additem "#Given" ct ptp;(*WAS
neuper@41982
    90
Tac "[error] appl_add: is_known: identifiers [equality] not in example"*)
neuper@41982
    91
nxt_specif tac ptp;(*WAS
neuper@41982
    92
Tac "[error] appl_add: is_known: identifiers [equality] not in example"*)
neuper@41982
    93
nxt_specify_ (pt,ip); (*WAS
neuper@41982
    94
Tac "[error] appl_add: is_known: identifiers [equality] not in example"*)
neuper@41982
    95
(*val (p,_,f,nxt,_,pt) = me nxt p [1] pt; WAS
neuper@41982
    96
Tac "[error] appl_add: is_known: identifiers [equality] not in example"*)
akargl@42188
    97
========== inhibit exn AK110725 ================================================*)
wneuper@59309
    98
wneuper@59309
    99
"----------- fun comp_dts -- fun split_dts -----------------------------------------------------";
wneuper@59309
   100
"----------- fun comp_dts -- fun split_dts -----------------------------------------------------";
wneuper@59309
   101
"----------- fun comp_dts -- fun split_dts -----------------------------------------------------";
wneuper@59309
   102
(*val t = str2term "maximum A"; 
wneuper@59309
   103
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   104
val it = "maximum A" : cterm
wneuper@59309
   105
> val t = str2term "fixedValues [r=Arbfix]"; 
wneuper@59309
   106
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   107
"fixedValues [r = Arbfix]"
wneuper@59309
   108
> val t = str2term "valuesFor [a]"; 
wneuper@59309
   109
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   110
"valuesFor [a]"
wneuper@59309
   111
> val t = str2term "valuesFor [a,b]"; 
wneuper@59309
   112
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   113
"valuesFor [a, b]"
wneuper@59309
   114
> val t = str2term "relations [A=a*b, (a/2)^^^2 + (b/2)^^^2 = r^^^2]"; 
wneuper@59309
   115
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   116
relations [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]"
wneuper@59309
   117
> val t = str2term "boundVariable a";
wneuper@59309
   118
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   119
"boundVariable a"
wneuper@59309
   120
> val t = str2term "interval {x::real. 0 <= x & x <= 2*r}"; 
wneuper@59309
   121
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   122
"interval {x. 0 <= x & x <= 2 * r}"
wneuper@59309
   123
wneuper@59309
   124
> val t = str2term "equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))"; 
wneuper@59309
   125
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   126
"equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x))"
wneuper@59309
   127
> val t = str2term "solveFor x"; 
wneuper@59309
   128
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   129
"solveFor x"
wneuper@59309
   130
> val t = str2term "errorBound (eps=0)"; 
wneuper@59309
   131
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   132
"errorBound (eps = 0)"
wneuper@59309
   133
> val t = str2term "solutions L";
wneuper@59309
   134
> val (d,ts) = split_dts thy t; comp_dts thy (d,ts);
wneuper@59309
   135
"solutions L"
wneuper@59309
   136
wneuper@59309
   137
before 6.5.03:
wneuper@59309
   138
> val t = (Thm.term_of o the o (parse thy)) "testdscforlist [#1]";
wneuper@59309
   139
> val (d,ts) = split_dts t;
wneuper@59309
   140
> comp_dts thy (d,ts);
wneuper@59309
   141
val it = "testdscforlist [#1]" : cterm
wneuper@59309
   142
wneuper@59309
   143
> val t = (Thm.term_of o the o (parse thy)) "(A::real)";
wneuper@59309
   144
> val (d,ts) = split_dts t;
wneuper@59309
   145
val d = Const ("empty","empty") : term
wneuper@59309
   146
val ts = [Free ("A","RealDef.real")] : term list
wneuper@59309
   147
> val t = (Thm.term_of o the o (parse thy)) "[R=(R::real)]";
wneuper@59309
   148
> val (d,ts) = split_dts t;
wneuper@59309
   149
val d = Const ("empty","empty") : term
wneuper@59309
   150
val ts = [Const # $ Free # $ Free (#,#)] : term list
wneuper@59309
   151
> val t = (Thm.term_of o the o (parse thy)) "[#1,#2]";
wneuper@59309
   152
> val (d,ts) = split_dts t;
wneuper@59309
   153
val ts = [Free ("#1","'a"),Free ("#2","'a")] : NOT WANTED
wneuper@59309
   154
*)
wneuper@59309
   155
"----------- type penv -------------------------------------------------------------------------";
wneuper@59309
   156
"----------- type penv -------------------------------------------------------------------------";
wneuper@59309
   157
"----------- type penv -------------------------------------------------------------------------";
wneuper@59309
   158
(*
wneuper@59309
   159
  val e_ = (Thm.term_of o the o (parse thy)) "e_::bool";
wneuper@59309
   160
  val ev = (Thm.term_of o the o (parse thy)) "#4 + #3 * x^^^#2 = #0";
wneuper@59309
   161
  val v_ = (Thm.term_of o the o (parse thy)) "v_";
wneuper@59309
   162
  val vv = (Thm.term_of o the o (parse thy)) "x";
wneuper@59309
   163
  val r_ = (Thm.term_of o the o (parse thy)) "err_::bool";
wneuper@59309
   164
  val rv1 = (Thm.term_of o the o (parse thy)) "#0";
wneuper@59309
   165
  val rv2 = (Thm.term_of o the o (parse thy)) "eps";
wneuper@59309
   166
wneuper@59309
   167
  val penv = [(e_,[ev]),(v_,[vv]),(r_,[rv2,rv2])]:penv;
wneuper@59309
   168
  map getval penv;
wneuper@59309
   169
[(Free ("e_","bool"),
wneuper@59309
   170
  Const (#,#) $ (# $ # $ (# $ #)) $ Free ("#0","RealDef.real")),
wneuper@59309
   171
 (Free ("v_","RealDef.real"),Free ("x","RealDef.real")),
wneuper@59309
   172
 (Free ("err_","bool"),Free ("#0","RealDef.real"))] : (term * term) list      
wneuper@59309
   173
*)
wneuper@59309
   174
"----------- fun untouched ---------------------------------------------------------------------";
wneuper@59309
   175
"----------- fun untouched ---------------------------------------------------------------------";
wneuper@59309
   176
"----------- fun untouched ---------------------------------------------------------------------";
wneuper@59309
   177
(*> untouched [];
wneuper@59309
   178
val it = true : bool
wneuper@59309
   179
> untouched [e_itm];
wneuper@59309
   180
val it = true : bool
wneuper@59309
   181
> untouched [e_itm, (1,[],false,"e_itm",Syn "e_itm")];
wneuper@59309
   182
val it = false : bool*)
wneuper@59309
   183
"----------- fun pbl_ids -----------------------------------------------------------------------";
wneuper@59309
   184
"----------- fun pbl_ids -----------------------------------------------------------------------";
wneuper@59309
   185
"----------- fun pbl_ids -----------------------------------------------------------------------";
wneuper@59309
   186
(*
wneuper@59309
   187
val t as t1 $ t2 = str2term "antiDerivativeName M_b";
wneuper@59309
   188
pbl_ids ctxt t1 t2;
wneuper@59309
   189
wneuper@59309
   190
  val t = (Thm.term_of o the o (parse thy)) "fixedValues [r=Arbfix]";
wneuper@59309
   191
  val (d,argl) = strip_comb t;
wneuper@59309
   192
  is_dsc d;                      (*see split_dts*)
wneuper@59309
   193
  dest_list (d,argl);
wneuper@59309
   194
  val (_ $ v) = t;
wneuper@59309
   195
  is_list v;
wneuper@59309
   196
  pbl_ids ctxt d v;
wneuper@59309
   197
[Const ("List.list.Cons","[bool, bool List.list] => bool List.list") $
wneuper@59309
   198
       (Const # $ Free # $ Const (#,#)) $ Const ("List.list.Nil","bool List..
wneuper@59309
   199
wneuper@59309
   200
  val (dsc,vl) = (split_dts o Thm.term_of o the o (parse thy)) "solveFor x";
wneuper@59595
   201
val dsc = Const ("Input_Descript.solveFor","RealDef.real => Tools.una") : term
wneuper@59309
   202
val vl = Free ("x","RealDef.real") : term 
wneuper@59309
   203
wneuper@59309
   204
  val (dsc,id) = (split_did o Thm.term_of o the o (parse thy)) "solveFor v_";
wneuper@59309
   205
  pbl_ids ctxt dsc vl;
wneuper@59309
   206
val it = [Free ("x","RealDef.real")] : term list
wneuper@59309
   207
   
wneuper@59309
   208
  val (dsc,vl) = (split_dts o Thm.term_of o the o(parse thy))
wneuper@59309
   209
		       "errorBound (eps=#0)";
wneuper@59309
   210
  val (dsc,id) = (split_did o Thm.term_of o the o(parse thy)) "errorBound err_";
wneuper@59309
   211
  pbl_ids ctxt dsc vl;
wneuper@59309
   212
val it = [Free ("#0","RealDef.real"),Free ("eps","RealDef.real")] : term list     *)
wneuper@59309
   213
"----------- fun upd_penv ----------------------------------------------------------------------";
wneuper@59309
   214
"----------- fun upd_penv ----------------------------------------------------------------------";
wneuper@59309
   215
"----------- fun upd_penv ----------------------------------------------------------------------";
wneuper@59309
   216
(* 
wneuper@59309
   217
  val penv = [];
wneuper@59309
   218
  val (dsc,vl) = (split_did o Thm.term_of o the o (parse thy)) "solveFor x";
wneuper@59309
   219
  val (dsc,id) = (split_did o Thm.term_of o the o (parse thy)) "solveFor v_";
wneuper@59309
   220
  val penv = upd_penv thy penv dsc (id, vl);
wneuper@59309
   221
[(Free ("v_","RealDef.real"),
wneuper@59309
   222
  [Const (#,#) $ Free (#,#) $ Free ("#0","RealDef.real")])]
wneuper@59309
   223
: (term * term list) list                                                     
wneuper@59309
   224
wneuper@59309
   225
  val (dsc,vl) = (split_did o Thm.term_of o the o(parse thy))"errorBound (eps=#0)";
wneuper@59309
   226
  val (dsc,id) = (split_did o Thm.term_of o the o(parse thy))"errorBound err_";
wneuper@59309
   227
  upd_penv thy penv dsc (id, vl);
wneuper@59309
   228
[(Free ("v_","RealDef.real"),
wneuper@59309
   229
  [Const (#,#) $ Free (#,#) $ Free ("#0","RealDef.real")]),
wneuper@59309
   230
 (Free ("err_","bool"),
wneuper@59309
   231
  [Free ("#0","RealDef.real"),Free ("eps","RealDef.real")])]
wneuper@59309
   232
: (term * term list) list    ^.........!!!!
wneuper@59309
   233
*)
wneuper@59309
   234
"----------- fun upd ---------------------------------------------------------------------------";
wneuper@59309
   235
"----------- fun upd ---------------------------------------------------------------------------";
wneuper@59309
   236
"----------- fun upd ---------------------------------------------------------------------------";
wneuper@59309
   237
(*
wneuper@59309
   238
  val i = 2;
wneuper@59309
   239
  val envv = [(1,[]:penv),(2,[]:penv),(3,[]:penv)]:envv;
wneuper@59309
   240
  val (dsc,vl) = (split_did o Thm.term_of o the o(parse thy))"boundVariable b";
wneuper@59309
   241
  val (dsc,id) = (split_did o Thm.term_of o the o(parse thy))"boundVariable v_";
wneuper@59309
   242
  upd thy envv dsc (id, vl) i;
wneuper@59309
   243
val it = (2,[(Free ("v_","RealDef.real"),[Free ("b","RealDef.real")])])
wneuper@59309
   244
  : int * (term * term list) list*)
wneuper@59309
   245
"----------- fun upds_envv ---------------------------------------------------------------------";
wneuper@59309
   246
"----------- fun upds_envv ---------------------------------------------------------------------";
wneuper@59309
   247
"----------- fun upds_envv ---------------------------------------------------------------------";
wneuper@59309
   248
(* eval test-maximum.sml until Specify_Method ...
wneuper@59309
   249
  val PblObj{probl=(_,pbl),origin=(_,(_,_,mI),_),...} = get_obj I pt [];
wneuper@59309
   250
  val met = (#ppc o get_met) mI;
wneuper@59309
   251
wneuper@59309
   252
  val envv = [];
wneuper@59309
   253
  val eargs = flat eargs;
wneuper@59309
   254
  val (vs, dsc, id, vl) = hd eargs;
wneuper@59309
   255
  val envv = upds_envv thy envv [(vs, dsc, id, vl)];
wneuper@59309
   256
wneuper@59309
   257
  val (vs, dsc, id, vl) = hd (tl eargs);
wneuper@59309
   258
  val envv = upds_envv thy envv [(vs, dsc, id, vl)];
wneuper@59309
   259
wneuper@59309
   260
  val (vs, dsc, id, vl) = hd (tl (tl eargs));
wneuper@59309
   261
  val envv = upds_envv thy envv [(vs, dsc, id, vl)];
wneuper@59309
   262
wneuper@59309
   263
  val (vs, dsc, id, vl) = hd (tl (tl (tl eargs)));
wneuper@59309
   264
  val envv = upds_envv thy envv [(vs, dsc, id, vl)];
wneuper@59309
   265
[(1,
wneuper@59309
   266
  [(Free ("fix_","bool List.list"),[Const (#,#),Free (#,#)]),
wneuper@59309
   267
   (Free ("m_","bool"),[Free (#,#)]),
wneuper@59309
   268
   (Free ("vs_","bool List.list"),[# $ # $ Const #]),
wneuper@59309
   269
   (Free ("rs_","bool List.list"),[# $ # $ (# $ #)])]),
wneuper@59309
   270
 (2,
wneuper@59309
   271
  [(Free ("fix_","bool List.list"),[Const (#,#),Free (#,#)]),
wneuper@59309
   272
   (Free ("m_","bool"),[Free (#,#)]),
wneuper@59309
   273
   (Free ("vs_","bool List.list"),[# $ # $ Const #]),
wneuper@59309
   274
   (Free ("rs_","bool List.list"),[# $ # $ (# $ #)])]),
wneuper@59309
   275
 (3,
wneuper@59309
   276
  [(Free ("fix_","bool List.list"),[Const (#,#),Free (#,#)]),
wneuper@59309
   277
   (Free ("m_","bool"),[Free (#,#)]),
wneuper@59309
   278
   (Free ("vs_","bool List.list"),[# $ # $ Const #])])] : envv *)
wneuper@59515
   279
wneuper@59515
   280
"----------- fun common_subthy -----------------------------------------------------------------";
wneuper@59515
   281
"----------- fun common_subthy -----------------------------------------------------------------";
wneuper@59515
   282
"----------- fun common_subthy -----------------------------------------------------------------";
wneuper@59515
   283
val (thy1, thy2) = (@{theory Partial_Fractions}, @{theory Inverse_Z_Transform});
wneuper@59515
   284
if Context.theory_name (common_subthy (thy1, thy2)) = "Inverse_Z_Transform"
wneuper@59515
   285
then () else error "common_subthy 1";
wneuper@59515
   286
wneuper@59515
   287
val (thy1, thy2) = (@{theory Inverse_Z_Transform}, @{theory Partial_Fractions});(* Isac.Inverse_Z_Transform *)
wneuper@59515
   288
if Context.theory_name (common_subthy (thy1, thy2)) = "Inverse_Z_Transform"
wneuper@59515
   289
then () else error "common_subthy 2";
wneuper@59515
   290
wneuper@59515
   291
val (thy1, thy2) = (@{theory Partial_Fractions}, @{theory PolyEq});
wneuper@59592
   292
if Context.theory_name (common_subthy (thy1, thy2)) = "Isac_Knowledge" then () else error "common_subthy 3";
wneuper@59515
   293
wneuper@59592
   294
val (thy1, thy2) = (@{theory Partial_Fractions}, @{theory Isac_Knowledge});
wneuper@59592
   295
if Context.theory_name (common_subthy (thy1, thy2)) = "Isac_Knowledge" then () else error "common_subthy 4";
wneuper@59515
   296
wneuper@59515
   297
val (thy1, thy2) = (@{theory PolyEq}, @{theory Partial_Fractions});
wneuper@59592
   298
if Context.theory_name (common_subthy (thy1, thy2)) = "Isac_Knowledge" then () else error "common_subthy 5";
wneuper@59515
   299
wneuper@59592
   300
val (thy1, thy2) = (@{theory Isac_Knowledge}, @{theory Partial_Fractions});
wneuper@59592
   301
if Context.theory_name (common_subthy (thy1, thy2)) = "Isac_Knowledge" then () else error "common_subthy 6";