1.1 --- a/src/Tools/isac/FE-interface/interface.sml Wed Aug 18 13:53:15 2010 +0200
1.2 +++ b/src/Tools/isac/FE-interface/interface.sml Wed Aug 18 13:55:23 2010 +0200
1.3 @@ -262,10 +262,10 @@
1.4 (let val ((pt,_),_) = get_calc cI
1.5 val (form, tac, asms) = pt_extract (pt, p)
1.6 in case tac of
1.7 -(* val Some ta = tac;
1.8 +(* val SOME ta = tac;
1.9 *)
1.10 - Some ta => gettacticOK2xml cI ta
1.11 - | None => gettacticERROR2xml cI ("no tactic at position "^pos'2str p)
1.12 + SOME ta => gettacticOK2xml cI ta
1.13 + | NONE => gettacticERROR2xml cI ("no tactic at position "^pos'2str p)
1.14 end)
1.15 handle _ => sysERROR2xml cI "syserror in getTactic";
1.16
2.1 --- a/src/Tools/isac/FE-interface/states.sml Wed Aug 18 13:53:15 2010 +0200
2.2 +++ b/src/Tools/isac/FE-interface/states.sml Wed Aug 18 13:55:23 2010 +0200
2.3 @@ -167,8 +167,8 @@
2.4
2.5 (* add users *)
2.6 fun new_key u n = case assoc (u, n) of
2.7 - None => n
2.8 -| Some _ => new_key u (n+1);
2.9 + NONE => n
2.10 +| SOME _ => new_key u (n+1);
2.11 (*///10.10
2.12 fun get_calcID (u:(calcID * (calcstate * (iterID * pos') list)) list) =
2.13 (new_key u 1):calcID;*)
2.14 @@ -183,9 +183,9 @@
2.15 (*///7.10.03/// add states to a users active states
2.16 fun get_calcID (uI:iterID) (p:(iterID * (calcID * state) list) list) =
2.17 case assoc (p, uI) of
2.18 - None => raise error ("get_calcID: no iterID " ^
2.19 + NONE => raise error ("get_calcID: no iterID " ^
2.20 (string_of_int uI))
2.21 - | Some ps => (new_key ps 1):calcID;
2.22 + | SOME ps => (new_key ps 1):calcID;
2.23 > get_calcID 1 (!states);
2.24 val it = 1 : calcID
2.25 *)
2.26 @@ -193,8 +193,8 @@
2.27 fun get_iterID (cI:calcID)
2.28 (p:(calcID * (calcstate * (iterID * pos') list)) list) =
2.29 case assoc (p, cI) of
2.30 - None => raise error ("get_iterID: no iterID " ^ (string_of_int cI))
2.31 - | Some (_, us) => (new_key us 1):iterID;
2.32 + NONE => raise error ("get_iterID: no iterID " ^ (string_of_int cI))
2.33 + | SOME (_, us) => (new_key us 1):iterID;
2.34 (* get_iterID 3 (!states);
2.35 val it = 2 : iterID*)
2.36
2.37 @@ -216,17 +216,17 @@
2.38 *)
2.39 fun get_calc (cI:calcID) =
2.40 case assoc (!states, cI) of
2.41 - None => raise error ("get_calc "^(string_of_int cI)^" not existent")
2.42 - | Some (c, _) => c;
2.43 + NONE => raise error ("get_calc "^(string_of_int cI)^" not existent")
2.44 + | SOME (c, _) => c;
2.45 fun get_pos (cI:calcID) (uI:iterID) =
2.46 case assoc (!states, cI) of
2.47 - None => raise error ("get_pos: calc " ^ (string_of_int cI)
2.48 + NONE => raise error ("get_pos: calc " ^ (string_of_int cI)
2.49 ^ " not existent")
2.50 - | Some (_, us) =>
2.51 + | SOME (_, us) =>
2.52 (case assoc (us, uI) of
2.53 - None => raise error ("get_pos: user " ^ (string_of_int uI)
2.54 + NONE => raise error ("get_pos: user " ^ (string_of_int uI)
2.55 ^ " not existent")
2.56 - | Some p => p);
2.57 + | SOME p => p);
2.58
2.59
2.60 fun del_assoc ([],_) = []
2.61 @@ -258,8 +258,8 @@
2.62 *)
2.63 fun del_assoc2 (cI:calcID) (uI:iterID) ps =
2.64 case assoc (ps, cI) of
2.65 - None => ps
2.66 - | Some (cs, us) =>
2.67 + NONE => ps
2.68 + | SOME (cs, us) =>
2.69 overwrite (ps, (cI, (cs, del_assoc (us, uI))));
2.70 (*
2.71 > del_assoc2 4 1 (!states);
2.72 @@ -276,23 +276,23 @@
2.73 end;*)
2.74 fun overwrite2 (ps, (((cI:calcID), (uI:iterID)), p)) =
2.75 case assoc (ps, cI) of
2.76 - None =>
2.77 + NONE =>
2.78 raise error ("overwrite2: calc " ^ (string_of_int uI) ^" not existent")
2.79 - | Some (cs, us) =>
2.80 + | SOME (cs, us) =>
2.81 overwrite (ps, (cI ,(cs, overwrite (us, (uI, p)))));
2.82
2.83 fun upd_calc (cI:calcID) cs =
2.84 case assoc (!states, cI) of
2.85 - None => raise error ("upd_calc "^(string_of_int cI)^" not existent")
2.86 - | Some (_, us) => states:= overwrite (!states, (cI, (cs, us)));
2.87 + NONE => raise error ("upd_calc "^(string_of_int cI)^" not existent")
2.88 + | SOME (_, us) => states:= overwrite (!states, (cI, (cs, us)));
2.89 (*WN051210 testing before initac: only 1 taci in calcstate so far:
2.90 fun upd_calc (cI:calcID) (cs as (_, tacis):calcstate) =
2.91 (if length tacis > 1
2.92 then raise error ("upd_calc, |tacis|>1: "^tacis2str tacis)
2.93 else ();
2.94 case assoc (!states, cI) of
2.95 - None => raise error ("upd_calc "^(string_of_int cI)^" not existent")
2.96 - | Some (_, us) => states:= overwrite (!states, (cI, (cs, us)))
2.97 + NONE => raise error ("upd_calc "^(string_of_int cI)^" not existent")
2.98 + | SOME (_, us) => states:= overwrite (!states, (cI, (cs, us)))
2.99 );*)
2.100
2.101
2.102 @@ -303,9 +303,9 @@
2.103 overwrite2 ((!states), ((uI, pI), (p, (ptp, tacis)))) end;*)
2.104 fun upd_tacis (cI:calcID) tacis =
2.105 case assoc (!states, cI) of
2.106 - None =>
2.107 + NONE =>
2.108 raise error ("upd_tacis: calctree "^(string_of_int cI)^" not existent")
2.109 - | Some ((ptp,_), us) =>
2.110 + | SOME ((ptp,_), us) =>
2.111 states:= overwrite (!states, (cI, ((ptp, tacis), us)));
2.112 (*///7.10.
2.113 fun upd_ipos (uI:iterID) (pI:calcID) (ip:pos') =
2.114 @@ -313,9 +313,9 @@
2.115 in states:= overwrite2 ((!states), ((uI, pI), (ip, calc))) end;*)
2.116 fun upd_ipos (cI:calcID) (uI:iterID) (ip:pos') =
2.117 case assoc (!states, cI) of
2.118 - None =>
2.119 + NONE =>
2.120 raise error ("upd_ipos: calctree "^(string_of_int cI)^" not existent")
2.121 - | Some (cs, us) =>
2.122 + | SOME (cs, us) =>
2.123 states:= overwrite2 (!states, ((cI, uI), ip));
2.124
2.125
2.126 @@ -336,9 +336,9 @@
2.127 > !states;
2.128 val it = [(3,[(#,#),(#,#),(#,#)]),(4,[(#,#),(#,#)]),(1,[(#,#)])] : states
2.129 > assoc2 (!states, (3, 1));
2.130 -val it = Some EmptyPtree : ptree option
2.131 +val it = SOME EmptyPtree : ptree option
2.132 > assoc2 (!states, (3, 2));
2.133 -val it = None : ptree option
2.134 +val it = NONE : ptree option
2.135 *)
2.136 (*///7.10
2.137 fun add_calc (uI:iterID) (s:state) =
2.138 @@ -347,9 +347,9 @@
2.139 new_calcID end; *)
2.140 fun add_user (cI:calcID) =
2.141 case assoc (!states, cI) of
2.142 - None =>
2.143 + NONE =>
2.144 raise error ("add_user: calctree "^(string_of_int cI)^" not existent")
2.145 - | Some (cs, us) =>
2.146 + | SOME (cs, us) =>
2.147 let val new_uI = new_key us 1
2.148 in states:= overwrite2 (!states, ((cI, new_uI), e_pos'));
2.149 new_uI:iterID end;
3.1 --- a/src/Tools/isac/IsacKnowledge/AlgEin.ML Wed Aug 18 13:53:15 2010 +0200
3.2 +++ b/src/Tools/isac/IsacKnowledge/AlgEin.ML Wed Aug 18 13:55:23 2010 +0200
3.3 @@ -18,7 +18,7 @@
3.4
3.5 store_pbt
3.6 (prep_pbt AlgEin.thy "pbl_algein" [] e_pblID
3.7 - (["Berechnung"], [], e_rls, None,
3.8 + (["Berechnung"], [], e_rls, NONE,
3.9 []));
3.10 (* WN070405
3.11 store_pbt
3.12 @@ -28,7 +28,7 @@
3.13 ("#Find" ,["GesamtLaenge l_"])
3.14 ],
3.15 append_rls "e_rls" e_rls [],
3.16 - None,
3.17 + NONE,
3.18 []));
3.19 *)
3.20 store_pbt
3.21 @@ -39,7 +39,7 @@
3.22 ("#Find" ,["GesamtLaenge l_"])
3.23 ],
3.24 e_rls,
3.25 - None,
3.26 + NONE,
3.27 [["Berechnung","erstNumerisch"],["Berechnung","erstSymbolisch"]]));
3.28
3.29 (* show_ptyps();
4.1 --- a/src/Tools/isac/IsacKnowledge/Atools.ML Wed Aug 18 13:53:15 2010 +0200
4.2 +++ b/src/Tools/isac/IsacKnowledge/Atools.ML Wed Aug 18 13:55:23 2010 +0200
4.3 @@ -71,11 +71,11 @@
4.4 ((*writeln("@@@ eval_occurs_in: v= "^(term2str v));
4.5 writeln("@@@ eval_occurs_in: t= "^(term2str t));*)
4.6 if occurs_in v t
4.7 - then Some ((term2str p) ^ " = True",
4.8 + then SOME ((term2str p) ^ " = True",
4.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
4.10 - else Some ((term2str p) ^ " = False",
4.11 + else SOME ((term2str p) ^ " = False",
4.12 Trueprop $ (mk_equality (p, HOLogic.false_const))))
4.13 - | eval_occurs_in _ _ _ _ = None;
4.14 + | eval_occurs_in _ _ _ _ = NONE;
4.15
4.16 (*some of the (bound) variables (eg. in an eqsys) "vs" occur in term "t"*)
4.17 fun some_occur_in vs t =
4.18 @@ -88,11 +88,11 @@
4.19 (p as (Const ("Atools.some'_occur'_in",_)
4.20 $ vs $ t)) _ =
4.21 if some_occur_in (isalist2list vs) t
4.22 - then Some ((term2str p) ^ " = True",
4.23 + then SOME ((term2str p) ^ " = True",
4.24 Trueprop $ (mk_equality (p, HOLogic.true_const)))
4.25 - else Some ((term2str p) ^ " = False",
4.26 + else SOME ((term2str p) ^ " = False",
4.27 Trueprop $ (mk_equality (p, HOLogic.false_const)))
4.28 - | eval_some_occur_in _ _ _ _ = None;
4.29 + | eval_some_occur_in _ _ _ _ = NONE;
4.30
4.31
4.32
4.33 @@ -102,11 +102,11 @@
4.34 fun eval_is_atom (thmid:string) "Atools.is'_atom"
4.35 (t as (Const(op0,_) $ arg)) thy =
4.36 (case arg of
4.37 - Free (n,_) => Some (mk_thmid thmid op0 n "",
4.38 + Free (n,_) => SOME (mk_thmid thmid op0 n "",
4.39 Trueprop $ (mk_equality (t, true_as_term)))
4.40 - | _ => Some (mk_thmid thmid op0 "" "",
4.41 + | _ => SOME (mk_thmid thmid op0 "" "",
4.42 Trueprop $ (mk_equality (t, false_as_term))))
4.43 - | eval_is_atom _ _ _ _ = None;
4.44 + | eval_is_atom _ _ _ _ = NONE;
4.45
4.46 (*evaluate 'is_even'*)
4.47 fun even i = (i div 2) * 2 = i;
4.48 @@ -116,14 +116,14 @@
4.49 (case arg of
4.50 Free (n,_) =>
4.51 (case int_of_str n of
4.52 - Some i =>
4.53 - if even i then Some (mk_thmid thmid op0 n "",
4.54 + SOME i =>
4.55 + if even i then SOME (mk_thmid thmid op0 n "",
4.56 Trueprop $ (mk_equality (t, true_as_term)))
4.57 - else Some (mk_thmid thmid op0 "" "",
4.58 + else SOME (mk_thmid thmid op0 "" "",
4.59 Trueprop $ (mk_equality (t, false_as_term)))
4.60 - | _ => None)
4.61 - | _ => None)
4.62 - | eval_is_even _ _ _ _ = None;
4.63 + | _ => NONE)
4.64 + | _ => NONE)
4.65 + | eval_is_even _ _ _ _ = NONE;
4.66
4.67 (*evaluate 'is_const'*)
4.68 (*("is_const",("Atools.is'_const",eval_const "#is_const_"))*)
4.69 @@ -132,21 +132,21 @@
4.70 (*eval_const FIXXXXXME.WN.16.5.03 still forgets ComplexI*)
4.71 (case arg of
4.72 Const (n1,_) =>
4.73 - Some (mk_thmid thmid op0 n1 "",
4.74 + SOME (mk_thmid thmid op0 n1 "",
4.75 Trueprop $ (mk_equality (t, false_as_term)))
4.76 | Free (n1,_) =>
4.77 if is_numeral n1
4.78 - then Some (mk_thmid thmid op0 n1 "",
4.79 + then SOME (mk_thmid thmid op0 n1 "",
4.80 Trueprop $ (mk_equality (t, true_as_term)))
4.81 - else Some (mk_thmid thmid op0 n1 "",
4.82 + else SOME (mk_thmid thmid op0 n1 "",
4.83 Trueprop $ (mk_equality (t, false_as_term)))
4.84 | Const ("Float.Float",_) =>
4.85 - Some (mk_thmid thmid op0 (term2str arg) "",
4.86 + SOME (mk_thmid thmid op0 (term2str arg) "",
4.87 Trueprop $ (mk_equality (t, true_as_term)))
4.88 - | _ => (*None*)
4.89 - Some (mk_thmid thmid op0 (term2str arg) "",
4.90 + | _ => (*NONE*)
4.91 + SOME (mk_thmid thmid op0 (term2str arg) "",
4.92 Trueprop $ (mk_equality (t, false_as_term))))
4.93 - | eval_const _ _ _ _ = None;
4.94 + | eval_const _ _ _ _ = NONE;
4.95
4.96 (*. evaluate binary, associative, commutative operators: *,+,^ .*)
4.97 (*("PLUS" ,("op +" ,eval_binop "#add_")),
4.98 @@ -166,17 +166,17 @@
4.99 (*.convert int and float to internal floatingpoint prepresentation.*)
4.100 fun numeral (Free (str, T)) =
4.101 (case int_of_str str of
4.102 - Some i => Some ((i, 0), (0, 0))
4.103 - | None => None)
4.104 + SOME i => SOME ((i, 0), (0, 0))
4.105 + | NONE => NONE)
4.106 | numeral (Const ("Float.Float", _) $
4.107 (Const ("Pair", _) $
4.108 (Const ("Pair", T) $ Free (v1, _) $ Free (v2,_)) $
4.109 (Const ("Pair", _) $ Free (p1, _) $ Free (p2,_))))=
4.110 (case (int_of_str v1, int_of_str v2, int_of_str p1, int_of_str p2) of
4.111 - (Some v1', Some v2', Some p1', Some p2') =>
4.112 - Some ((v1', v2'), (p1', p2'))
4.113 - | _ => None)
4.114 - | numeral _ = None;
4.115 + (SOME v1', SOME v2', SOME p1', SOME p2') =>
4.116 + SOME ((v1', v2'), (p1', p2'))
4.117 + | _ => NONE)
4.118 + | numeral _ = NONE;
4.119
4.120 (*.evaluate binary associative operations.*)
4.121 fun eval_binop (thmid:string) (op_:string)
4.122 @@ -185,15 +185,15 @@
4.123 thy = (*binary . (v.n1).n2*)
4.124 if op0 = op0' then
4.125 case (numeral t1, numeral t2) of
4.126 - (Some n1, Some n2) =>
4.127 + (SOME n1, SOME n2) =>
4.128 let val (T1,T2,Trange) = dest_binop_typ t0
4.129 val res = calc (if op0 = "op -" then "op +" else op0) n1 n2
4.130 (*WN071229 "HOL.divide" never tried*)
4.131 val rhs = var_op_float v op_ t0 T1 res
4.132 val prop = Trueprop $ (mk_equality (t, rhs))
4.133 - in Some (mk_thmid_f thmid n1 n2, prop) end
4.134 - | _ => None
4.135 - else None
4.136 + in SOME (mk_thmid_f thmid n1 n2, prop) end
4.137 + | _ => NONE
4.138 + else NONE
4.139 | eval_binop (thmid:string) (op_:string)
4.140 (t as
4.141 (Const (op0, t0) $ t1 $
4.142 @@ -201,33 +201,33 @@
4.143 thy = (*binary . n1.(n2.v)*)
4.144 if op0 = op0' then
4.145 case (numeral t1, numeral t2) of
4.146 - (Some n1, Some n2) =>
4.147 - if op0 = "op -" then None else
4.148 + (SOME n1, SOME n2) =>
4.149 + if op0 = "op -" then NONE else
4.150 let val (T1,T2,Trange) = dest_binop_typ t0
4.151 val res = calc op0 n1 n2
4.152 val rhs = float_op_var v op_ t0 T1 res
4.153 val prop = Trueprop $ (mk_equality (t, rhs))
4.154 - in Some (mk_thmid_f thmid n1 n2, prop) end
4.155 - | _ => None
4.156 - else None
4.157 + in SOME (mk_thmid_f thmid n1 n2, prop) end
4.158 + | _ => NONE
4.159 + else NONE
4.160
4.161 | eval_binop (thmid:string) (op_:string)
4.162 (t as (Const (op0,t0) $ t1 $ t2)) thy = (*binary . n1.n2*)
4.163 (case (numeral t1, numeral t2) of
4.164 - (Some n1, Some n2) =>
4.165 + (SOME n1, SOME n2) =>
4.166 let val (T1,T2,Trange) = dest_binop_typ t0;
4.167 val res = calc op0 n1 n2;
4.168 val rhs = term_of_float Trange res;
4.169 val prop = Trueprop $ (mk_equality (t, rhs));
4.170 - in Some (mk_thmid_f thmid n1 n2, prop) end
4.171 - | _ => None)
4.172 - | eval_binop _ _ _ _ = None;
4.173 + in SOME (mk_thmid_f thmid n1 n2, prop) end
4.174 + | _ => NONE)
4.175 + | eval_binop _ _ _ _ = NONE;
4.176 (*
4.177 -> val Some (thmid, t) = eval_binop "#add_" "op +" (str2term "-1 + 2") thy;
4.178 +> val SOME (thmid, t) = eval_binop "#add_" "op +" (str2term "-1 + 2") thy;
4.179 > term2str t;
4.180 val it = "-1 + 2 = 1"
4.181 > val t = str2term "-1 * (-1 * a)";
4.182 -> val Some (thmid, t) = eval_binop "#mult_" "op *" t thy;
4.183 +> val SOME (thmid, t) = eval_binop "#mult_" "op *" t thy;
4.184 > term2str t;
4.185 val it = "-1 * (-1 * a) = 1 * a"*)
4.186
4.187 @@ -239,28 +239,28 @@
4.188 fun eval_equ (thmid:string) (op_:string) (t as
4.189 (Const (op0,t0) $ Free (n1,t1) $ Free(n2,t2))) thy =
4.190 (case (int_of_str n1, int_of_str n2) of
4.191 - (Some n1', Some n2') =>
4.192 + (SOME n1', SOME n2') =>
4.193 if calc_equ (strip_thy op0) (n1', n2')
4.194 - then Some (mk_thmid thmid op0 n1 n2,
4.195 + then SOME (mk_thmid thmid op0 n1 n2,
4.196 Trueprop $ (mk_equality (t, true_as_term)))
4.197 - else Some (mk_thmid thmid op0 n1 n2,
4.198 + else SOME (mk_thmid thmid op0 n1 n2,
4.199 Trueprop $ (mk_equality (t, false_as_term)))
4.200 - | _ => None)
4.201 + | _ => NONE)
4.202
4.203 - | eval_equ _ _ _ _ = None;
4.204 + | eval_equ _ _ _ _ = NONE;
4.205
4.206
4.207 (*evaluate identity
4.208 > reflI;
4.209 val it = "(?t = ?t) = True"
4.210 > val t = str2term "x = 0";
4.211 -> val None = rewrite_ thy dummy_ord e_rls false reflI t;
4.212 +> val NONE = rewrite_ thy dummy_ord e_rls false reflI t;
4.213
4.214 > val t = str2term "1 = 0";
4.215 -> val None = rewrite_ thy dummy_ord e_rls false reflI t;
4.216 +> val NONE = rewrite_ thy dummy_ord e_rls false reflI t;
4.217 ----------- thus needs Calc !
4.218 > val t = str2term "0 = 0";
4.219 -> val Some (t',_) = rewrite_ thy dummy_ord e_rls false reflI t;
4.220 +> val SOME (t',_) = rewrite_ thy dummy_ord e_rls false reflI t;
4.221 > term2str t';
4.222 val it = "True"
4.223
4.224 @@ -279,28 +279,28 @@
4.225 fun eval_ident (thmid:string) "Atools.ident" (t as
4.226 (Const (op0,t0) $ t1 $ t2 )) thy =
4.227 if t1 = t2
4.228 - then Some (mk_thmid thmid op0
4.229 + then SOME (mk_thmid thmid op0
4.230 ("("^(Sign.string_of_term (sign_of thy) t1)^")")
4.231 ("("^(Sign.string_of_term (sign_of thy) t2)^")"),
4.232 Trueprop $ (mk_equality (t, true_as_term)))
4.233 - else Some (mk_thmid thmid op0
4.234 + else SOME (mk_thmid thmid op0
4.235 ("("^(Sign.string_of_term (sign_of thy) t1)^")")
4.236 ("("^(Sign.string_of_term (sign_of thy) t2)^")"),
4.237 Trueprop $ (mk_equality (t, false_as_term)))
4.238 - | eval_ident _ _ _ _ = None;
4.239 + | eval_ident _ _ _ _ = NONE;
4.240 (* TODO
4.241 > val t = str2term "x =!= 0";
4.242 -> val Some (str, t') = eval_ident "ident_" "b" t thy;
4.243 +> val SOME (str, t') = eval_ident "ident_" "b" t thy;
4.244 > term2str t';
4.245 val str = "ident_(x)_(0)" : string
4.246 val it = "(x =!= 0) = False" : string
4.247 > val t = str2term "1 =!= 0";
4.248 -> val Some (str, t') = eval_ident "ident_" "b" t thy;
4.249 +> val SOME (str, t') = eval_ident "ident_" "b" t thy;
4.250 > term2str t';
4.251 val str = "ident_(1)_(0)" : string
4.252 val it = "(1 =!= 0) = False" : string
4.253 > val t = str2term "0 =!= 0";
4.254 -> val Some (str, t') = eval_ident "ident_" "b" t thy;
4.255 +> val SOME (str, t') = eval_ident "ident_" "b" t thy;
4.256 > term2str t';
4.257 val str = "ident_(0)_(0)" : string
4.258 val it = "(0 =!= 0) = True" : string
4.259 @@ -313,7 +313,7 @@
4.260 (Const (op0,t0) $ t1 $ t2 )) thy =
4.261 if t1 = t2
4.262 then ((*writeln"... eval_equal: t1 = t2 --> True";*)
4.263 - Some (mk_thmid thmid op0
4.264 + SOME (mk_thmid thmid op0
4.265 ("("^(Sign.string_of_term (sign_of thy) t1)^")")
4.266 ("("^(Sign.string_of_term (sign_of thy) t2)^")"),
4.267 Trueprop $ (mk_equality (t, true_as_term)))
4.268 @@ -321,34 +321,34 @@
4.269 else (case (is_atom t1, is_atom t2) of
4.270 (true, true) =>
4.271 ((*writeln"... eval_equal: t1<>t2, is_atom t1,t2 --> False";*)
4.272 - Some (mk_thmid thmid op0
4.273 + SOME (mk_thmid thmid op0
4.274 ("("^(term2str t1)^")") ("("^(term2str t2)^")"),
4.275 Trueprop $ (mk_equality (t, false_as_term)))
4.276 )
4.277 | _ => ((*writeln"... eval_equal: t1<>t2, NOT is_atom t1,t2 --> go-on";*)
4.278 - None))
4.279 + NONE))
4.280 | eval_equal _ _ _ _ = (writeln"... eval_equal: error-exit";
4.281 - None);
4.282 + NONE);
4.283 (*
4.284 val t = str2term "x ~= 0";
4.285 -val None = eval_equal "equal_" "b" t thy;
4.286 +val NONE = eval_equal "equal_" "b" t thy;
4.287
4.288
4.289 > val t = str2term "(x + 1) = (x + 1)";
4.290 -> val Some (str, t') = eval_equal "equal_" "b" t thy;
4.291 +> val SOME (str, t') = eval_equal "equal_" "b" t thy;
4.292 > term2str t';
4.293 val str = "equal_(x + 1)_(x + 1)" : string
4.294 val it = "(x + 1 = x + 1) = True" : string
4.295 > val t = str2term "x = 0";
4.296 -> val None = eval_equal "equal_" "b" t thy;
4.297 +> val NONE = eval_equal "equal_" "b" t thy;
4.298
4.299 > val t = str2term "1 = 0";
4.300 -> val Some (str, t') = eval_equal "equal_" "b" t thy;
4.301 +> val SOME (str, t') = eval_equal "equal_" "b" t thy;
4.302 > term2str t';
4.303 val str = "equal_(1)_(0)" : string
4.304 val it = "(1 = 0) = False" : string
4.305 > val t = str2term "0 = 0";
4.306 -> val Some (str, t') = eval_equal "equal_" "b" t thy;
4.307 +> val SOME (str, t') = eval_equal "equal_" "b" t thy;
4.308 > term2str t';
4.309 val str = "equal_(0)_(0)" : string
4.310 val it = "(0 = 0) = True" : string
4.311 @@ -362,7 +362,7 @@
4.312 fun eval_cancel (thmid:string) "HOL.divide" (t as
4.313 (Const (op0,t0) $ Free (n1,t1) $ Free(n2,t2))) thy =
4.314 (case (int_of_str n1, int_of_str n2) of
4.315 - (Some n1', Some n2') =>
4.316 + (SOME n1', SOME n2') =>
4.317 let
4.318 val sg = sign2 n1' n2';
4.319 val (T1,T2,Trange) = dest_binop_typ t0;
4.320 @@ -370,16 +370,16 @@
4.321 in if gcd' = abs n2'
4.322 then let val rhs = term_of_num Trange (sg * (abs n1') div gcd')
4.323 val prop = Trueprop $ (mk_equality (t, rhs))
4.324 - in Some (mk_thmid thmid op0 n1 n2, prop) end
4.325 - else if 0 < n2' andalso gcd' = 1 then None
4.326 + in SOME (mk_thmid thmid op0 n1 n2, prop) end
4.327 + else if 0 < n2' andalso gcd' = 1 then NONE
4.328 else let val rhs = num_op_num T1 T2 (op0,t0) (sg * (abs n1') div gcd')
4.329 ((abs n2') div gcd')
4.330 val prop = Trueprop $ (mk_equality (t, rhs))
4.331 - in Some (mk_thmid thmid op0 n1 n2, prop) end
4.332 + in SOME (mk_thmid thmid op0 n1 n2, prop) end
4.333 end
4.334 - | _ => ((*writeln"@@@ eval_cancel None";*)None))
4.335 + | _ => ((*writeln"@@@ eval_cancel NONE";*)NONE))
4.336
4.337 - | eval_cancel _ _ _ _ = None;
4.338 + | eval_cancel _ _ _ _ = NONE;
4.339
4.340 (*. get the argument from a function-definition.*)
4.341 (*("argument_in" ,("Atools.argument'_in",
4.342 @@ -387,10 +387,10 @@
4.343 fun eval_argument_in _ "Atools.argument'_in"
4.344 (t as (Const ("Atools.argument'_in", _) $ (f $ arg))) _ =
4.345 if is_Free arg (*could be something to be simplified before*)
4.346 - then Some (term2str t ^ " = " ^ term2str arg,
4.347 + then SOME (term2str t ^ " = " ^ term2str arg,
4.348 Trueprop $ (mk_equality (t, arg)))
4.349 - else None
4.350 - | eval_argument_in _ _ _ _ = None;
4.351 + else NONE
4.352 + | eval_argument_in _ _ _ _ = NONE;
4.353
4.354 (*.check if the function-identifier of the first argument matches
4.355 the function-identifier of the lhs of the second argument.*)
4.356 @@ -401,11 +401,11 @@
4.357 (f1 $ _) $
4.358 (Const ("op =", _) $ (f2 $ _) $ _)) _ =
4.359 if f1 = f2
4.360 - then Some ((term2str p) ^ " = True",
4.361 + then SOME ((term2str p) ^ " = True",
4.362 Trueprop $ (mk_equality (p, HOLogic.true_const)))
4.363 - else Some ((term2str p) ^ " = False",
4.364 + else SOME ((term2str p) ^ " = False",
4.365 Trueprop $ (mk_equality (p, HOLogic.false_const)))
4.366 -| eval_sameFunId _ _ _ _ = None;
4.367 +| eval_sameFunId _ _ _ _ = NONE;
4.368
4.369
4.370 (*.from a list of fun-definitions "f x = ..." as 2nd argument
4.371 @@ -422,9 +422,9 @@
4.372 (fid $ _) $ fs) _ =
4.373 let val fs' = ((list2isalist HOLogic.boolT) o
4.374 (filter (same_funid fid))) (isalist2list fs)
4.375 - in Some (term2str (mk_equality (p, fs')),
4.376 + in SOME (term2str (mk_equality (p, fs')),
4.377 Trueprop $ (mk_equality (p, fs'))) end
4.378 -| eval_filter_sameFunId _ _ _ _ = None;
4.379 +| eval_filter_sameFunId _ _ _ _ = NONE;
4.380
4.381
4.382 (*make a list of terms to a sum*)
4.383 @@ -447,10 +447,10 @@
4.384 let val isal = isalist2list l
4.385 val lhss = map lhs isal
4.386 val sum = list2sum lhss
4.387 - in Some ((term2str p) ^ " = " ^ (term2str sum),
4.388 + in SOME ((term2str p) ^ " = " ^ (term2str sum),
4.389 Trueprop $ (mk_equality (p, sum)))
4.390 end
4.391 -| eval_boollist2sum _ _ _ _ = None;
4.392 +| eval_boollist2sum _ _ _ _ = NONE;
4.393
4.394
4.395
5.1 --- a/src/Tools/isac/IsacKnowledge/Biegelinie.ML Wed Aug 18 13:53:15 2010 +0200
5.2 +++ b/src/Tools/isac/IsacKnowledge/Biegelinie.ML Wed Aug 18 13:55:23 2010 +0200
5.3 @@ -49,7 +49,7 @@
5.4 ("#Relate",["Randbedingungen rb_"])
5.5 ],
5.6 append_rls "e_rls" e_rls [],
5.7 - None,
5.8 + NONE,
5.9 [["IntegrierenUndKonstanteBestimmen2"]]));
5.10
5.11 store_pbt
5.12 @@ -61,7 +61,7 @@
5.13 ("#Relate",["RandbedingungenBiegung rb_","RandbedingungenMoment rm_"])
5.14 ],
5.15 append_rls "e_rls" e_rls [],
5.16 - None,
5.17 + NONE,
5.18 [["IntegrierenUndKonstanteBestimmen"]]));
5.19
5.20 store_pbt
5.21 @@ -69,7 +69,7 @@
5.22 (["MomentGegebene","Biegelinien"],
5.23 [],
5.24 append_rls "e_rls" e_rls [],
5.25 - None,
5.26 + NONE,
5.27 [["IntegrierenUndKonstanteBestimmen","2xIntegrieren"]]));
5.28
5.29 store_pbt
5.30 @@ -77,7 +77,7 @@
5.31 (["einfache","Biegelinien"],
5.32 [],
5.33 append_rls "e_rls" e_rls [],
5.34 - None,
5.35 + NONE,
5.36 [["IntegrierenUndKonstanteBestimmen","4x4System"]]));
5.37
5.38 store_pbt
5.39 @@ -85,7 +85,7 @@
5.40 (["QuerkraftUndMomentBestimmte","Biegelinien"],
5.41 [],
5.42 append_rls "e_rls" e_rls [],
5.43 - None,
5.44 + NONE,
5.45 [["IntegrierenUndKonstanteBestimmen","1xIntegrieren"]]));
5.46
5.47 store_pbt
5.48 @@ -94,7 +94,7 @@
5.49 [("#Given" ,["Streckenlast q__","FunktionsVariable v_"]),
5.50 ("#Find" ,["Funktionen funs___"])],
5.51 append_rls "e_rls" e_rls [],
5.52 - None,
5.53 + NONE,
5.54 [["Biegelinien","ausBelastung"]]));
5.55
5.56 store_pbt
5.57 @@ -103,7 +103,7 @@
5.58 [("#Given" ,["Funktionen funs_","Randbedingungen rb_"]),
5.59 ("#Find" ,["Gleichungen equs___"])],
5.60 append_rls "e_rls" e_rls [],
5.61 - None,
5.62 + NONE,
5.63 [["Biegelinien","setzeRandbedingungenEin"]]));
5.64
5.65 store_pbt
5.66 @@ -112,7 +112,7 @@
5.67 [("#Given" ,["functionEq fun_","substitution sub_"]),
5.68 ("#Find" ,["equality equ___"])],
5.69 append_rls "e_rls" e_rls [],
5.70 - None,
5.71 + NONE,
5.72 [["Equation","fromFunction"]]));
5.73
5.74
6.1 --- a/src/Tools/isac/IsacKnowledge/Diff.ML Wed Aug 18 13:53:15 2010 +0200
6.2 +++ b/src/Tools/isac/IsacKnowledge/Diff.ML Wed Aug 18 13:55:23 2010 +0200
6.3 @@ -19,9 +19,9 @@
6.4
6.5 (*("primed", ("Diff.primed", eval_primed "#primed"))*)
6.6 fun eval_primed _ _ (p as (Const ("Diff.primed",_) $ t)) _ =
6.7 - Some ((term2str p) ^ " = " ^ term2str (primed t),
6.8 + SOME ((term2str p) ^ " = " ^ term2str (primed t),
6.9 Trueprop $ (mk_equality (p, primed t)))
6.10 - | eval_primed _ _ _ _ = None;
6.11 + | eval_primed _ _ _ _ = NONE;
6.12
6.13 calclist':= overwritel (!calclist',
6.14 [("primed", ("Diff.primed", eval_primed "#primed"))
6.15 @@ -161,7 +161,7 @@
6.16
6.17 store_pbt
6.18 (prep_pbt Diff.thy "pbl_fun" [] e_pblID
6.19 - (["function"], [], e_rls, None, []));
6.20 + (["function"], [], e_rls, NONE, []));
6.21
6.22 store_pbt
6.23 (prep_pbt Diff.thy "pbl_fun_deriv" [] e_pblID
6.24 @@ -170,7 +170,7 @@
6.25 ("#Find" ,["derivative f_'_"])
6.26 ],
6.27 append_rls "e_rls" e_rls [],
6.28 - Some "Diff (f_, v_)", [["diff","differentiate_on_R"],
6.29 + SOME "Diff (f_, v_)", [["diff","differentiate_on_R"],
6.30 ["diff","after_simplification"]]));
6.31
6.32 (*here "named" is used differently from Integration"*)
6.33 @@ -181,7 +181,7 @@
6.34 ("#Find" ,["derivativeEq f_'_"])
6.35 ],
6.36 append_rls "e_rls" e_rls [],
6.37 - Some "Differentiate (f_, v_)", [["diff","differentiate_equality"]]));
6.38 + SOME "Differentiate (f_, v_)", [["diff","differentiate_equality"]]));
6.39
6.40
6.41 (** methods **)
7.1 --- a/src/Tools/isac/IsacKnowledge/DiffApp-oldpbl.sml Wed Aug 18 13:53:15 2010 +0200
7.2 +++ b/src/Tools/isac/IsacKnowledge/DiffApp-oldpbl.sml Wed Aug 18 13:55:23 2010 +0200
7.3 @@ -329,7 +329,7 @@
7.4 (* pbltyp --- max_of_fun --- *)
7.5 (*
7.6 {given=[],where_=[],find=[],with_=[],relate=[]}: string ppc;
7.7 -val (Some ct) = parse thy ;
7.8 +val (SOME ct) = parse thy ;
7.9 atomty thy (term_of ct);
7.10 *)
7.11
7.12 @@ -364,6 +364,6 @@
7.13
7.14 (*
7.15 {given=[],where_=[],find=[],with_=[],relate=[]}: string ppc;
7.16 -val (Some ct) = parse thy ;
7.17 +val (SOME ct) = parse thy ;
7.18 atomty thy (term_of ct);
7.19 *)
8.1 --- a/src/Tools/isac/IsacKnowledge/DiffApp-scrpbl.sml Wed Aug 18 13:53:15 2010 +0200
8.2 +++ b/src/Tools/isac/IsacKnowledge/DiffApp-scrpbl.sml Wed Aug 18 13:55:23 2010 +0200
8.3 @@ -85,7 +85,7 @@
8.4 "additionalRels ars"]}: string ppc;
8.5 val chkpbl = ((map (the o (parse thy))) o ppc2list) met;
8.6
8.7 -val (Some ct) = parseold thy "EX b. (EX alpha. A = #2*a*b - a^^^#2)";
8.8 +val (SOME ct) = parseold thy "EX b. (EX alpha. A = #2*a*b - a^^^#2)";
8.9
8.10 "pbltyp --- make_fun ---";
8.11 (* subproblem [(hd #relate root, equality),
8.12 @@ -140,7 +140,7 @@
8.13 (* pbltyp --- max_of_fun --- *)
8.14 (*
8.15 {given=[],where_=[],find=[],with_=[],relate=[]}: string ppc;
8.16 -val (Some ct) = parse thy ;
8.17 +val (SOME ct) = parse thy ;
8.18 atomty (term_of ct);
8.19 *)
8.20
9.1 --- a/src/Tools/isac/IsacKnowledge/DiffApp.ML Wed Aug 18 13:53:15 2010 +0200
9.2 +++ b/src/Tools/isac/IsacKnowledge/DiffApp.ML Wed Aug 18 13:55:23 2010 +0200
9.3 @@ -64,7 +64,7 @@
9.4 ("#Find" ,["maximum m_","valuesFor vs_"]),
9.5 ("#Relate",["relations rs_"])
9.6 ],
9.7 - e_rls, None, []));
9.8 + e_rls, NONE, []));
9.9
9.10 store_pbt
9.11 (prep_pbt DiffApp.thy "pbl_fun_make" [] e_pblID
9.12 @@ -72,14 +72,14 @@
9.13 [("#Given" ,["functionOf f_","boundVariable v_","equalities eqs_"]),
9.14 ("#Find" ,["functionEq f_1_"])
9.15 ],
9.16 - e_rls, None, []));
9.17 + e_rls, NONE, []));
9.18 store_pbt
9.19 (prep_pbt DiffApp.thy "pbl_fun_max_expl" [] e_pblID
9.20 (["by_explicit","make","function"]:pblID,
9.21 [("#Given" ,["functionOf f_","boundVariable v_","equalities eqs_"]),
9.22 ("#Find" ,["functionEq f_1_"])
9.23 ],
9.24 - e_rls, None, [["DiffApp","make_fun_by_explicit"]]));
9.25 + e_rls, NONE, [["DiffApp","make_fun_by_explicit"]]));
9.26 store_pbt
9.27 (prep_pbt DiffApp.thy "pbl_fun_max_newvar" [] e_pblID
9.28 (["by_new_variable","make","function"]:pblID,
9.29 @@ -87,7 +87,7 @@
9.30 (*WN.12.5.03: precond for distinction still missing*)
9.31 ("#Find" ,["functionEq f_1_"])
9.32 ],
9.33 - e_rls, None, [["DiffApp","make_fun_by_new_variable"]]));
9.34 + e_rls, NONE, [["DiffApp","make_fun_by_new_variable"]]));
9.35
9.36 store_pbt
9.37 (prep_pbt DiffApp.thy "pbl_fun_max_interv" [] e_pblID
9.38 @@ -96,13 +96,13 @@
9.39 (*WN.12.5.03: precond for distinction still missing*)
9.40 ("#Find" ,["maxArgument v_0_"])
9.41 ],
9.42 - e_rls, None, []));
9.43 + e_rls, NONE, []));
9.44
9.45 store_pbt
9.46 (prep_pbt DiffApp.thy "pbl_tool" [] e_pblID
9.47 (["tool"]:pblID,
9.48 [],
9.49 - e_rls, None, []));
9.50 + e_rls, NONE, []));
9.51
9.52 store_pbt
9.53 (prep_pbt DiffApp.thy "pbl_tool_findvals" [] e_pblID
9.54 @@ -111,7 +111,7 @@
9.55 ("#Find" ,["valuesFor vls_"]),
9.56 ("#Relate",["additionalRels rs_"])
9.57 ],
9.58 - e_rls, None, []));
9.59 + e_rls, NONE, []));
9.60
9.61
9.62 (** methods, scripts not yet implemented **)
10.1 --- a/src/Tools/isac/IsacKnowledge/EqSystem.ML Wed Aug 18 13:53:15 2010 +0200
10.2 +++ b/src/Tools/isac/IsacKnowledge/EqSystem.ML Wed Aug 18 13:55:23 2010 +0200
10.3 @@ -33,11 +33,11 @@
10.4 (p as (Const ("EqSystem.occur'_exactly'_in",_)
10.5 $ vs $ all $ t)) _ =
10.6 if occur_exactly_in (isalist2list vs) (isalist2list all) t
10.7 - then Some ((term2str p) ^ " = True",
10.8 + then SOME ((term2str p) ^ " = True",
10.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
10.10 - else Some ((term2str p) ^ " = False",
10.11 + else SOME ((term2str p) ^ " = False",
10.12 Trueprop $ (mk_equality (p, HOLogic.false_const)))
10.13 - | eval_occur_exactly_in _ _ _ _ = None;
10.14 + | eval_occur_exactly_in _ _ _ _ = NONE;
10.15
10.16 calclist':=
10.17 overwritel (!calclist',
10.18 @@ -371,7 +371,7 @@
10.19 ("#Find" ,["solution ss___"](*___ is copy-named*))
10.20 ],
10.21 append_rls "e_rls" e_rls [(*for preds in where_*)],
10.22 - Some "solveSystem es_ vs_",
10.23 + SOME "solveSystem es_ vs_",
10.24 []));
10.25 store_pbt
10.26 (prep_pbt EqSystem.thy "pbl_equsys_lin" [] e_pblID
10.27 @@ -381,7 +381,7 @@
10.28 ("#Find" ,["solution ss___"])
10.29 ],
10.30 append_rls "e_rls" e_rls [(*for preds in where_*)],
10.31 - Some "solveSystem es_ vs_",
10.32 + SOME "solveSystem es_ vs_",
10.33 []));
10.34 store_pbt
10.35 (prep_pbt EqSystem.thy "pbl_equsys_lin_2x2" [] e_pblID
10.36 @@ -397,7 +397,7 @@
10.37 Calc ("op +", eval_binop "#add_"),
10.38 Calc ("op =",eval_equal "#equal_")
10.39 ],
10.40 - Some "solveSystem es_ vs_",
10.41 + SOME "solveSystem es_ vs_",
10.42 []));
10.43 store_pbt
10.44 (prep_pbt EqSystem.thy "pbl_equsys_lin_2x2_tri" [] e_pblID
10.45 @@ -409,7 +409,7 @@
10.46 ("#Find" ,["solution ss___"])
10.47 ],
10.48 prls_triangular,
10.49 - Some "solveSystem es_ vs_",
10.50 + SOME "solveSystem es_ vs_",
10.51 [["EqSystem","top_down_substitution","2x2"]]));
10.52 store_pbt
10.53 (prep_pbt EqSystem.thy "pbl_equsys_lin_2x2_norm" [] e_pblID
10.54 @@ -418,7 +418,7 @@
10.55 ("#Find" ,["solution ss___"])
10.56 ],
10.57 append_rls "e_rls" e_rls [(*for preds in where_*)],
10.58 - Some "solveSystem es_ vs_",
10.59 + SOME "solveSystem es_ vs_",
10.60 [["EqSystem","normalize","2x2"]]));
10.61 store_pbt
10.62 (prep_pbt EqSystem.thy "pbl_equsys_lin_3x3" [] e_pblID
10.63 @@ -434,7 +434,7 @@
10.64 Calc ("op +", eval_binop "#add_"),
10.65 Calc ("op =",eval_equal "#equal_")
10.66 ],
10.67 - Some "solveSystem es_ vs_",
10.68 + SOME "solveSystem es_ vs_",
10.69 []));
10.70 store_pbt
10.71 (prep_pbt EqSystem.thy "pbl_equsys_lin_4x4" [] e_pblID
10.72 @@ -450,7 +450,7 @@
10.73 Calc ("op +", eval_binop "#add_"),
10.74 Calc ("op =",eval_equal "#equal_")
10.75 ],
10.76 - Some "solveSystem es_ vs_",
10.77 + SOME "solveSystem es_ vs_",
10.78 []));
10.79 store_pbt
10.80 (prep_pbt EqSystem.thy "pbl_equsys_lin_4x4_tri" [] e_pblID
10.81 @@ -466,7 +466,7 @@
10.82 ],
10.83 append_rls "prls_tri_4x4_lin_sys" prls_triangular
10.84 [Calc ("Atools.occurs'_in",eval_occurs_in "")],
10.85 - Some "solveSystem es_ vs_",
10.86 + SOME "solveSystem es_ vs_",
10.87 [["EqSystem","top_down_substitution","4x4"]]));
10.88
10.89 store_pbt
10.90 @@ -477,7 +477,7 @@
10.91 ("#Find" ,["solution ss___"])
10.92 ],
10.93 append_rls "e_rls" e_rls [(*for preds in where_*)],
10.94 - Some "solveSystem es_ vs_",
10.95 + SOME "solveSystem es_ vs_",
10.96 [["EqSystem","normalize","4x4"]]));
10.97
10.98
11.1 --- a/src/Tools/isac/IsacKnowledge/Equation.ML Wed Aug 18 13:53:15 2010 +0200
11.2 +++ b/src/Tools/isac/IsacKnowledge/Equation.ML Wed Aug 18 13:55:23 2010 +0200
11.3 @@ -33,7 +33,7 @@
11.4 ],
11.5 append_rls "equation_prls" e_rls
11.6 [Calc ("Tools.matches",eval_matches "")],
11.7 - Some "solve (e_::bool, v_)",
11.8 + SOME "solve (e_::bool, v_)",
11.9 []));
11.10
11.11 store_pbt
11.12 @@ -43,7 +43,7 @@
11.13 ("#Where" ,["matches (?a = ?b) e_"]),
11.14 ("#Find" ,["solutions v_i_"])
11.15 ],
11.16 - univariate_equation_prls,Some "solve (e_::bool, v_)",[]));
11.17 + univariate_equation_prls,SOME "solve (e_::bool, v_)",[]));
11.18
11.19
11.20 (*.function for handling the cas-input "solve (x+1=2, x)":
12.1 --- a/src/Tools/isac/IsacKnowledge/Integrate.ML Wed Aug 18 13:53:15 2010 +0200
12.2 +++ b/src/Tools/isac/IsacKnowledge/Integrate.ML Wed Aug 18 13:55:23 2010 +0200
12.3 @@ -25,8 +25,8 @@
12.4 case (explode o id_of) var of
12.5 "c"::[] => true
12.6 | "c"::"_"::is => (case (int_of_str o implode) is of
12.7 - Some _ => true
12.8 - | None => false)
12.9 + SOME _ => true
12.10 + | NONE => false)
12.11 | _ => false;
12.12 fun get_coeff c = case (explode o id_of) c of
12.13 "c"::"_"::is => (the o int_of_str o implode) is
12.14 @@ -44,9 +44,9 @@
12.15 (*WN080222
12.16 (*("new_c", ("Integrate.new'_c", eval_new_c "#new_c_"))*)
12.17 fun eval_new_c _ _ (p as (Const ("Integrate.new'_c",_) $ t)) _ =
12.18 - Some ((term2str p) ^ " = " ^ term2str (new_c p),
12.19 + SOME ((term2str p) ^ " = " ^ term2str (new_c p),
12.20 Trueprop $ (mk_equality (p, new_c p)))
12.21 - | eval_new_c _ _ _ _ = None;
12.22 + | eval_new_c _ _ _ _ = NONE;
12.23 *)
12.24
12.25 (*WN080222:*)
12.26 @@ -58,21 +58,21 @@
12.27 Const ("op =", T) $ lh $ rh =>
12.28 Const ("op =", T) $ lh $ mk_add rh (new_c rh)
12.29 | p => mk_add p (new_c p)
12.30 - in Some ((term2str p) ^ " = " ^ term2str p',
12.31 + in SOME ((term2str p) ^ " = " ^ term2str p',
12.32 Trueprop $ (mk_equality (p, p')))
12.33 end
12.34 - | eval_add_new_c _ _ _ _ = None;
12.35 + | eval_add_new_c _ _ _ _ = NONE;
12.36
12.37
12.38 (*("is_f_x", ("Integrate.is'_f'_x", eval_is_f_x "is_f_x_"))*)
12.39 fun eval_is_f_x _ _(p as (Const ("Integrate.is'_f'_x", _)
12.40 $ arg)) _ =
12.41 if is_f_x arg
12.42 - then Some ((term2str p) ^ " = True",
12.43 + then SOME ((term2str p) ^ " = True",
12.44 Trueprop $ (mk_equality (p, HOLogic.true_const)))
12.45 - else Some ((term2str p) ^ " = False",
12.46 + else SOME ((term2str p) ^ " = False",
12.47 Trueprop $ (mk_equality (p, HOLogic.false_const)))
12.48 - | eval_is_f_x _ _ _ _ = None;
12.49 + | eval_is_f_x _ _ _ _ = NONE;
12.50
12.51 calclist':= overwritel (!calclist',
12.52 [(*("new_c", ("Integrate.new'_c", eval_new_c "new_c_")),*)
12.53 @@ -304,7 +304,7 @@
12.54 ("#Find" ,["antiDerivative F_"])
12.55 ],
12.56 append_rls "e_rls" e_rls [(*for preds in where_*)],
12.57 - Some "Integrate (f_, v_)",
12.58 + SOME "Integrate (f_, v_)",
12.59 [["diff","integration"]]));
12.60
12.61 (*here "named" is used differently from Differentiation"*)
12.62 @@ -315,7 +315,7 @@
12.63 ("#Find" ,["antiDerivativeName F_"])
12.64 ],
12.65 append_rls "e_rls" e_rls [(*for preds in where_*)],
12.66 - Some "Integrate (f_, v_)",
12.67 + SOME "Integrate (f_, v_)",
12.68 [["diff","integration","named"]]));
12.69
12.70 (** methods **)
13.1 --- a/src/Tools/isac/IsacKnowledge/LinEq.ML Wed Aug 18 13:53:15 2010 +0200
13.2 +++ b/src/Tools/isac/IsacKnowledge/LinEq.ML Wed Aug 18 13:55:23 2010 +0200
13.3 @@ -126,7 +126,7 @@
13.4 "((rhs e_) has_degree_in v_)=1"]),
13.5 ("#Find" ,["solutions v_i_"])
13.6 ],
13.7 - LinEq_prls, Some "solve (e_::bool, v_)",
13.8 + LinEq_prls, SOME "solve (e_::bool, v_)",
13.9 [["LinEq","solve_lineq_equation"]]));
13.10
13.11 (*-------------- methods-------------------------------------------------------*)
14.1 --- a/src/Tools/isac/IsacKnowledge/LogExp.ML Wed Aug 18 13:53:15 2010 +0200
14.2 +++ b/src/Tools/isac/IsacKnowledge/LogExp.ML Wed Aug 18 13:55:23 2010 +0200
14.3 @@ -17,7 +17,7 @@
14.4 ("#With" ,["||(lhs (Subst (v_i_,v_) e_) - \
14.5 \ (rhs (Subst (v_i_,v_) e_) || < eps)"])
14.6 ],
14.7 - PolyEq_prls, Some "solve (e_::bool, v_)",
14.8 + PolyEq_prls, SOME "solve (e_::bool, v_)",
14.9 [["Equation","solve_log"]]));
14.10
14.11 (** methods **)
15.1 --- a/src/Tools/isac/IsacKnowledge/Poly.ML Wed Aug 18 13:53:15 2010 +0200
15.2 +++ b/src/Tools/isac/IsacKnowledge/Poly.ML Wed Aug 18 13:55:23 2010 +0200
15.3 @@ -65,11 +65,11 @@
15.4
15.5 fun eval_is_polyrat_in _ _ (p as (Const ("Poly.is'_polyrat'_in",_) $ t $ v)) _ =
15.6 if is_polyrat_in t v then
15.7 - Some ((term2str p) ^ " = True",
15.8 + SOME ((term2str p) ^ " = True",
15.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
15.10 - else Some ((term2str p) ^ " = True",
15.11 + else SOME ((term2str p) ^ " = True",
15.12 Trueprop $ (mk_equality (p, HOLogic.false_const)))
15.13 - | eval_is_polyrat_in _ _ _ _ = ((*writeln"### nichts matcht";*) None);
15.14 + | eval_is_polyrat_in _ _ _ _ = ((*writeln"### nichts matcht";*) NONE);
15.15
15.16
15.17 local
15.18 @@ -94,113 +94,113 @@
15.19 fun factor_right_deg (*case 2*)
15.20 (t as Const ("op *",_) $ t1 $
15.21 (Const ("Atools.pow",_) $ vv $ Free (d,_))) v =
15.22 - if ((vv = v) andalso (coeff_in t1 v)) then Some (int_of_str' d) else None
15.23 + if ((vv = v) andalso (coeff_in t1 v)) then SOME (int_of_str' d) else NONE
15.24 | factor_right_deg
15.25 (t as Const ("Atools.pow",_) $ vv $ Free (d,_)) v =
15.26 - if (vv = v) then Some (int_of_str' d) else None
15.27 + if (vv = v) then SOME (int_of_str' d) else NONE
15.28 | factor_right_deg (t as Const ("op *",_) $ t1 $ vv) v =
15.29 - if ((vv = v) andalso (coeff_in t1 v))then Some 1 else None
15.30 + if ((vv = v) andalso (coeff_in t1 v))then SOME 1 else NONE
15.31 | factor_right_deg vv v =
15.32 - if (vv = v) then Some 1 else None;
15.33 + if (vv = v) then SOME 1 else NONE;
15.34 fun mono_deg_in m v =
15.35 - if coeff_in m v then (*case 1*) Some 0
15.36 + if coeff_in m v then (*case 1*) SOME 0
15.37 else factor_right_deg m v;
15.38 (*
15.39 val v = (term_of o the o (parse thy)) "x";
15.40 val t = (term_of o the o (parse thy)) "(a*b+c)*x^^^7";
15.41 mono_deg_in t v;
15.42 - (*val it = Some 7*)
15.43 + (*val it = SOME 7*)
15.44 val t = (term_of o the o (parse thy)) "x^^^7";
15.45 mono_deg_in t v;
15.46 - (*val it = Some 7*)
15.47 + (*val it = SOME 7*)
15.48 val t = (term_of o the o (parse thy)) "(a*b+c)*x";
15.49 mono_deg_in t v;
15.50 - (*val it = Some 1*)
15.51 + (*val it = SOME 1*)
15.52 val t = (term_of o the o (parse thy)) "(a*b+x)*x";
15.53 mono_deg_in t v;
15.54 - (*val it = None*)
15.55 + (*val it = NONE*)
15.56 val t = (term_of o the o (parse thy)) "x";
15.57 mono_deg_in t v;
15.58 - (*val it = Some 1*)
15.59 + (*val it = SOME 1*)
15.60 val t = (term_of o the o (parse thy)) "(a*b+c)";
15.61 mono_deg_in t v;
15.62 - (*val it = Some 0*)
15.63 + (*val it = SOME 0*)
15.64 val t = (term_of o the o (parse thy)) "ab - (a*b)*x";
15.65 mono_deg_in t v;
15.66 - (*val it = None*)
15.67 + (*val it = NONE*)
15.68 *)
15.69 fun expand_deg_in t v =
15.70 let fun edi ~1 ~1 (Const ("op +",_) $ t1 $ t2) =
15.71 (case mono_deg_in t2 v of (* $ is left associative*)
15.72 - Some d' => edi d' d' t1
15.73 - | None => None)
15.74 + SOME d' => edi d' d' t1
15.75 + | NONE => NONE)
15.76 | edi ~1 ~1 (Const ("op -",_) $ t1 $ t2) =
15.77 (case mono_deg_in t2 v of
15.78 - Some d' => edi d' d' t1
15.79 - | None => None)
15.80 + SOME d' => edi d' d' t1
15.81 + | NONE => NONE)
15.82 | edi d dmax (Const ("op -",_) $ t1 $ t2) =
15.83 (case mono_deg_in t2 v of
15.84 (*RL orelse ((d=0) andalso (d'=0)) need to handle 3+4-...4 +x*)
15.85 - Some d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then edi d' dmax t1 else None
15.86 - | None => None)
15.87 + SOME d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then edi d' dmax t1 else NONE
15.88 + | NONE => NONE)
15.89 | edi d dmax (Const ("op +",_) $ t1 $ t2) =
15.90 (case mono_deg_in t2 v of
15.91 (*RL orelse ((d=0) andalso (d'=0)) need to handle 3+4-...4 +x*)
15.92 - Some d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then edi d' dmax t1 else None
15.93 - | None => None)
15.94 + SOME d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then edi d' dmax t1 else NONE
15.95 + | NONE => NONE)
15.96 | edi ~1 ~1 t =
15.97 (case mono_deg_in t v of
15.98 - d as Some _ => d
15.99 - | None => None)
15.100 + d as SOME _ => d
15.101 + | NONE => NONE)
15.102 | edi d dmax t = (*basecase last*)
15.103 (case mono_deg_in t v of
15.104 - Some d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then Some dmax else None
15.105 - | None => None)
15.106 + SOME d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then SOME dmax else NONE
15.107 + | NONE => NONE)
15.108 in edi ~1 ~1 t end;
15.109 (*
15.110 val v = (term_of o the o (parse thy)) "x";
15.111 val t = (term_of o the o (parse thy)) "a+b";
15.112 expand_deg_in t v;
15.113 - (*val it = Some 0*)
15.114 + (*val it = SOME 0*)
15.115 val t = (term_of o the o (parse thy)) "(a+b)*x";
15.116 expand_deg_in t v;
15.117 - (*Some 1*)
15.118 + (*SOME 1*)
15.119 val t = (term_of o the o (parse thy)) "a*b - (a+b)*x";
15.120 expand_deg_in t v;
15.121 - (*Some 1*)
15.122 + (*SOME 1*)
15.123 val t = (term_of o the o (parse thy)) "a*b + (a-b)*x";
15.124 expand_deg_in t v;
15.125 - (*Some 1*)
15.126 + (*SOME 1*)
15.127 val t = (term_of o the o (parse thy)) "a*b + (a+b)*x + x^^^2";
15.128 expand_deg_in t v;
15.129 *)
15.130 fun poly_deg_in t v =
15.131 let fun edi ~1 ~1 (Const ("op +",_) $ t1 $ t2) =
15.132 (case mono_deg_in t2 v of (* $ is left associative*)
15.133 - Some d' => edi d' d' t1
15.134 - | None => None)
15.135 + SOME d' => edi d' d' t1
15.136 + | NONE => NONE)
15.137 | edi d dmax (Const ("op +",_) $ t1 $ t2) =
15.138 (case mono_deg_in t2 v of
15.139 (*RL orelse ((d=0) andalso (d'=0)) need to handle 3+4-...4 +x*)
15.140 - Some d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then edi d' dmax t1 else None
15.141 - | None => None)
15.142 + SOME d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then edi d' dmax t1 else NONE
15.143 + | NONE => NONE)
15.144 | edi ~1 ~1 t =
15.145 (case mono_deg_in t v of
15.146 - d as Some _ => d
15.147 - | None => None)
15.148 + d as SOME _ => d
15.149 + | NONE => NONE)
15.150 | edi d dmax t = (*basecase last*)
15.151 (case mono_deg_in t v of
15.152 - Some d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then Some dmax else None
15.153 - | None => None)
15.154 + SOME d' => if ((d > d') orelse ((d=0) andalso (d'=0))) then SOME dmax else NONE
15.155 + | NONE => NONE)
15.156 in edi ~1 ~1 t end;
15.157 in
15.158
15.159 fun is_expanded_in t v =
15.160 - case expand_deg_in t v of Some _ => true | None => false;
15.161 + case expand_deg_in t v of SOME _ => true | NONE => false;
15.162 fun is_poly_in t v =
15.163 - case poly_deg_in t v of Some _ => true | None => false;
15.164 + case poly_deg_in t v of SOME _ => true | NONE => false;
15.165 fun has_degree_in t v =
15.166 - case expand_deg_in t v of Some d => d | None => ~1;
15.167 + case expand_deg_in t v of SOME d => d | NONE => ~1;
15.168 end;
15.169 (*
15.170 val v = (term_of o the o (parse thy)) "x";
15.171 @@ -219,14 +219,14 @@
15.172 fun eval_is_expanded_in _ _
15.173 (p as (Const ("Poly.is'_expanded'_in",_) $ t $ v)) _ =
15.174 if is_expanded_in t v
15.175 - then Some ((term2str p) ^ " = True",
15.176 + then SOME ((term2str p) ^ " = True",
15.177 Trueprop $ (mk_equality (p, HOLogic.true_const)))
15.178 - else Some ((term2str p) ^ " = True",
15.179 + else SOME ((term2str p) ^ " = True",
15.180 Trueprop $ (mk_equality (p, HOLogic.false_const)))
15.181 - | eval_is_expanded_in _ _ _ _ = None;
15.182 + | eval_is_expanded_in _ _ _ _ = NONE;
15.183 (*
15.184 val t = (term_of o the o (parse thy)) "(-8 - 2*x + x^^^2) is_expanded_in x";
15.185 - val Some (id, t') = eval_is_expanded_in 0 0 t 0;
15.186 + val SOME (id, t') = eval_is_expanded_in 0 0 t 0;
15.187 (*val id = "Poly.is'_expanded'_in (-8 - 2 * x + x ^^^ 2) x = True"*)
15.188 term2str t';
15.189 (*val it = "Poly.is'_expanded'_in (-8 - 2 * x + x ^^^ 2) x = True"*)
15.190 @@ -235,14 +235,14 @@
15.191 fun eval_is_poly_in _ _
15.192 (p as (Const ("Poly.is'_poly'_in",_) $ t $ v)) _ =
15.193 if is_poly_in t v
15.194 - then Some ((term2str p) ^ " = True",
15.195 + then SOME ((term2str p) ^ " = True",
15.196 Trueprop $ (mk_equality (p, HOLogic.true_const)))
15.197 - else Some ((term2str p) ^ " = True",
15.198 + else SOME ((term2str p) ^ " = True",
15.199 Trueprop $ (mk_equality (p, HOLogic.false_const)))
15.200 - | eval_is_poly_in _ _ _ _ = None;
15.201 + | eval_is_poly_in _ _ _ _ = NONE;
15.202 (*
15.203 val t = (term_of o the o (parse thy)) "(8 + 2*x + x^^^2) is_poly_in x";
15.204 - val Some (id, t') = eval_is_poly_in 0 0 t 0;
15.205 + val SOME (id, t') = eval_is_poly_in 0 0 t 0;
15.206 (*val id = "Poly.is'_poly'_in (8 + 2 * x + x ^^^ 2) x = True"*)
15.207 term2str t';
15.208 (*val it = "Poly.is'_poly'_in (8 + 2 * x + x ^^^ 2) x = True"*)
15.209 @@ -253,13 +253,13 @@
15.210 (p as (Const ("Poly.has'_degree'_in",_) $ t $ v)) _ =
15.211 let val d = has_degree_in t v
15.212 val d' = term_of_num HOLogic.realT d
15.213 - in Some ((term2str p) ^ " = " ^ (string_of_int d),
15.214 + in SOME ((term2str p) ^ " = " ^ (string_of_int d),
15.215 Trueprop $ (mk_equality (p, d')))
15.216 end
15.217 - | eval_has_degree_in _ _ _ _ = None;
15.218 + | eval_has_degree_in _ _ _ _ = NONE;
15.219 (*
15.220 > val t = (term_of o the o (parse thy)) "(-8 - 2*x + x^^^2) has_degree_in x";
15.221 -> val Some (id, t') = eval_has_degree_in 0 0 t 0;
15.222 +> val SOME (id, t') = eval_has_degree_in 0 0 t 0;
15.223 val id = "Poly.has'_degree'_in (-8 - 2 * x + x ^^^ 2) x = 2" : string
15.224 > term2str t';
15.225 val it = "Poly.has'_degree'_in (-8 - 2 * x + x ^^^ 2) x = 2" : string
15.226 @@ -311,8 +311,8 @@
15.227
15.228 fun get_order_pow (t $ (Free(order,_))) = (* RL FIXXXME:geht zufaellig?WN*)
15.229 (case int_of_str (order) of
15.230 - Some d => d
15.231 - | None => 0)
15.232 + SOME d => d
15.233 + | NONE => 0)
15.234 | get_order_pow _ = 0;
15.235
15.236 fun size_of_term' (Const(str,_) $ t) =
15.237 @@ -452,13 +452,13 @@
15.238 fun eval_is_polyexp (thmid:string) _
15.239 (t as (Const("Poly.is'_polyexp", _) $ arg)) thy =
15.240 if is_polyexp arg
15.241 - then Some (mk_thmid thmid ""
15.242 + then SOME (mk_thmid thmid ""
15.243 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
15.244 Trueprop $ (mk_equality (t, HOLogic.true_const)))
15.245 - else Some (mk_thmid thmid ""
15.246 + else SOME (mk_thmid thmid ""
15.247 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
15.248 Trueprop $ (mk_equality (t, HOLogic.false_const)))
15.249 - | eval_is_polyexp _ _ _ _ = None;
15.250 + | eval_is_polyexp _ _ _ _ = NONE;
15.251
15.252 val expand_poly_rat_ =
15.253 Rls{id = "expand_poly_rat_", preconds = [],
15.254 @@ -1098,18 +1098,18 @@
15.255 fun hd_str str = substring (str, 0, 1);
15.256 fun tl_str str = substring (str, 1, (size str) - 1);
15.257
15.258 -(* liefert nummerischen Koeffizienten eines Monoms oder None *)
15.259 +(* liefert nummerischen Koeffizienten eines Monoms oder NONE *)
15.260 fun get_koeff_of_mon [] = raise error("get_koeff_of_mon: called with l = []")
15.261 - | get_koeff_of_mon (l as x::xs) = if is_nums x then Some x
15.262 - else None;
15.263 + | get_koeff_of_mon (l as x::xs) = if is_nums x then SOME x
15.264 + else NONE;
15.265
15.266 (* wandelt Koeffizient in (zum sortieren geeigneten) String um *)
15.267 -fun koeff2ordStr (Some x) = (case x of
15.268 +fun koeff2ordStr (SOME x) = (case x of
15.269 (Free (str, T)) =>
15.270 if (hd_str str) = "-" then (tl_str str)^"0" (* 3 < -3 *)
15.271 else str
15.272 | _ => "aaa") (* "num.Ausdruck" --> gross *)
15.273 - | koeff2ordStr None = "---"; (* "kein Koeff" --> kleinste *)
15.274 + | koeff2ordStr NONE = "---"; (* "kein Koeff" --> kleinste *)
15.275
15.276 (* Order zum Vergleich von Koeffizienten (strings):
15.277 "kein Koeff" < "0" < "1" < "-1" < "2" < "-2" < ... < "num.Ausdruck" *)
15.278 @@ -1185,13 +1185,13 @@
15.279 fun eval_is_multUnordered (thmid:string) _
15.280 (t as (Const("Poly.is'_multUnordered", _) $ arg)) thy =
15.281 if is_multUnordered arg
15.282 - then Some (mk_thmid thmid ""
15.283 + then SOME (mk_thmid thmid ""
15.284 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
15.285 Trueprop $ (mk_equality (t, HOLogic.true_const)))
15.286 - else Some (mk_thmid thmid ""
15.287 + else SOME (mk_thmid thmid ""
15.288 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
15.289 Trueprop $ (mk_equality (t, HOLogic.false_const)))
15.290 - | eval_is_multUnordered _ _ _ _ = None;
15.291 + | eval_is_multUnordered _ _ _ _ = NONE;
15.292
15.293
15.294 fun attach_form (_:rule list list) (_:term) (_:term) = (*still missing*)
15.295 @@ -1199,8 +1199,8 @@
15.296 fun init_state (_:term) = e_rrlsstate;
15.297 fun locate_rule (_:rule list list) (_:term) (_:rule) =
15.298 ([]:(rule * (term * term list)) list);
15.299 -fun next_rule (_:rule list list) (_:term) = (None:rule option);
15.300 -fun normal_form t = Some (sort_variables t,[]:term list);
15.301 +fun next_rule (_:rule list list) (_:term) = (NONE:rule option);
15.302 +fun normal_form t = SOME (sort_variables t,[]:term list);
15.303
15.304 val order_mult_ =
15.305 Rrls {id = "order_mult_",
15.306 @@ -1238,21 +1238,21 @@
15.307 fun eval_is_addUnordered (thmid:string) _
15.308 (t as (Const("Poly.is'_addUnordered", _) $ arg)) thy =
15.309 if is_addUnordered arg
15.310 - then Some (mk_thmid thmid ""
15.311 + then SOME (mk_thmid thmid ""
15.312 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
15.313 Trueprop $ (mk_equality (t, HOLogic.true_const)))
15.314 - else Some (mk_thmid thmid ""
15.315 + else SOME (mk_thmid thmid ""
15.316 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
15.317 Trueprop $ (mk_equality (t, HOLogic.false_const)))
15.318 - | eval_is_addUnordered _ _ _ _ = None;
15.319 + | eval_is_addUnordered _ _ _ _ = NONE;
15.320
15.321 fun attach_form (_:rule list list) (_:term) (_:term) = (*still missing*)
15.322 []:(rule * (term * term list)) list;
15.323 fun init_state (_:term) = e_rrlsstate;
15.324 fun locate_rule (_:rule list list) (_:term) (_:rule) =
15.325 ([]:(rule * (term * term list)) list);
15.326 -fun next_rule (_:rule list list) (_:term) = (None:rule option);
15.327 -fun normal_form t = Some (sort_monoms t,[]:term list);
15.328 +fun next_rule (_:rule list list) (_:term) = (NONE:rule option);
15.329 +fun normal_form t = SOME (sort_monoms t,[]:term list);
15.330
15.331 val order_add_ =
15.332 Rrls {id = "order_add_",
15.333 @@ -1469,7 +1469,7 @@
15.334 ],
15.335 append_rls "e_rls" e_rls [(*for preds in where_*)
15.336 Calc ("Poly.is'_polyexp", eval_is_polyexp "")],
15.337 - Some "Simplify t_",
15.338 + SOME "Simplify t_",
15.339 [["simplification","for_polynomials"]]));
15.340
15.341
16.1 --- a/src/Tools/isac/IsacKnowledge/PolyEq.ML Wed Aug 18 13:53:15 2010 +0200
16.2 +++ b/src/Tools/isac/IsacKnowledge/PolyEq.ML Wed Aug 18 13:55:23 2010 +0200
16.3 @@ -483,7 +483,7 @@
16.4 "~((rhs e_) is_rootTerm_in (v_::real))"]),
16.5 ("#Find" ,["solutions v_i_"])
16.6 ],
16.7 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.8 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.9 []));
16.10 (*--- d0 ---*)
16.11 store_pbt
16.12 @@ -496,7 +496,7 @@
16.13 ]),
16.14 ("#Find" ,["solutions v_i_"])
16.15 ],
16.16 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.17 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.18 [["PolyEq","solve_d0_polyeq_equation"]]));
16.19
16.20 (*--- d1 ---*)
16.21 @@ -510,7 +510,7 @@
16.22 ]),
16.23 ("#Find" ,["solutions v_i_"])
16.24 ],
16.25 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.26 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.27 [["PolyEq","solve_d1_polyeq_equation"]]));
16.28
16.29 (*--- d2 ---*)
16.30 @@ -523,7 +523,7 @@
16.31 "((lhs e_) has_degree_in v_ ) = 2"]),
16.32 ("#Find" ,["solutions v_i_"])
16.33 ],
16.34 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.35 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.36 [["PolyEq","solve_d2_polyeq_equation"]]));
16.37
16.38 store_pbt
16.39 @@ -544,7 +544,7 @@
16.40 \Not (matches ( ?b*?v_ + ?c*?v_^^^2 = 0) e_)"]),
16.41 ("#Find" ,["solutions v_i_"])
16.42 ],
16.43 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.44 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.45 [["PolyEq","solve_d2_polyeq_sqonly_equation"]]));
16.46
16.47 store_pbt
16.48 @@ -559,7 +559,7 @@
16.49 \matches ( ?b*?v_^^^2 = 0) e_ "]),
16.50 ("#Find" ,["solutions v_i_"])
16.51 ],
16.52 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.53 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.54 [["PolyEq","solve_d2_polyeq_bdvonly_equation"]]));
16.55
16.56 store_pbt
16.57 @@ -570,7 +570,7 @@
16.58 \matches (?a + ?v_^^^2 = 0) e_"]),
16.59 ("#Find" ,["solutions v_i_"])
16.60 ],
16.61 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.62 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.63 [["PolyEq","solve_d2_polyeq_pq_equation"]]));
16.64
16.65 store_pbt
16.66 @@ -581,7 +581,7 @@
16.67 \matches (?a + ?b*?v_^^^2 = 0) e_"]),
16.68 ("#Find" ,["solutions v_i_"])
16.69 ],
16.70 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.71 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.72 [["PolyEq","solve_d2_polyeq_abc_equation"]]));
16.73
16.74 (*--- d3 ---*)
16.75 @@ -594,7 +594,7 @@
16.76 "((lhs e_) has_degree_in v_) = 3"]),
16.77 ("#Find" ,["solutions v_i_"])
16.78 ],
16.79 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.80 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.81 [["PolyEq","solve_d3_polyeq_equation"]]));
16.82
16.83 (*--- d4 ---*)
16.84 @@ -607,7 +607,7 @@
16.85 "((lhs e_) has_degree_in v_) = 4"]),
16.86 ("#Find" ,["solutions v_i_"])
16.87 ],
16.88 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.89 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.90 [(*["PolyEq","solve_d4_polyeq_equation"]*)]));
16.91
16.92 (*--- normalize ---*)
16.93 @@ -619,7 +619,7 @@
16.94 \(Not(((lhs e_) is_poly_in v_)))"]),
16.95 ("#Find" ,["solutions v_i_"])
16.96 ],
16.97 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.98 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.99 [["PolyEq","normalize_poly"]]));
16.100 (*-------------------------expanded-----------------------*)
16.101 store_pbt
16.102 @@ -630,7 +630,7 @@
16.103 "(lhs e_) is_expanded_in v_ "]),
16.104 ("#Find" ,["solutions v_i_"])
16.105 ],
16.106 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.107 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.108 []));
16.109
16.110 (*--- d2 ---*)
16.111 @@ -641,7 +641,7 @@
16.112 ("#Where" ,["((lhs e_) has_degree_in v_) = 2"]),
16.113 ("#Find" ,["solutions v_i_"])
16.114 ],
16.115 - PolyEq_prls, Some "solve (e_::bool, v_)",
16.116 + PolyEq_prls, SOME "solve (e_::bool, v_)",
16.117 [["PolyEq","complete_square"]]));
16.118
16.119
17.1 --- a/src/Tools/isac/IsacKnowledge/PolyMinus.ML Wed Aug 18 13:53:15 2010 +0200
17.2 +++ b/src/Tools/isac/IsacKnowledge/PolyMinus.ML Wed Aug 18 13:55:23 2010 +0200
17.3 @@ -42,20 +42,20 @@
17.4 if is_num b then
17.5 if is_num a then (*123 kleiner 32 = True !!!*)
17.6 if int_of_Free a < int_of_Free b then
17.7 - Some ((term2str p) ^ " = True",
17.8 + SOME ((term2str p) ^ " = True",
17.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
17.10 - else Some ((term2str p) ^ " = False",
17.11 + else SOME ((term2str p) ^ " = False",
17.12 Trueprop $ (mk_equality (p, HOLogic.false_const)))
17.13 else (* -1 * -2 kleiner 0 *)
17.14 - Some ((term2str p) ^ " = False",
17.15 + SOME ((term2str p) ^ " = False",
17.16 Trueprop $ (mk_equality (p, HOLogic.false_const)))
17.17 else
17.18 if identifier a < identifier b then
17.19 - Some ((term2str p) ^ " = True",
17.20 + SOME ((term2str p) ^ " = True",
17.21 Trueprop $ (mk_equality (p, HOLogic.true_const)))
17.22 - else Some ((term2str p) ^ " = False",
17.23 + else SOME ((term2str p) ^ " = False",
17.24 Trueprop $ (mk_equality (p, HOLogic.false_const)))
17.25 - | eval_kleiner _ _ _ _ = None;
17.26 + | eval_kleiner _ _ _ _ = NONE;
17.27
17.28 fun ist_monom (Free (id,_)) = true
17.29 | ist_monom (Const ("op *", _) $ Free (num, _) $ Free (id, _)) =
17.30 @@ -81,11 +81,11 @@
17.31 (*("ist_monom", ("PolyMinus.ist'_monom", eval_ist_monom ""))*)
17.32 fun eval_ist_monom _ _ (p as (Const ("PolyMinus.ist'_monom",_) $ a)) _ =
17.33 if ist_monom a then
17.34 - Some ((term2str p) ^ " = True",
17.35 + SOME ((term2str p) ^ " = True",
17.36 Trueprop $ (mk_equality (p, HOLogic.true_const)))
17.37 - else Some ((term2str p) ^ " = False",
17.38 + else SOME ((term2str p) ^ " = False",
17.39 Trueprop $ (mk_equality (p, HOLogic.false_const)))
17.40 - | eval_ist_monom _ _ _ _ = None;
17.41 + | eval_ist_monom _ _ _ _ = NONE;
17.42
17.43
17.44 (** rewrite order **)
17.45 @@ -304,7 +304,7 @@
17.46 store_pbt
17.47 (prep_pbt PolyMinus.thy "pbl_vereinf_poly" [] e_pblID
17.48 (["polynom","vereinfachen"],
17.49 - [], Erls, None, []));
17.50 + [], Erls, NONE, []));
17.51
17.52 store_pbt
17.53 (prep_pbt PolyMinus.thy "pbl_vereinf_poly_minus" [] e_pblID
17.54 @@ -332,7 +332,7 @@
17.55 (*"(~ True) = False"*)
17.56 Thm ("not_false",num_str not_false)
17.57 (*"(~ False) = True"*)],
17.58 - Some "Vereinfache t_",
17.59 + SOME "Vereinfache t_",
17.60 [["simplification","for_polynomials","with_minus"]]));
17.61
17.62 store_pbt
17.63 @@ -356,7 +356,7 @@
17.64 (*"(~ True) = False"*)
17.65 Thm ("not_false",num_str not_false)
17.66 (*"(~ False) = True"*)],
17.67 - Some "Vereinfache t_",
17.68 + SOME "Vereinfache t_",
17.69 [["simplification","for_polynomials","with_parentheses"]]));
17.70
17.71 store_pbt
17.72 @@ -368,13 +368,13 @@
17.73 ],
17.74 append_rls "e_rls" e_rls [(*for preds in where_*)
17.75 Calc ("Poly.is'_polyexp", eval_is_polyexp "")],
17.76 - Some "Vereinfache t_",
17.77 + SOME "Vereinfache t_",
17.78 [["simplification","for_polynomials","with_parentheses_mult"]]));
17.79
17.80 store_pbt
17.81 (prep_pbt PolyMinus.thy "pbl_probe" [] e_pblID
17.82 (["probe"],
17.83 - [], Erls, None, []));
17.84 + [], Erls, NONE, []));
17.85
17.86 store_pbt
17.87 (prep_pbt PolyMinus.thy "pbl_probe_poly" [] e_pblID
17.88 @@ -386,7 +386,7 @@
17.89 append_rls "prls_pbl_probe_poly"
17.90 e_rls [(*for preds in where_*)
17.91 Calc ("Poly.is'_polyexp", eval_is_polyexp "")],
17.92 - Some "Probe e_ ws_",
17.93 + SOME "Probe e_ ws_",
17.94 [["probe","fuer_polynom"]]));
17.95
17.96 store_pbt
17.97 @@ -399,7 +399,7 @@
17.98 append_rls "prls_pbl_probe_bruch"
17.99 e_rls [(*for preds in where_*)
17.100 Calc ("Rational.is'_ratpolyexp", eval_is_ratpolyexp "")],
17.101 - Some "Probe e_ ws_",
17.102 + SOME "Probe e_ ws_",
17.103 [["probe","fuer_bruch"]]));
17.104
17.105
18.1 --- a/src/Tools/isac/IsacKnowledge/RatEq.ML Wed Aug 18 13:53:15 2010 +0200
18.2 +++ b/src/Tools/isac/IsacKnowledge/RatEq.ML Wed Aug 18 13:55:23 2010 +0200
18.3 @@ -36,11 +36,11 @@
18.4
18.5 fun eval_is_ratequation_in _ _ (p as (Const ("RatEq.is'_ratequation'_in",_) $ t $ v)) _ =
18.6 if is_rateqation_in t v then
18.7 - Some ((term2str p) ^ " = True",
18.8 + SOME ((term2str p) ^ " = True",
18.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
18.10 - else Some ((term2str p) ^ " = True",
18.11 + else SOME ((term2str p) ^ " = True",
18.12 Trueprop $ (mk_equality (p, HOLogic.false_const)))
18.13 - | eval_is_ratequation_in _ _ _ _ = ((*writeln"### nichts matcht";*) None);
18.14 + | eval_is_ratequation_in _ _ _ _ = ((*writeln"### nichts matcht";*) NONE);
18.15
18.16 (*-------------------------rulse-----------------------*)
18.17 val RatEq_prls = (*15.10.02:just the following order due to subterm evaluation*)
18.18 @@ -156,7 +156,7 @@
18.19 ("#Find" ,["solutions v_i_"])
18.20 ],
18.21
18.22 - RatEq_prls, Some "solve (e_::bool, v_)",
18.23 + RatEq_prls, SOME "solve (e_::bool, v_)",
18.24 [["RatEq","solve_rat_equation"]]));
18.25
18.26
19.1 --- a/src/Tools/isac/IsacKnowledge/Rational-WN.sml Wed Aug 18 13:53:15 2010 +0200
19.2 +++ b/src/Tools/isac/IsacKnowledge/Rational-WN.sml Wed Aug 18 13:55:23 2010 +0200
19.3 @@ -69,14 +69,14 @@
19.4 | poly t v g = mono t v g;
19.5
19.6 fun term2poly (t as Free (s, _)) v =
19.7 - if t = v then Some ([0,1] : poly) else (Some [(the o int_of_str) s]
19.8 - handle _ => None)
19.9 + if t = v then SOME ([0,1] : poly) else (SOME [(the o int_of_str) s]
19.10 + handle _ => NONE)
19.11 | term2poly (Const ("op *",_) $ (Free (s1,_)) $ (t as Free (s2,_))) v =
19.12 - if t = v then Some [0, (the o int_of_str) s1] else None
19.13 + if t = v then SOME [0, (the o int_of_str) s1] else NONE
19.14 | term2poly (Const ("op +",_) $ (Free (s1,_)) $ t) v =
19.15 - Some ([(the o int_of_str) s1] @ (poly t v 1))
19.16 + SOME ([(the o int_of_str) s1] @ (poly t v 1))
19.17 | term2poly t v =
19.18 - Some (poly t v 0) handle _ => None;
19.19 + SOME (poly t v 0) handle _ => NONE;
19.20
19.21 (*tests*)
19.22 val v = (term_of o the o (parse thy)) "x::real";
19.23 @@ -105,7 +105,7 @@
19.24
19.25
19.26 fun is_polynomial_in t v =
19.27 - case term2poly t v of Some _ => true | None => false;
19.28 + case term2poly t v of SOME _ => true | NONE => false;
19.29
19.30 (* transform the internal polynomial p into an Isabelle term t
19.31 where t meets the preconditions of term2poly
19.32 @@ -196,25 +196,25 @@
19.33 Thm (thmid, thm) =>
19.34 (case rewrite_ thy ((snd o #rew_ord o rep_rls) ruless)
19.35 rls put_asm (thm_of_thm rul) ct of
19.36 - None => rew_once ruls asm ct apno thms
19.37 - | Some (ct',asm') =>
19.38 + NONE => rew_once ruls asm ct apno thms
19.39 + | SOME (ct',asm') =>
19.40 rew_once ruls (asm union asm') ct' Appl (rul::thms))
19.41 | Calc (cc as (op_,_)) =>
19.42 (case get_calculation_ thy cc ct of
19.43 - None => rew_once ruls asm ct apno thms
19.44 - | Some (thmid, thm') =>
19.45 + NONE => rew_once ruls asm ct apno thms
19.46 + | SOME (thmid, thm') =>
19.47 let
19.48 val pairopt =
19.49 rewrite_ thy ((snd o #rew_ord o rep_rls) ruless)
19.50 rls put_asm thm' ct;
19.51 - val _ = if pairopt <> None then ()
19.52 + val _ = if pairopt <> NONE then ()
19.53 else raise error("rewrite_set_, rewrite_ \""^
19.54 (string_of_thmI thm')^"\" \""^
19.55 - (Sign.string_of_term (sign_of thy) ct)^"\" = None")
19.56 + (Sign.string_of_term (sign_of thy) ct)^"\" = NONE")
19.57 in rew_once ruls asm ((fst o the) pairopt) Appl(rul::thms) end);
19.58 val ruls = (#rules o rep_rls) ruless;
19.59 val (ct',asm') = rew_once ruls [] ct Noap ruls;
19.60 - in if ct = ct' then None else Some (ct',asm') end;
19.61 + in if ct = ct' then NONE else SOME (ct',asm') end;
19.62
19.63 (*
19.64 fun reverse_rewrite t1 t2 rls =
19.65 @@ -232,25 +232,25 @@
19.66 Thm (thmid, thm) =>
19.67 (case rewrite_ thy ((snd o #rew_ord o rep_rls) ruless)
19.68 rls put_asm (thm_of_thm rul) ct of
19.69 - None => rew_once ruls asm ct apno thms
19.70 - | Some (ct',asm') =>
19.71 + NONE => rew_once ruls asm ct apno thms
19.72 + | SOME (ct',asm') =>
19.73 rew_once ruls (asm union asm') ct' Appl (rul::thms))
19.74 | Calc (cc as (op_,_)) =>
19.75 (case get_calculation_ thy cc ct of
19.76 - None => rew_once ruls asm ct apno thms
19.77 - | Some (thmid, thm') =>
19.78 + NONE => rew_once ruls asm ct apno thms
19.79 + | SOME (thmid, thm') =>
19.80 let
19.81 val pairopt =
19.82 rewrite_ thy ((snd o #rew_ord o rep_rls) ruless)
19.83 rls put_asm thm' ct;
19.84 - val _ = if pairopt <> None then ()
19.85 + val _ = if pairopt <> NONE then ()
19.86 else raise error("rewrite_set_, rewrite_ \""^
19.87 (string_of_thmI thm')^"\" \""^
19.88 - (Sign.string_of_term (sign_of thy) ct)^"\" = None")
19.89 + (Sign.string_of_term (sign_of thy) ct)^"\" = NONE")
19.90 in rew_once ruls asm ((fst o the) pairopt) Appl(rul::thms) end);
19.91 val ruls = (#rules o rep_rls) ruless;
19.92 val (ct',asm') = rew_once ruls [] ct Noap ruls;
19.93 - in if ct = ct' then None else Some (ct',asm') end;
19.94 + in if ct = ct' then NONE else SOME (ct',asm') end;
19.95
19.96 realpow_two;
19.97 real_mult_div_cancel1;
20.1 --- a/src/Tools/isac/IsacKnowledge/Rational.ML Wed Aug 18 13:53:15 2010 +0200
20.2 +++ b/src/Tools/isac/IsacKnowledge/Rational.ML Wed Aug 18 13:55:23 2010 +0200
20.3 @@ -1279,7 +1279,7 @@
20.4 converts the term to a list of coefficients .*)
20.5 fun term2coef' (t as Free(str,_(*typ*))) v :mv_poly option =
20.6 let
20.7 - val x=ref None;
20.8 + val x=ref NONE;
20.9 val len=ref 0;
20.10 val vl=ref [];
20.11 val vh=ref [];
20.12 @@ -1287,7 +1287,7 @@
20.13 in
20.14 if is_numeral str then
20.15 (
20.16 - Some [(((the o int_of_str) str),mv_null2(v))] handle _ => None
20.17 + SOME [(((the o int_of_str) str),mv_null2(v))] handle _ => NONE
20.18 )
20.19 else (* variable *)
20.20 (
20.21 @@ -1306,7 +1306,7 @@
20.22 vh:=tl(!vh);
20.23 i:=(!i)+1
20.24 );
20.25 - Some [(1,rev(!vl))] handle _ => None
20.26 + SOME [(1,rev(!vl))] handle _ => NONE
20.27 )
20.28 end
20.29 | term2coef' (Const ("op *",_) $ t1 $ t2) v :mv_poly option=
20.30 @@ -1322,13 +1322,13 @@
20.31 t1c:=(#1(hd(the(term2coef' t1 v))));
20.32 t2c:=(#1(hd(the(term2coef' t2 v))));
20.33
20.34 - Some [( (!t1c)*(!t2c) ,( (map op+) ((!t1pp)~~(!t2pp)) ) )] handle _ => None
20.35 + SOME [( (!t1c)*(!t2c) ,( (map op+) ((!t1pp)~~(!t2pp)) ) )] handle _ => NONE
20.36
20.37 )
20.38 end
20.39 | term2coef' (Const ("Atools.pow",_) $ (t1 as Free (str1,_)) $ (t2 as Free (str2,_))) v :mv_poly option=
20.40 let
20.41 - val x=ref None;
20.42 + val x=ref NONE;
20.43 val len=ref 0;
20.44 val vl=ref [];
20.45 val vh=ref [];
20.46 @@ -1354,18 +1354,18 @@
20.47 vh:=tl(!vh);
20.48 i:=(!i)+1
20.49 );
20.50 - Some [(1,rev(!vl))] handle _ => None
20.51 + SOME [(1,rev(!vl))] handle _ => NONE
20.52 )
20.53 else raise error ("RATIONALS_TERM2COEF_EXCEPTION 1: Invalid term")
20.54 )
20.55 end
20.56 | term2coef' (Const ("op +",_) $ t1 $ t2) v :mv_poly option=
20.57 (
20.58 - Some ((the(term2coef' t1 v)) @ (the(term2coef' t2 v))) handle _ => None
20.59 + SOME ((the(term2coef' t1 v)) @ (the(term2coef' t2 v))) handle _ => NONE
20.60 )
20.61 | term2coef' (Const ("op -",_) $ t1 $ t2) v :mv_poly option=
20.62 (
20.63 - Some ((the(term2coef' t1 v)) @ mv_skalar_mul((the(term2coef' t2 v)),1)) handle _ => None
20.64 + SOME ((the(term2coef' t1 v)) @ mv_skalar_mul((the(term2coef' t2 v)),1)) handle _ => NONE
20.65 )
20.66 | term2coef' (term) v = raise error ("RATIONALS_TERM2COEF_EXCEPTION 2: Invalid term");
20.67
20.68 @@ -1387,12 +1387,12 @@
20.69 (*. this function converts the term representation into the internal representation mv_poly .*)
20.70 fun term2poly' (Const ("uminus",_) $ Free (str,_)) v = (*WN.7.3.03*)
20.71 if is_numeral str
20.72 - then Some [((the o int_of_str) ("-"^str), mk_monom "#" 0 v)]
20.73 - else Some [(~1, mk_monom str 1 v)]
20.74 + then SOME [((the o int_of_str) ("-"^str), mk_monom "#" 0 v)]
20.75 + else SOME [(~1, mk_monom str 1 v)]
20.76
20.77 | term2poly' (Free(str,_)) v :mv_poly option =
20.78 let
20.79 - val x=ref None;
20.80 + val x=ref NONE;
20.81 val len=ref 0;
20.82 val vl=ref [];
20.83 val vh=ref [];
20.84 @@ -1400,7 +1400,7 @@
20.85 in
20.86 if is_numeral str then
20.87 (
20.88 - Some [(((the o int_of_str) str),mv_null2 v)] handle _ => None
20.89 + SOME [(((the o int_of_str) str),mv_null2 v)] handle _ => NONE
20.90 )
20.91 else (* variable *)
20.92 (
20.93 @@ -1419,7 +1419,7 @@
20.94 vh:=tl(!vh);
20.95 i:=(!i)+1
20.96 );
20.97 - Some [(1,rev(!vl))] handle _ => None
20.98 + SOME [(1,rev(!vl))] handle _ => NONE
20.99 )
20.100 end
20.101 | term2poly' (Const ("op *",_) $ t1 $ t2) v :mv_poly option=
20.102 @@ -1435,15 +1435,15 @@
20.103 t1c:=(#1(hd(the(term2poly' t1 v))));
20.104 t2c:=(#1(hd(the(term2poly' t2 v))));
20.105
20.106 - Some [( (!t1c)*(!t2c) ,( (map op+) ((!t1pp)~~(!t2pp)) ) )]
20.107 - handle _ => None
20.108 + SOME [( (!t1c)*(!t2c) ,( (map op+) ((!t1pp)~~(!t2pp)) ) )]
20.109 + handle _ => NONE
20.110
20.111 )
20.112 end
20.113 | term2poly' (Const ("Atools.pow",_) $ (t1 as Free (str1,_)) $
20.114 (t2 as Free (str2,_))) v :mv_poly option=
20.115 let
20.116 - val x=ref None;
20.117 + val x=ref NONE;
20.118 val len=ref 0;
20.119 val vl=ref [];
20.120 val vh=ref [];
20.121 @@ -1469,18 +1469,18 @@
20.122 vh:=tl(!vh);
20.123 i:=(!i)+1
20.124 );
20.125 - Some [(1,rev(!vl))] handle _ => None
20.126 + SOME [(1,rev(!vl))] handle _ => NONE
20.127 )
20.128 else raise error ("RATIONALS_TERM2POLY_EXCEPTION 1: Invalid term")
20.129 )
20.130 end
20.131 | term2poly' (Const ("op +",_) $ t1 $ t2) v :mv_poly option =
20.132 (
20.133 - Some ((the(term2poly' t1 v)) @ (the(term2poly' t2 v))) handle _ => None
20.134 + SOME ((the(term2poly' t1 v)) @ (the(term2poly' t2 v))) handle _ => NONE
20.135 )
20.136 | term2poly' (Const ("op -",_) $ t1 $ t2) v :mv_poly option =
20.137 (
20.138 - Some ((the(term2poly' t1 v)) @ mv_skalar_mul((the(term2poly' t2 v)),~1)) handle _ => None
20.139 + SOME ((the(term2poly' t1 v)) @ mv_skalar_mul((the(term2poly' t2 v)),~1)) handle _ => NONE
20.140 )
20.141 | term2poly' (term) v = raise error ("RATIONALS_TERM2POLY_EXCEPTION 2: Invalid term");
20.142
20.143 @@ -1490,7 +1490,7 @@
20.144 string list -> (*for ...!!! BITTE DIE ERKLÄRUNG,
20.145 DIE DU MIR LETZTES MAL GEGEBEN HAST*)
20.146 mv_monom list (*internal representation *)
20.147 - option (*the translation may fail with None*)
20.148 + option (*the translation may fail with NONE*)
20.149 .*)
20.150 fun term2poly (t:term) v =
20.151 if is_polynomial t then term2poly' t v
20.152 @@ -1660,16 +1660,16 @@
20.153 (let
20.154 val vars=(((map free2str) o vars) t);
20.155 in
20.156 - Some (poly2expanded (the (term2poly t vars), vars))
20.157 - end) handle _ => None;
20.158 + SOME (poly2expanded (the (term2poly t vars), vars))
20.159 + end) handle _ => NONE;
20.160
20.161 (*. converts a polynomial into polynomial form .*)
20.162 fun expanded2polynomial t =
20.163 (let
20.164 val vars=(((map free2str) o vars) t);
20.165 in
20.166 - Some (poly2term (the (expanded2poly t vars), vars))
20.167 - end) handle _ => None;
20.168 + SOME (poly2term (the (expanded2poly t vars), vars))
20.169 + end) handle _ => NONE;
20.170
20.171
20.172 (*. calculates the greatest common divisor of numerator and denominator and seperates it from each .*)
20.173 @@ -2623,32 +2623,32 @@
20.174
20.175 (*.factors out the gcd of nominator and denominator:
20.176 a/b = (a' * gcd)/(b' * gcd), a,b,gcd are poly[2].*)
20.177 -fun factout_p_ (thy:theory) t = Some (step_cancel t,[]:term list);
20.178 -fun factout_ (thy:theory) t = Some (step_cancel_expanded t,[]:term list);
20.179 +fun factout_p_ (thy:theory) t = SOME (step_cancel t,[]:term list);
20.180 +fun factout_ (thy:theory) t = SOME (step_cancel_expanded t,[]:term list);
20.181
20.182 (*.cancels a single fraction with normalform [2]
20.183 resulting in a canceled fraction [2], see factout_ .*)
20.184 -fun cancel_p_ (thy:theory) t = (*WN.2.6.03 no rewrite -> None !*)
20.185 +fun cancel_p_ (thy:theory) t = (*WN.2.6.03 no rewrite -> NONE !*)
20.186 (let val (t',asm) = direct_cancel(*_expanded ... corrected MG.21.8.03*) t
20.187 - in if t = t' then None else Some (t',asm)
20.188 - end) handle _ => None;
20.189 + in if t = t' then NONE else SOME (t',asm)
20.190 + end) handle _ => NONE;
20.191 (*.the same as above with normalform [3]
20.192 val cancel_ :
20.193 theory -> (*10.02 unused *)
20.194 term -> (*fraction in normalform [3] *)
20.195 (term * (*fraction in normalform [3] *)
20.196 term list) (*casual asumptions in normalform [3] *)
20.197 - option (*None: the function is not applicable *).*)
20.198 -fun cancel_ (thy:theory) t = Some (direct_cancel_expanded t) handle _ => None;
20.199 + option (*NONE: the function is not applicable *).*)
20.200 +fun cancel_ (thy:theory) t = SOME (direct_cancel_expanded t) handle _ => NONE;
20.201
20.202 (*.transforms sums of at least 2 fractions [3] to
20.203 sums with the least common multiple as nominator.*)
20.204 fun common_nominator_p_ (thy:theory) t =
20.205 ((*writeln("### common_nominator_p_ called");*)
20.206 - Some (step_add_list_of_fractions(term2list(t))) handle _ => None
20.207 + SOME (step_add_list_of_fractions(term2list(t))) handle _ => NONE
20.208 );
20.209 fun common_nominator_ (thy:theory) t =
20.210 - Some (step_add_list_of_fractions_exp(term2list(t))) handle _ => None;
20.211 + SOME (step_add_list_of_fractions_exp(term2list(t))) handle _ => NONE;
20.212
20.213 (*.add 2 or more fractions
20.214 val add_fraction_p_ :
20.215 @@ -2656,35 +2656,35 @@
20.216 term -> (*2 or more fractions with normalform [2] *)
20.217 (term * (*one fraction with normalform [2] *)
20.218 term list) (*casual assumptions in normalform [2] WN0210???SK *)
20.219 - option (*None: the function is not applicable *).*)
20.220 + option (*NONE: the function is not applicable *).*)
20.221 fun add_fraction_p_ (thy:theory) t =
20.222 (writeln("### add_fraction_p_ called");
20.223 (let val ts = term2list t
20.224 in if 1 < length ts
20.225 - then Some (add_list_of_fractions ts)
20.226 - else None (*raise error ("RATIONALS_ADD_EXCEPTION: nothing to add")*)
20.227 - end) handle _ => None
20.228 + then SOME (add_list_of_fractions ts)
20.229 + else NONE (*raise error ("RATIONALS_ADD_EXCEPTION: nothing to add")*)
20.230 + end) handle _ => NONE
20.231 );
20.232 (*.same as add_fraction_p_ but with normalform [3].*)
20.233 -(*Some (step_add_list_of_fractions2(term2list(t))); *)
20.234 +(*SOME (step_add_list_of_fractions2(term2list(t))); *)
20.235 fun add_fraction_ (thy:theory) t =
20.236 if length(term2list(t))>1
20.237 - then Some (add_list_of_fractions_exp(term2list(t))) handle _ => None
20.238 + then SOME (add_list_of_fractions_exp(term2list(t))) handle _ => NONE
20.239 else (*raise error ("RATIONALS_ADD_FRACTION_EXCEPTION: nothing to add")*)
20.240 - None;
20.241 + NONE;
20.242 fun add_fraction_ (thy:theory) t =
20.243 (if 1 < length (term2list t)
20.244 - then Some (add_list_of_fractions_exp (term2list t))
20.245 + then SOME (add_list_of_fractions_exp (term2list t))
20.246 else (*raise error ("RATIONALS_ADD_FRACTION_EXCEPTION: nothing to add")*)
20.247 - None) handle _ => None;
20.248 -
20.249 -(*Some (step_add_list_of_fractions2_exp(term2list(t))); *)
20.250 + NONE) handle _ => NONE;
20.251 +
20.252 +(*SOME (step_add_list_of_fractions2_exp(term2list(t))); *)
20.253
20.254 (*. brings the term into a normal form .*)
20.255 fun norm_rational_ (thy:theory) t =
20.256 - Some (add_list_of_fractions(term2list(t))) handle _ => None;
20.257 + SOME (add_list_of_fractions(term2list(t))) handle _ => NONE;
20.258 fun norm_expanded_rat_ (thy:theory) t =
20.259 - Some (add_list_of_fractions_exp(term2list(t))) handle _ => None;
20.260 + SOME (add_list_of_fractions_exp(term2list(t))) handle _ => NONE;
20.261
20.262
20.263 (*.evaluates conditions in calculate_Rational.*)
20.264 @@ -2759,13 +2759,13 @@
20.265 fun eval_is_expanded (thmid:string) _
20.266 (t as (Const("Rational.is'_expanded", _) $ arg)) thy =
20.267 if is_expanded arg
20.268 - then Some (mk_thmid thmid ""
20.269 + then SOME (mk_thmid thmid ""
20.270 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
20.271 Trueprop $ (mk_equality (t, HOLogic.true_const)))
20.272 - else Some (mk_thmid thmid ""
20.273 + else SOME (mk_thmid thmid ""
20.274 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
20.275 Trueprop $ (mk_equality (t, HOLogic.false_const)))
20.276 - | eval_is_expanded _ _ _ _ = None;
20.277 + | eval_is_expanded _ _ _ _ = NONE;
20.278
20.279 val rational_erls =
20.280 merge_rls "rational_erls" calculate_Rational
20.281 @@ -2839,9 +2839,9 @@
20.282 val t = t;
20.283 *)
20.284 fun init_state thy eval_rls ro t =
20.285 - let val Some (t',_) = factout_p_ thy t
20.286 - val Some (t'',asm) = cancel_p_ thy t
20.287 - val der = reverse_deriv thy eval_rls rules ro None t'
20.288 + let val SOME (t',_) = factout_p_ thy t
20.289 + val SOME (t'',asm) = cancel_p_ thy t
20.290 + val der = reverse_deriv thy eval_rls rules ro NONE t'
20.291 val der = der @ [(Thm ("real_mult_div_cancel2",
20.292 num_str real_mult_div_cancel2),
20.293 (t'',asm))]
20.294 @@ -2876,9 +2876,9 @@
20.295 then let val ropt =
20.296 rewrite_ thy ro eval_rls true (thm_of_thm r) t;
20.297 in case ropt of
20.298 - Some ta => [(r, ta)]
20.299 - | None => (writeln("### locate_rule: rewrite "^
20.300 - (id_of_thm r)^" "^(term2str t)^" = None");
20.301 + SOME ta => [(r, ta)]
20.302 + | NONE => (writeln("### locate_rule: rewrite "^
20.303 + (id_of_thm r)^" "^(term2str t)^" = NONE");
20.304 []) end
20.305 else (writeln("### locate_rule: "^(id_of_thm r)^" not mem rrls");[])
20.306 | locate_rule _ _ _ _ _ _ =
20.307 @@ -2902,12 +2902,12 @@
20.308 nex [rs] t;
20.309 *)
20.310 fun next_rule thy eval_rls ro [rs] t =
20.311 - let val der = make_deriv thy eval_rls rs ro None t;
20.312 + let val der = make_deriv thy eval_rls rs ro NONE t;
20.313 in case der of
20.314 (* val (_,r,_)::_ = der;
20.315 *)
20.316 - (_,r,_)::_ => Some r
20.317 - | _ => None
20.318 + (_,r,_)::_ => SOME r
20.319 + | _ => NONE
20.320 end
20.321 | next_rule _ _ _ _ _ =
20.322 raise error ("next_rule: doesnt match rev-sets in istate");
20.323 @@ -2962,7 +2962,7 @@
20.324 (*WN 24.8.02: wir werden "uberlegen, wie wir ungeeignete inputs zur"uckweisen*)
20.325
20.326 (*
20.327 -val Some (Rls {rules=rules,rew_ord=(_,ro),...}) =
20.328 +val SOME (Rls {rules=rules,rew_ord=(_,ro),...}) =
20.329 assoc'(!ruleset',"expand_binoms");
20.330 *)
20.331 val {rules=rules,rew_ord=(_,ro),...} =
20.332 @@ -2970,9 +2970,9 @@
20.333 val thy = Rational.thy;
20.334
20.335 fun init_state thy eval_rls ro t =
20.336 - let val Some (t',_) = factout_ thy t;
20.337 - val Some (t'',asm) = cancel_ thy t;
20.338 - val der = reverse_deriv thy eval_rls rules ro None t';
20.339 + let val SOME (t',_) = factout_ thy t;
20.340 + val SOME (t'',asm) = cancel_ thy t;
20.341 + val der = reverse_deriv thy eval_rls rules ro NONE t';
20.342 val der = der @ [(Thm ("real_mult_div_cancel2",
20.343 num_str real_mult_div_cancel2),
20.344 (t'',asm))]
20.345 @@ -2984,21 +2984,21 @@
20.346 then let val ropt =
20.347 rewrite_ thy ro eval_rls true (thm_of_thm r) t;
20.348 in case ropt of
20.349 - Some ta => [(r, ta)]
20.350 - | None => (writeln("### locate_rule: rewrite "^
20.351 - (id_of_thm r)^" "^(term2str t)^" = None");
20.352 + SOME ta => [(r, ta)]
20.353 + | NONE => (writeln("### locate_rule: rewrite "^
20.354 + (id_of_thm r)^" "^(term2str t)^" = NONE");
20.355 []) end
20.356 else (writeln("### locate_rule: "^(id_of_thm r)^" not mem rrls");[])
20.357 | locate_rule _ _ _ _ _ _ =
20.358 raise error ("locate_rule: doesnt match rev-sets in istate");
20.359
20.360 fun next_rule thy eval_rls ro [rs] t =
20.361 - let val der = make_deriv thy eval_rls rs ro None t;
20.362 + let val der = make_deriv thy eval_rls rs ro NONE t;
20.363 in case der of
20.364 (* val (_,r,_)::_ = der;
20.365 *)
20.366 - (_,r,_)::_ => Some r
20.367 - | _ => None
20.368 + (_,r,_)::_ => SOME r
20.369 + | _ => NONE
20.370 end
20.371 | next_rule _ _ _ _ _ =
20.372 raise error ("next_rule: doesnt match rev-sets in istate");
20.373 @@ -3064,9 +3064,9 @@
20.374 in reverse order with sym_thm;
20.375 (#) could be extracted from here by (map #1)*).*)
20.376 fun init_state thy eval_rls ro t =
20.377 - let val Some (t',_) = common_nominator_p_ thy t;
20.378 - val Some (t'',asm) = add_fraction_p_ thy t;
20.379 - val der = reverse_deriv thy eval_rls rules ro None t';
20.380 + let val SOME (t',_) = common_nominator_p_ thy t;
20.381 + val SOME (t'',asm) = add_fraction_p_ thy t;
20.382 + val der = reverse_deriv thy eval_rls rules ro NONE t';
20.383 val der = der @ [(Thm ("real_mult_div_cancel2",
20.384 num_str real_mult_div_cancel2),
20.385 (t'',asm))]
20.386 @@ -3103,9 +3103,9 @@
20.387 then let val ropt =
20.388 rewrite_ thy ro eval_rls true (thm_of_thm r) t;
20.389 in case ropt of
20.390 - Some ta => [(r, ta)]
20.391 - | None => (writeln("### locate_rule: rewrite "^
20.392 - (id_of_thm r)^" "^(term2str t)^" = None");
20.393 + SOME ta => [(r, ta)]
20.394 + | NONE => (writeln("### locate_rule: rewrite "^
20.395 + (id_of_thm r)^" "^(term2str t)^" = NONE");
20.396 []) end
20.397 else (writeln("### locate_rule: "^(id_of_thm r)^" not mem rrls");[])
20.398 | locate_rule _ _ _ _ _ _ =
20.399 @@ -3129,12 +3129,12 @@
20.400 nex [rs] t;
20.401 *)
20.402 fun next_rule thy eval_rls ro [rs] t =
20.403 - let val der = make_deriv thy eval_rls rs ro None t;
20.404 + let val der = make_deriv thy eval_rls rs ro NONE t;
20.405 in case der of
20.406 (* val (_,r,_)::_ = der;
20.407 *)
20.408 - (_,r,_)::_ => Some r
20.409 - | _ => None
20.410 + (_,r,_)::_ => SOME r
20.411 + | _ => NONE
20.412 end
20.413 | next_rule _ _ _ _ _ =
20.414 raise error ("next_rule: doesnt match rev-sets in istate");
20.415 @@ -3213,9 +3213,9 @@
20.416 in reverse order with sym_thm;
20.417 (#) could be extracted from here by (map #1)*).*)
20.418 fun init_state thy eval_rls ro t =
20.419 - let val Some (t',_) = common_nominator_ thy t;
20.420 - val Some (t'',asm) = add_fraction_ thy t;
20.421 - val der = reverse_deriv thy eval_rls rules ro None t';
20.422 + let val SOME (t',_) = common_nominator_ thy t;
20.423 + val SOME (t'',asm) = add_fraction_ thy t;
20.424 + val der = reverse_deriv thy eval_rls rules ro NONE t';
20.425 val der = der @ [(Thm ("real_mult_div_cancel2",
20.426 num_str real_mult_div_cancel2),
20.427 (t'',asm))]
20.428 @@ -3252,9 +3252,9 @@
20.429 then let val ropt =
20.430 rewrite_ thy ro eval_rls true (thm_of_thm r) t;
20.431 in case ropt of
20.432 - Some ta => [(r, ta)]
20.433 - | None => (writeln("### locate_rule: rewrite "^
20.434 - (id_of_thm r)^" "^(term2str t)^" = None");
20.435 + SOME ta => [(r, ta)]
20.436 + | NONE => (writeln("### locate_rule: rewrite "^
20.437 + (id_of_thm r)^" "^(term2str t)^" = NONE");
20.438 []) end
20.439 else (writeln("### locate_rule: "^(id_of_thm r)^" not mem rrls");[])
20.440 | locate_rule _ _ _ _ _ _ =
20.441 @@ -3278,12 +3278,12 @@
20.442 nex [rs] t;
20.443 *)
20.444 fun next_rule thy eval_rls ro [rs] t =
20.445 - let val der = make_deriv thy eval_rls rs ro None t;
20.446 + let val der = make_deriv thy eval_rls rs ro NONE t;
20.447 in case der of
20.448 (* val (_,r,_)::_ = der;
20.449 *)
20.450 - (_,r,_)::_ => Some r
20.451 - | _ => None
20.452 + (_,r,_)::_ => SOME r
20.453 + | _ => NONE
20.454 end
20.455 | next_rule _ _ _ _ _ =
20.456 raise error ("next_rule: doesnt match rev-sets in istate");
20.457 @@ -3369,13 +3369,13 @@
20.458 fun eval_is_ratpolyexp (thmid:string) _
20.459 (t as (Const("Rational.is'_ratpolyexp", _) $ arg)) thy =
20.460 if is_ratpolyexp arg
20.461 - then Some (mk_thmid thmid ""
20.462 + then SOME (mk_thmid thmid ""
20.463 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
20.464 Trueprop $ (mk_equality (t, HOLogic.true_const)))
20.465 - else Some (mk_thmid thmid ""
20.466 + else SOME (mk_thmid thmid ""
20.467 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
20.468 Trueprop $ (mk_equality (t, HOLogic.false_const)))
20.469 - | eval_is_ratpolyexp _ _ _ _ = None;
20.470 + | eval_is_ratpolyexp _ _ _ _ = NONE;
20.471
20.472
20.473
20.474 @@ -3734,7 +3734,7 @@
20.475 ("#Find" ,["normalform n_"])
20.476 ],
20.477 append_rls "e_rls" e_rls [(*for preds in where_*)],
20.478 - Some "Simplify t_",
20.479 + SOME "Simplify t_",
20.480 [["simplification","of_rationals"]]));
20.481
20.482 (** methods **)
21.1 --- a/src/Tools/isac/IsacKnowledge/Root.ML Wed Aug 18 13:53:15 2010 +0200
21.2 +++ b/src/Tools/isac/IsacKnowledge/Root.ML Wed Aug 18 13:55:23 2010 +0200
21.3 @@ -25,17 +25,17 @@
21.4 (case arg of
21.5 Free (n1,t1) =>
21.6 (case int_of_str n1 of
21.7 - Some ni =>
21.8 - if ni < 0 then None
21.9 + SOME ni =>
21.10 + if ni < 0 then NONE
21.11 else
21.12 let val fact = squfact ni;
21.13 in if fact*fact = ni
21.14 - then Some ("#sqrt #"^(string_of_int ni)^" = #"
21.15 + then SOME ("#sqrt #"^(string_of_int ni)^" = #"
21.16 ^(string_of_int (if ni = 0 then 0
21.17 else ni div fact)),
21.18 Trueprop $ mk_equality (t, term_of_num t1 fact))
21.19 - else if fact = 1 then None
21.20 - else Some ("#sqrt #"^(string_of_int ni)^" = sqrt (#"
21.21 + else if fact = 1 then NONE
21.22 + else SOME ("#sqrt #"^(string_of_int ni)^" = sqrt (#"
21.23 ^(string_of_int fact)^" * #"
21.24 ^(string_of_int fact)^" * #"
21.25 ^(string_of_int (ni div (fact*fact))^")"),
21.26 @@ -45,14 +45,14 @@
21.27 (mk_factroot op0 t1 fact
21.28 (ni div (fact*fact))))))
21.29 end
21.30 - | None => None)
21.31 - | _ => None)
21.32 + | NONE => NONE)
21.33 + | _ => NONE)
21.34
21.35 - | eval_sqrt _ _ _ _ = None;
21.36 + | eval_sqrt _ _ _ _ = NONE;
21.37 (*val (thmid, op_, t as Const(op0,t0) $ arg) = ("","", str2term "sqrt 0");
21.38 > eval_sqrt thmid op_ t thy;
21.39 > val Free (n1,t1) = arg;
21.40 -> val Some ni = int_of_str n1;
21.41 +> val SOME ni = int_of_str n1;
21.42 *)
21.43
21.44 calclist':= overwritel (!calclist',
22.1 --- a/src/Tools/isac/IsacKnowledge/RootEq.ML Wed Aug 18 13:53:15 2010 +0200
22.2 +++ b/src/Tools/isac/IsacKnowledge/RootEq.ML Wed Aug 18 13:55:23 2010 +0200
22.3 @@ -69,27 +69,27 @@
22.4
22.5 fun eval_is_rootTerm_in _ _ (p as (Const ("RootEq.is'_rootTerm'_in",_) $ t $ v)) _ =
22.6 if is_rootTerm_in t v then
22.7 - Some ((term2str p) ^ " = True",
22.8 + SOME ((term2str p) ^ " = True",
22.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
22.10 - else Some ((term2str p) ^ " = True",
22.11 + else SOME ((term2str p) ^ " = True",
22.12 Trueprop $ (mk_equality (p, HOLogic.false_const)))
22.13 - | eval_is_rootTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) None);
22.14 + | eval_is_rootTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) NONE);
22.15
22.16 fun eval_is_sqrtTerm_in _ _ (p as (Const ("RootEq.is'_sqrtTerm'_in",_) $ t $ v)) _ =
22.17 if is_sqrtTerm_in t v then
22.18 - Some ((term2str p) ^ " = True",
22.19 + SOME ((term2str p) ^ " = True",
22.20 Trueprop $ (mk_equality (p, HOLogic.true_const)))
22.21 - else Some ((term2str p) ^ " = True",
22.22 + else SOME ((term2str p) ^ " = True",
22.23 Trueprop $ (mk_equality (p, HOLogic.false_const)))
22.24 - | eval_is_sqrtTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) None);
22.25 + | eval_is_sqrtTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) NONE);
22.26
22.27 fun eval_is_normSqrtTerm_in _ _ (p as (Const ("RootEq.is'_normSqrtTerm'_in",_) $ t $ v)) _ =
22.28 if is_normSqrtTerm_in t v then
22.29 - Some ((term2str p) ^ " = True",
22.30 + SOME ((term2str p) ^ " = True",
22.31 Trueprop $ (mk_equality (p, HOLogic.true_const)))
22.32 - else Some ((term2str p) ^ " = True",
22.33 + else SOME ((term2str p) ^ " = True",
22.34 Trueprop $ (mk_equality (p, HOLogic.false_const)))
22.35 - | eval_is_normSqrtTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) None);
22.36 + | eval_is_normSqrtTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) NONE);
22.37
22.38 (*-------------------------rulse-------------------------*)
22.39 val RootEq_prls = (*15.10.02:just the following order due to subterm evaluation*)
22.40 @@ -323,7 +323,7 @@
22.41 \(rhs e_) is_rootTerm_in (v_::real)"]),
22.42 ("#Find" ,["solutions v_i_"])
22.43 ],
22.44 - RootEq_prls, Some "solve (e_::bool, v_)",
22.45 + RootEq_prls, SOME "solve (e_::bool, v_)",
22.46 []));
22.47 (* ---------sqrt----------- *)
22.48 store_pbt
22.49 @@ -336,7 +336,7 @@
22.50 \ ((rhs e_) is_normSqrtTerm_in (v_::real)) )"]),
22.51 ("#Find" ,["solutions v_i_"])
22.52 ],
22.53 - RootEq_prls, Some "solve (e_::bool, v_)",
22.54 + RootEq_prls, SOME "solve (e_::bool, v_)",
22.55 [["RootEq","solve_sq_root_equation"]]));
22.56 (* ---------normalize----------- *)
22.57 store_pbt
22.58 @@ -349,7 +349,7 @@
22.59 \ Not((rhs e_) is_normSqrtTerm_in (v_::real)))"]),
22.60 ("#Find" ,["solutions v_i_"])
22.61 ],
22.62 - RootEq_prls, Some "solve (e_::bool, v_)",
22.63 + RootEq_prls, SOME "solve (e_::bool, v_)",
22.64 [["RootEq","norm_sq_root_equation"]]));
22.65
22.66 (*-------------------------methods-----------------------*)
23.1 --- a/src/Tools/isac/IsacKnowledge/RootRatEq.ML Wed Aug 18 13:53:15 2010 +0200
23.2 +++ b/src/Tools/isac/IsacKnowledge/RootRatEq.ML Wed Aug 18 13:55:23 2010 +0200
23.3 @@ -45,11 +45,11 @@
23.4
23.5 fun eval_is_rootRatAddTerm_in _ _ (p as (Const ("RootRatEq.is'_rootRatAddTerm'_in",_) $ t $ v)) _ =
23.6 if is_rootRatAddTerm_in t v then
23.7 - Some ((term2str p) ^ " = True",
23.8 + SOME ((term2str p) ^ " = True",
23.9 Trueprop $ (mk_equality (p, HOLogic.true_const)))
23.10 - else Some ((term2str p) ^ " = True",
23.11 + else SOME ((term2str p) ^ " = True",
23.12 Trueprop $ (mk_equality (p, HOLogic.false_const)))
23.13 - | eval_is_rootRatAddTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) None);
23.14 + | eval_is_rootRatAddTerm_in _ _ _ _ = ((*writeln"### nichts matcht";*) NONE);
23.15
23.16 (*-------------------------rulse-------------------------*)
23.17 val RootRatEq_prls =
23.18 @@ -121,7 +121,7 @@
23.19 \( (rhs e_) is_rootRatAddTerm_in (v_::real) )"]),
23.20 ("#Find" ,["solutions v_i_"])
23.21 ],
23.22 - RootRatEq_prls, Some "solve (e_::bool, v_)",
23.23 + RootRatEq_prls, SOME "solve (e_::bool, v_)",
23.24 [["RootRatEq","elim_rootrat_equation"]]));
23.25
23.26 (*-------------------------Methode-----------------------*)
24.1 --- a/src/Tools/isac/IsacKnowledge/Simplify.ML Wed Aug 18 13:53:15 2010 +0200
24.2 +++ b/src/Tools/isac/IsacKnowledge/Simplify.ML Wed Aug 18 13:55:23 2010 +0200
24.3 @@ -20,7 +20,7 @@
24.4 ("#Find" ,["normalform n_"])
24.5 ],
24.6 append_rls "e_rls" e_rls [(*for preds in where_*)],
24.7 - Some "Simplify t_",
24.8 + SOME "Simplify t_",
24.9 []));
24.10
24.11 store_pbt
24.12 @@ -30,7 +30,7 @@
24.13 ("#Find" ,["normalform n_"])
24.14 ],
24.15 append_rls "e_rls" e_rls [(*for preds in where_*)],
24.16 - Some "Vereinfache t_",
24.17 + SOME "Vereinfache t_",
24.18 []));
24.19
24.20 (** methods **)
25.1 --- a/src/Tools/isac/IsacKnowledge/Test.ML Wed Aug 18 13:53:15 2010 +0200
25.2 +++ b/src/Tools/isac/IsacKnowledge/Test.ML Wed Aug 18 13:55:23 2010 +0200
25.3 @@ -17,25 +17,25 @@
25.4 if strip_thy op0 <> "is'_root'_free"
25.5 then raise error ("eval_root_free: wrong "^op0)
25.6 else if const_in (strip_thy op0) arg
25.7 - then Some (mk_thmid thmid ""
25.8 + then SOME (mk_thmid thmid ""
25.9 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
25.10 Trueprop $ (mk_equality (t, false_as_term)))
25.11 - else Some (mk_thmid thmid ""
25.12 + else SOME (mk_thmid thmid ""
25.13 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
25.14 Trueprop $ (mk_equality (t, true_as_term)))
25.15 - | eval_root_free _ _ _ _ = None;
25.16 + | eval_root_free _ _ _ _ = NONE;
25.17
25.18 (*does a term contain a root ?*)
25.19 fun eval_contains_root (thmid:string) _
25.20 (t as (Const("Test.contains'_root",t0) $ arg)) thy =
25.21 if "sqrt" mem (ids_of arg)
25.22 - then Some (mk_thmid thmid ""
25.23 + then SOME (mk_thmid thmid ""
25.24 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
25.25 Trueprop $ (mk_equality (t, true_as_term)))
25.26 - else Some (mk_thmid thmid ""
25.27 + else SOME (mk_thmid thmid ""
25.28 ((string_of_cterm o cterm_of (sign_of thy)) arg) "",
25.29 Trueprop $ (mk_equality (t, false_as_term)))
25.30 - | eval_contains_root _ _ _ _ = None;
25.31 + | eval_contains_root _ _ _ _ = NONE;
25.32
25.33 calclist':= overwritel (!calclist',
25.34 [("is_root_free", ("Test.is'_root'_free",
25.35 @@ -354,7 +354,7 @@
25.36 (prep_pbt Test.thy "pbl_test" [] e_pblID
25.37 (["test"],
25.38 [],
25.39 - e_rls, None, []));
25.40 + e_rls, NONE, []));
25.41 store_pbt
25.42 (prep_pbt Test.thy "pbl_test_equ" [] e_pblID
25.43 (["equation","test"],
25.44 @@ -363,7 +363,7 @@
25.45 ("#Find" ,["solutions v_i_"])
25.46 ],
25.47 assoc_rls "matches",
25.48 - Some "solve (e_::bool, v_)", []));
25.49 + SOME "solve (e_::bool, v_)", []));
25.50
25.51 store_pbt
25.52 (prep_pbt Test.thy "pbl_test_uni" [] e_pblID
25.53 @@ -373,7 +373,7 @@
25.54 ("#Find" ,["solutions v_i_"])
25.55 ],
25.56 assoc_rls "matches",
25.57 - Some "solve (e_::bool, v_)", []));
25.58 + SOME "solve (e_::bool, v_)", []));
25.59
25.60 store_pbt
25.61 (prep_pbt Test.thy "pbl_test_uni_lin" [] e_pblID
25.62 @@ -384,7 +384,7 @@
25.63 ("#Find" ,["solutions v_i_"])
25.64 ],
25.65 assoc_rls "matches",
25.66 - Some "solve (e_::bool, v_)", [["Test","solve_linear"]]));
25.67 + SOME "solve (e_::bool, v_)", [["Test","solve_linear"]]));
25.68
25.69 (*25.8.01 ------
25.70 store_pbt
25.71 @@ -567,11 +567,11 @@
25.72 then max (deg addl mul v t1 ,deg addl mul v t2)
25.73 else (*mul!*)(deg addl mul v t1)+(deg addl mul v t2)
25.74 in if polynomial (addl @ [mul]) t bdVar
25.75 - then Some (deg addl mul (id_of bdVar) t) else (None:int option)
25.76 + then SOME (deg addl mul (id_of bdVar) t) else (NONE:int option)
25.77 end;
25.78 fun degree_ addl mul bdVar t = (* do not export *)
25.79 - let fun opt (Some i)= i
25.80 - | opt None = 0
25.81 + let fun opt (SOME i)= i
25.82 + | opt NONE = 0
25.83 in opt (degree addl mul bdVar t) end;
25.84
25.85
25.86 @@ -621,7 +621,7 @@
25.87 ("#Find" ,["solutions v_i_"])
25.88 ],
25.89 assoc_rls "matches",
25.90 - Some "solve (e_::bool, v_)", [["Test","solve_plain_square"]]));
25.91 + SOME "solve (e_::bool, v_)", [["Test","solve_plain_square"]]));
25.92 (*
25.93 val e_ = (term_of o the o (parse thy)) "e_::bool";
25.94 val ve = (term_of o the o (parse thy)) "4 + 3*x^^^2 = 0";
25.95 @@ -635,12 +635,12 @@
25.96 val prei = subst_atomic env pre;
25.97 val cpre = cterm_of (sign_of thy) prei;
25.98
25.99 - val Some (ct,_) = rewrite_set_ thy false tval_rls cpre;
25.100 + val SOME (ct,_) = rewrite_set_ thy false tval_rls cpre;
25.101 val ct = "True | False | False | False" : cterm
25.102
25.103 -> val Some (ct,_) = rewrite_ thy sqrt_right tval_rls false or_false ct;
25.104 -> val Some (ct,_) = rewrite_ thy sqrt_right tval_rls false or_false ct;
25.105 -> val Some (ct,_) = rewrite_ thy sqrt_right tval_rls false or_false ct;
25.106 +> val SOME (ct,_) = rewrite_ thy sqrt_right tval_rls false or_false ct;
25.107 +> val SOME (ct,_) = rewrite_ thy sqrt_right tval_rls false or_false ct;
25.108 +> val SOME (ct,_) = rewrite_ thy sqrt_right tval_rls false or_false ct;
25.109 val ct = "True" : cterm
25.110
25.111 *)
25.112 @@ -652,7 +652,7 @@
25.113 ("#Where" ,["False"]),
25.114 ("#Find" ,["solutions v_i_"])
25.115 ],
25.116 - e_rls, Some "solve (e_::bool, v_)", []));
25.117 + e_rls, SOME "solve (e_::bool, v_)", []));
25.118
25.119 store_pbt
25.120 (prep_pbt Test.thy "pbl_test_uni_poly_deg2" [] e_pblID
25.121 @@ -660,7 +660,7 @@
25.122 [("#Given" ,["equality (v_ ^^^2 + p_ * v_ + q__ = 0)","solveFor v_"]),
25.123 ("#Find" ,["solutions v_i_"])
25.124 ],
25.125 - e_rls, Some "solve (v_ ^^^2 + p_ * v_ + q__ = 0, v_)", []));
25.126 + e_rls, SOME "solve (v_ ^^^2 + p_ * v_ + q__ = 0, v_)", []));
25.127
25.128 store_pbt
25.129 (prep_pbt Test.thy "pbl_test_uni_poly_deg2_pq" [] e_pblID
25.130 @@ -668,7 +668,7 @@
25.131 [("#Given" ,["equality (v_ ^^^2 + p_ * v_ + q__ = 0)","solveFor v_"]),
25.132 ("#Find" ,["solutions v_i_"])
25.133 ],
25.134 - e_rls, Some "solve (v_ ^^^2 + p_ * v_ + q__ = 0, v_)", []));
25.135 + e_rls, SOME "solve (v_ ^^^2 + p_ * v_ + q__ = 0, v_)", []));
25.136
25.137 store_pbt
25.138 (prep_pbt Test.thy "pbl_test_uni_poly_deg2_abc" [] e_pblID
25.139 @@ -676,7 +676,7 @@
25.140 [("#Given" ,["equality (a_ * x ^^^2 + b_ * x + c_ = 0)","solveFor v_"]),
25.141 ("#Find" ,["solutions v_i_"])
25.142 ],
25.143 - e_rls, Some "solve (a_ * x ^^^2 + b_ * x + c_ = 0, v_)", []));
25.144 + e_rls, SOME "solve (a_ * x ^^^2 + b_ * x + c_ = 0, v_)", []));
25.145
25.146 store_pbt
25.147 (prep_pbt Test.thy "pbl_test_uni_root" [] e_pblID
25.148 @@ -687,7 +687,7 @@
25.149 ],
25.150 append_rls "contains_root" e_rls [Calc ("Test.contains'_root",
25.151 eval_contains_root "#contains_root_")],
25.152 - Some "solve (e_::bool, v_)", [["Test","square_equation"]]));
25.153 + SOME "solve (e_::bool, v_)", [["Test","square_equation"]]));
25.154
25.155 store_pbt
25.156 (prep_pbt Test.thy "pbl_test_uni_norm" [] e_pblID
25.157 @@ -696,7 +696,7 @@
25.158 ("#Where" ,[]),
25.159 ("#Find" ,["solutions v_i_"])
25.160 ],
25.161 - e_rls, Some "solve (e_::bool, v_)", [["Test","norm_univar_equation"]]));
25.162 + e_rls, SOME "solve (e_::bool, v_)", [["Test","norm_univar_equation"]]));
25.163
25.164 store_pbt
25.165 (prep_pbt Test.thy "pbl_test_uni_roottest" [] e_pblID
25.166 @@ -705,7 +705,7 @@
25.167 (*("#Where" ,["contains_root (e_::bool)"]),*)
25.168 ("#Find" ,["solutions v_i_"])
25.169 ],
25.170 - e_rls, Some "solve (e_::bool, v_)", []));
25.171 + e_rls, SOME "solve (e_::bool, v_)", []));
25.172
25.173 (*
25.174 (#ppc o get_pbt) ["sqroot-test","univariate","equation"];
25.175 @@ -1003,8 +1003,8 @@
25.176 (* RL *)
25.177 fun get_order_pow (t $ (Free(order,_))) =
25.178 (case int_of_str (order) of
25.179 - Some d => d
25.180 - | None => 0)
25.181 + SOME d => d
25.182 + | NONE => 0)
25.183 | get_order_pow _ = 0;
25.184
25.185 fun size_of_term' (Const(str,_) $ t) =
26.1 --- a/src/Tools/isac/ME/appl.sml Wed Aug 18 13:53:15 2010 +0200
26.2 +++ b/src/Tools/isac/ME/appl.sml Wed Aug 18 13:55:23 2010 +0200
26.3 @@ -27,8 +27,8 @@
26.4 end
26.5 else ((*writeln("### from_pblobj_or_detail_thm: pbl=false");*)
26.6 (*case assoc(!ruleset', rls') of !!!FIXME.3.4.03:re-organize !!!
26.7 - None => ("unknown ruleset '"^rls'^"'","","",Erls,false)
26.8 - | Some rls =>*)
26.9 + NONE => ("unknown ruleset '"^rls'^"'","","",Erls,false)
26.10 + | SOME rls =>*)
26.11 let val thy' = get_obj g_domID pt (par_pblobj pt p)
26.12 val (rew_ord',erls,(*asm_thm,*)_) = rew_info rls'
26.13 (*val put_asm = (fst thm') mem (map fst asm_thm);*)
26.14 @@ -45,19 +45,19 @@
26.15 get_met (get_obj g_metID pt p')
26.16 val opt = assoc (scr_isa_fns, scrop)
26.17 in case opt of
26.18 - Some isa_fn => ("OK",thy',isa_fn)
26.19 - | None => ("applicable_in Calculate: unknown '"^scrop^"'",
26.20 + SOME isa_fn => ("OK",thy',isa_fn)
26.21 + | NONE => ("applicable_in Calculate: unknown '"^scrop^"'",
26.22 "",("",e_evalfn)) end
26.23 else (*case assoc(!ruleset', rls') of
26.24 - None => ("unknown ruleset '"^rls'^"'","",("",e_evalfn))
26.25 - | Some rls => !!!FIXME.3.4.03:re-organize from_pblobj_or_detai*)
26.26 - (* val Some rls = assoc(!ruleset', rls');
26.27 + NONE => ("unknown ruleset '"^rls'^"'","",("",e_evalfn))
26.28 + | SOME rls => !!!FIXME.3.4.03:re-organize from_pblobj_or_detai*)
26.29 + (* val SOME rls = assoc(!ruleset', rls');
26.30 *)
26.31 let val thy' = get_obj g_domID pt (par_pblobj pt p);
26.32 val (_,_,(*_,*)scr_isa_fns) = rew_info rls'(*rls*)
26.33 in case assoc (scr_isa_fns, scrop) of
26.34 - Some isa_fn => ("OK",thy',isa_fn)
26.35 - | None => ("applicable_in Calculate: unknown '"^scrop^"'",
26.36 + SOME isa_fn => ("OK",thy',isa_fn)
26.37 + | NONE => ("applicable_in Calculate: unknown '"^scrop^"'",
26.38 "",("",e_evalfn)) end
26.39 end;
26.40 (*------------------------------------------------------------------*)
26.41 @@ -163,12 +163,12 @@
26.42 (*before 5.03-----
26.43 > val ct = "((#0 <= #18 & #0 <= sqrt (#5 + #3) + sqrt (#5 - #3)) &\
26.44 \ #0 <= #25 + #-1 * #3 ^^^ #2) & #0 <= #4";
26.45 -> val Some(ct',_) = rewrite_set "Isac.thy" false "eval_rls" ct;
26.46 +> val SOME(ct',_) = rewrite_set "Isac.thy" false "eval_rls" ct;
26.47 val ct' = "True" : cterm'
26.48
26.49 > val ct = "((#0 <= #18 & #0 <= sqrt (#5 + #-3) + sqrt (#5 - #-3)) &\
26.50 \ #0 <= #25 + #-1 * #-3 ^^^ #2) & #0 <= #4";
26.51 -> val Some(ct',_) = rewrite_set "Isac.thy" false "eval_rls" ct;
26.52 +> val SOME(ct',_) = rewrite_set "Isac.thy" false "eval_rls" ct;
26.53 val ct' = "True" : cterm'
26.54
26.55
26.56 @@ -242,10 +242,10 @@
26.57 let val (PblObj {origin = (oris, (dI',_,_),_), ...}) = get_obj I pt p;
26.58 val opt = refine_ori oris pI;
26.59 in case opt of
26.60 - Some pblID =>
26.61 + SOME pblID =>
26.62 Appl (Refine_Tacitly' (pI, pblID,
26.63 e_domID, e_metID, [](*filled in specify*)))
26.64 - | None => Notappl ((tac2str (Refine_Tacitly pI))^
26.65 + | NONE => Notappl ((tac2str (Refine_Tacitly pI))^
26.66 " not applicable") end
26.67 (* val (p,p_) = ip;
26.68 val Refine_Problem pI = m;
26.69 @@ -260,9 +260,9 @@
26.70 val thy = if dI' = e_domID then dI else dI';
26.71 val rfopt = refine_pbl (assoc_thy thy) pI itms;
26.72 in case rfopt of
26.73 - None => Notappl ((tac2str (Refine_Problem pI))^" not applicable")
26.74 - | Some (rf as (pI',_)) =>
26.75 -(* val Some (rf as (pI',_)) = rfopt;
26.76 + NONE => Notappl ((tac2str (Refine_Problem pI))^" not applicable")
26.77 + | SOME (rf as (pI',_)) =>
26.78 +(* val SOME (rf as (pI',_)) = rfopt;
26.79 *)
26.80 if pI' = pI
26.81 then Notappl ((tac2str (Refine_Problem pI))^" not applicable")
26.82 @@ -342,7 +342,7 @@
26.83 if not (is_pblobj (get_obj I pt p)) orelse p_ = Res
26.84 then Notappl ((tac2str (Apply_Method mI))^
26.85 " not for pos "^(pos'2str (p,p_)))
26.86 - else Appl (Apply_Method' (mI, None, e_istate (*filled in solve*)))
26.87 + else Appl (Apply_Method' (mI, NONE, e_istate (*filled in solve*)))
26.88
26.89 | applicable_in (p,p_) pt (Check_Postcond pI) =
26.90 if p_ mem [Pbl,Met]
26.91 @@ -379,12 +379,12 @@
26.92 val subs' = subst2subs' subst;
26.93 in case rewrite_inst_ thy (assoc_rew_ord ro') erls
26.94 (*put_asm*)false subst (assoc_thm' thy thm') f of
26.95 - Some (f',asm) => Appl (
26.96 + SOME (f',asm) => Appl (
26.97 Rewrite_Inst' (thy',ro',erls,(*put_asm*)false,subst,thm',
26.98 (*term_of o the o (parse (assoc_thy thy'))*) f,
26.99 (*(term_of o the o (parse (assoc_thy thy'))*) (f',
26.100 (*map (term_of o the o (parse (assoc_thy thy')))*) asm)))
26.101 - | None => Notappl ((fst thm')^" not applicable") end
26.102 + | NONE => Notappl ((fst thm')^" not applicable") end
26.103 handle _ => Notappl ("syntax error in "^(subs2str subs)) end
26.104
26.105 (* val ((p,p_), pt, m as Rewrite thm') = (p, pt, m);
26.106 @@ -404,13 +404,13 @@
26.107 in if msg = "OK"
26.108 then
26.109 ((*writeln("### applicable_in rls'= "^rls');*)
26.110 - (* val Some (f',asm)=rewrite thy' ro (id_rls rls') put_asm thm' f;
26.111 + (* val SOME (f',asm)=rewrite thy' ro (id_rls rls') put_asm thm' f;
26.112 *)
26.113 case rewrite_ thy (assoc_rew_ord ro)
26.114 rls' false (assoc_thm' thy thm') f of
26.115 - Some (f',asm) => Appl (
26.116 + SOME (f',asm) => Appl (
26.117 Rewrite' (thy',ro,rls',(*put_asm*)false,thm', f, (f', asm)))
26.118 - | None => Notappl ("'"^(fst thm')^"' not applicable") )
26.119 + | NONE => Notappl ("'"^(fst thm')^"' not applicable") )
26.120 else Notappl msg
26.121 end
26.122
26.123 @@ -432,9 +432,9 @@
26.124 (pos'2str (p,p_)));
26.125 in case rewrite_ thy (assoc_rew_ord ro') erls
26.126 (*put_asm*)false (assoc_thm' thy thm') f of
26.127 - Some (f',asm) => Appl (
26.128 + SOME (f',asm) => Appl (
26.129 Rewrite' (thy',ro',erls,(*put_asm*)false,thm', f, (f', asm)))
26.130 - | None => Notappl ("'"^(fst thm')^"' not applicable") end
26.131 + | NONE => Notappl ("'"^(fst thm')^"' not applicable") end
26.132
26.133 | applicable_in (p,p_) pt (m as Detail_Set_Inst (subs, rls)) =
26.134 if p_ mem [Pbl,Met]
26.135 @@ -453,9 +453,9 @@
26.136 let val subst = subs2subst thy subs
26.137 val subs' = subst2subs' subst
26.138 in case rewrite_set_inst_ thy false subst (assoc_rls rls) f of
26.139 - Some (f',asm) => Appl (
26.140 + SOME (f',asm) => Appl (
26.141 Detail_Set_Inst' (thy',false,subst,assoc_rls rls, f, (f', asm)))
26.142 - | None => Notappl (rls^" not applicable") end
26.143 + | NONE => Notappl (rls^" not applicable") end
26.144 handle _ => Notappl ("syntax error in "^(subs2str subs)) end
26.145
26.146 | applicable_in (p,p_) pt (m as Rewrite_Set_Inst (subs, rls)) =
26.147 @@ -478,9 +478,9 @@
26.148 let val subst = subs2subst thy subs;
26.149 val subs' = subst2subs' subst;
26.150 in case rewrite_set_inst_ thy (*put_asm*)false subst (assoc_rls rls) f of
26.151 - Some (f',asm) => Appl (
26.152 + SOME (f',asm) => Appl (
26.153 Rewrite_Set_Inst' (thy',(*put_asm*)false,subst,assoc_rls rls, f, (f', asm)))
26.154 - | None => Notappl (rls^" not applicable") end
26.155 + | NONE => Notappl (rls^" not applicable") end
26.156 handle _ => Notappl ("syntax error in "^(subs2str subs)) end
26.157
26.158 | applicable_in (p,p_) pt (m as Rewrite_Set rls) =
26.159 @@ -498,11 +498,11 @@
26.160 | _ => raise error ("applicable_in: call by "^
26.161 (pos'2str (p,p_)));
26.162 in case rewrite_set_ (assoc_thy thy') (*put_asm*)false (assoc_rls rls) f of
26.163 - Some (f',asm) =>
26.164 + SOME (f',asm) =>
26.165 ((*writeln("#.# applicable_in Rewrite_Set,2f'= "^f');*)
26.166 Appl (Rewrite_Set' (thy',(*put_asm*)false,assoc_rls rls, f, (f', asm)))
26.167 )
26.168 - | None => Notappl (rls^" not applicable") end
26.169 + | NONE => Notappl (rls^" not applicable") end
26.170
26.171 | applicable_in (p,p_) pt (m as Detail_Set rls) =
26.172 if p_ mem [Pbl,Met]
26.173 @@ -516,9 +516,9 @@
26.174 | _ => raise error ("applicable_in: call by "^
26.175 (pos'2str (p,p_)));
26.176 in case rewrite_set_ (assoc_thy thy') false (assoc_rls rls) f of
26.177 - Some (f',asm) =>
26.178 + SOME (f',asm) =>
26.179 Appl (Detail_Set' (thy',false,assoc_rls rls, f, (f',asm)))
26.180 - | None => Notappl (rls^" not applicable") end
26.181 + | NONE => Notappl (rls^" not applicable") end
26.182
26.183
26.184 | applicable_in p pt (End_Ruleset) =
26.185 @@ -538,9 +538,9 @@
26.186 | Res => (fst o (get_obj g_result pt)) p
26.187 in if msg = "OK" then
26.188 case calculate_ (assoc_thy thy') isa_fn f of
26.189 - Some (f', (id, thm)) =>
26.190 + SOME (f', (id, thm)) =>
26.191 Appl (Calculate' (thy',op_, f, (f', (id, string_of_thmI thm))))
26.192 - | None => Notappl ("'calculate "^op_^"' not applicable")
26.193 + | NONE => Notappl ("'calculate "^op_^"' not applicable")
26.194 else Notappl msg
26.195 end
26.196
26.197 @@ -568,8 +568,8 @@
26.198 (*2*)
26.199 else case rewrite_terms_ thy (assoc_rew_ord rew_ord')
26.200 erls subte f of
26.201 - Some (f', _) => Appl (Substitute' (subte, f, f'))
26.202 - | None => Notappl (sube2str sube^" not applicable")
26.203 + SOME (f', _) => Appl (Substitute' (subte, f, f'))
26.204 + | NONE => Notappl (sube2str sube^" not applicable")
26.205 end
26.206 (*-------WN08114 interrupted with error in polyminus.sml "11 = 11"
26.207 | applicable_in (p,p_) pt (m as Substitute sube) =
26.208 @@ -583,8 +583,8 @@
26.209 val {rew_ord',erls,...} = get_met (get_obj g_metID pt pp)
26.210 val subte = sube2subte sube
26.211 in case rewrite_terms_ thy (assoc_rew_ord rew_ord') erls subte f of
26.212 - Some (f', _) => Appl (Substitute' (subte, f, f'))
26.213 - | None => Notappl (sube2str sube^" not applicable")
26.214 + SOME (f', _) => Appl (Substitute' (subte, f, f'))
26.215 + | NONE => Notappl (sube2str sube^" not applicable")
26.216 end
26.217 ------------------*)
26.218
26.219 @@ -599,8 +599,8 @@
26.220 else
26.221 let val thy' = get_obj g_domID pt (par_pblobj pt p);
26.222 in (case parse (assoc_thy thy') ct' of
26.223 - Some ct => Appl (Take' (term_of ct))
26.224 - | None => Notappl ("syntax error in "^ct'))
26.225 + SOME ct => Appl (Take' (term_of ct))
26.226 + | NONE => Notappl ("syntax error in "^ct'))
26.227 end
26.228
26.229 | applicable_in p pt (Take_Inst ct') =
26.230 @@ -615,9 +615,9 @@
26.231 if p_ mem [Pbl,Met]
26.232 then (*maybe Apply_Method has already been done*)
26.233 case get_obj g_env pt p of
26.234 - Some is => Appl (Subproblem' ((domID, pblID, e_metID), [],
26.235 + SOME is => Appl (Subproblem' ((domID, pblID, e_metID), [],
26.236 e_term, [], subpbl domID pblID))
26.237 - | None => Notappl ((tac2str m)^" not for pos "^(pos'2str (p,p_)))
26.238 + | NONE => Notappl ((tac2str m)^" not for pos "^(pos'2str (p,p_)))
26.239 else (*somewhere later in the script*)
26.240 Appl (Subproblem' ((domID, pblID, e_metID), [],
26.241 e_term, [], subpbl domID pblID))
27.1 --- a/src/Tools/isac/ME/calchead.sml Wed Aug 18 13:53:15 2010 +0200
27.2 +++ b/src/Tools/isac/ME/calchead.sml Wed Aug 18 13:55:23 2010 +0200
27.3 @@ -266,9 +266,9 @@
27.4 | typeless (Abs(s,_,t)) = Abs(s,e_type, typeless t)
27.5 | typeless (t1 $ t2) = (typeless t1) $ (typeless t2);
27.6 (*
27.7 -> val (Some ct) = parse thy "max_relation (A=#2*a*b - a^^^#2)";
27.8 +> val (SOME ct) = parse thy "max_relation (A=#2*a*b - a^^^#2)";
27.9 > val (_,t1) = split_dsc_t hs (term_of ct);
27.10 -> val (Some ct) = parse thy "A=#2*a*b - a^^^#2";
27.11 +> val (SOME ct) = parse thy "A=#2*a*b - a^^^#2";
27.12 > val (_,t2) = split_dsc_t hs (term_of ct);
27.13 > typeless t1 = typeless t2;
27.14 val it = true : bool
27.15 @@ -336,9 +336,9 @@
27.16 *)
27.17
27.18 (*find_first item with #1 equal to id*)
27.19 -fun seek_ppc id [] = None
27.20 +fun seek_ppc id [] = NONE
27.21 | seek_ppc id (p::(ppc:itm list)) =
27.22 - if id = #1 p then Some p else seek_ppc id ppc;
27.23 + if id = #1 p then SOME p else seek_ppc id ppc;
27.24
27.25
27.26
27.27 @@ -380,7 +380,7 @@
27.28 fun is_list_type (Type("List.list",_)) = true
27.29 | is_list_type _ = false;
27.30 (* fun destr (Type(str,sort)) = (str,sort);
27.31 -> val (Some ct) = parse thy "lll::real list";
27.32 +> val (SOME ct) = parse thy "lll::real list";
27.33 > val ty = (#T o rep_cterm) ct;
27.34 > is_list_type ty;
27.35 val it = true : bool
27.36 @@ -391,7 +391,7 @@
27.37 *** Free ( lll, real list)
27.38 val it = () : unit
27.39
27.40 -> val (Some ct) = parse thy "[lll::real]";
27.41 +> val (SOME ct) = parse thy "[lll::real]";
27.42 > val ty = (#T o rep_cterm) ct;
27.43 > is_list_type ty;
27.44 val it = true : bool
27.45 @@ -403,7 +403,7 @@
27.46 *** Free ( lll, real)
27.47 *** Const ( List.list.Nil, real list)
27.48
27.49 -> val (Some ct) = parse thy "lll";
27.50 +> val (SOME ct) = parse thy "lll";
27.51 > val ty = (#T o rep_cterm) ct;
27.52 > is_list_type ty;
27.53 val it = false : bool *)
27.54 @@ -412,10 +412,10 @@
27.55 fun has_list_type (Free(_,T)) = is_list_type T
27.56 | has_list_type _ = false;
27.57 (*
27.58 -> val (Some ct) = parse thy "lll::real list";
27.59 +> val (SOME ct) = parse thy "lll::real list";
27.60 > has_list_type (term_of ct);
27.61 val it = true : bool
27.62 -> val (Some ct) = parse thy "[lll::real]";
27.63 +> val (SOME ct) = parse thy "[lll::real]";
27.64 > has_list_type (term_of ct);
27.65 val it = false : bool *)
27.66
27.67 @@ -557,13 +557,13 @@
27.68 fun test_d d ((i,_,_,_,itm_):itm) = (d = (d_in itm_)) andalso i<>0;
27.69 fun is_elem itms (f,(d,t)) =
27.70 case find_first (test_d d) itms of
27.71 - Some _ => true | None => false;
27.72 + SOME _ => true | NONE => false;
27.73 in case filter_out (is_elem itms) pbt of
27.74 (* val ((f,(d,_))::itms) = filter_out (is_elem itms) pbt;
27.75 *)
27.76 (f,(d,_))::itms =>
27.77 - Some (f:string, (string_of_cterm o comp_dts thy) (d,[]):cterm')
27.78 - | _ => None end
27.79 + SOME (f:string, (string_of_cterm o comp_dts thy) (d,[]):cterm')
27.80 + | _ => NONE end
27.81
27.82 (* val (thy,itms) = (assoc_thy (if dI=e_domID then dI' else dI),pbl);
27.83 *)
27.84 @@ -588,16 +588,16 @@
27.85 val icl = filter false_and_not_Sup vits; (* incomplete *)
27.86 in if icl = []
27.87 then case filter_out (test_id (map #1 vits)) vors of
27.88 - [] => None
27.89 + [] => NONE
27.90 (* val miss = filter_out (test_id (map #1 vits)) vors;
27.91 *)
27.92 - | miss => Some (getr_ct thy (hd miss))
27.93 + | miss => SOME (getr_ct thy (hd miss))
27.94 else
27.95 case find_first (test_subset (hd icl)) vors of
27.96 - (* val Some ori = find_first (test_subset (hd icl)) vors;
27.97 + (* val SOME ori = find_first (test_subset (hd icl)) vors;
27.98 *)
27.99 - None => raise error "nxt_add: EX itm. not(dat(itm)<=dat(ori))"
27.100 - | Some ori => Some (geti_ct thy ori (hd icl))
27.101 + NONE => raise error "nxt_add: EX itm. not(dat(itm)<=dat(ori))"
27.102 + | SOME ori => SOME (geti_ct thy ori (hd icl))
27.103 end;
27.104
27.105
27.106 @@ -657,19 +657,19 @@
27.107 if dI'=e_domID andalso dI=e_domID then (Pbl, Specify_Theory dI')
27.108 else if pI'=e_pblID andalso pI=e_pblID then (Pbl, Specify_Problem pI')
27.109 else case find_first (is_error o #5) (pbl:itm list) of
27.110 - Some (_,_,_,fd,itm_) =>
27.111 + SOME (_,_,_,fd,itm_) =>
27.112 (Pbl, mk_delete
27.113 (assoc_thy (if dI=e_domID then dI' else dI)) fd itm_)
27.114 - | None =>
27.115 - ((*writeln"### nxt_spec is_error None";*)
27.116 + | NONE =>
27.117 + ((*writeln"### nxt_spec is_error NONE";*)
27.118 case nxt_add (assoc_thy (if dI=e_domID then dI' else dI))
27.119 oris pbt pbl of
27.120 -(* val Some (fd,ct') = nxt_add (assoc_thy (if dI=e_domID then dI' else dI))
27.121 +(* val SOME (fd,ct') = nxt_add (assoc_thy (if dI=e_domID then dI' else dI))
27.122 oris pbt pbl;
27.123 *)
27.124 - Some (fd,ct') => ((*writeln"### nxt_spec nxt_add Some";*)
27.125 + SOME (fd,ct') => ((*writeln"### nxt_spec nxt_add SOME";*)
27.126 (Pbl, mk_additem fd ct'))
27.127 - | None => (*pbl-items complete*)
27.128 + | NONE => (*pbl-items complete*)
27.129 if not preok then (Pbl, Refine_Problem pI')
27.130 else
27.131 if dI = e_domID then (Pbl, Specify_Theory dI')
27.132 @@ -677,13 +677,13 @@
27.133 else if mI = e_metID then (Pbl, Specify_Method mI')
27.134 else
27.135 case find_first (is_error o #5) met of
27.136 - Some (_,_,_,fd,itm_) =>
27.137 + SOME (_,_,_,fd,itm_) =>
27.138 (Met, mk_delete (assoc_thy dI) fd itm_)
27.139 - | None =>
27.140 + | NONE =>
27.141 (case nxt_add (assoc_thy dI) oris mpc met of
27.142 - Some (fd,ct') => (*30.8.01: pre?!?*)
27.143 + SOME (fd,ct') => (*30.8.01: pre?!?*)
27.144 (Met, mk_additem fd ct')
27.145 - | None =>
27.146 + | NONE =>
27.147 ((*Solv 3.4.00*)Met, Apply_Method mI))))
27.148 (* val preok=pb; val (pbl, met) = (pbl,met');
27.149 val (pbt,mpc)=((#ppc o get_pbt) cpI,(#ppc o get_met) cmI);
27.150 @@ -694,13 +694,13 @@
27.151 | nxt_spec Met preok oris (dI',pI',mI') (pbl, met) (pbt,mpc) (dI,pI,mI) =
27.152 ((*writeln"### nxt_spec Met"; *)
27.153 case find_first (is_error o #5) met of
27.154 - Some (_,_,_,fd,itm_) =>
27.155 + SOME (_,_,_,fd,itm_) =>
27.156 (Met, mk_delete (assoc_thy (if dI=e_domID then dI' else dI)) fd itm_)
27.157 - | None =>
27.158 + | NONE =>
27.159 case nxt_add (assoc_thy (if dI=e_domID then dI' else dI))oris mpc met of
27.160 - Some (fd,ct') => (Met, mk_additem fd ct')
27.161 - | None =>
27.162 - ((*writeln"### nxt_spec Met: nxt_add None";*)
27.163 + SOME (fd,ct') => (Met, mk_additem fd ct')
27.164 + | NONE =>
27.165 + ((*writeln"### nxt_spec Met: nxt_add NONE";*)
27.166 if dI = e_domID then (Met, Specify_Theory dI')
27.167 else if pI = e_pblID then (Met, Specify_Problem pI')
27.168 else if not preok then (Met, Specify_Method mI)
27.169 @@ -739,8 +739,8 @@
27.170
27.171 fun is_field_correct sel d dscpbt =
27.172 case assoc (dscpbt, sel) of
27.173 - None => false
27.174 - | Some ds => d mem ds;
27.175 + NONE => false
27.176 + | SOME ds => d mem ds;
27.177
27.178 (*. update the itm_ already input, all..from ori .*)
27.179 (* val (id,vt,fd,d,ts) = (i,v,f,d,ts\\ts');
27.180 @@ -790,11 +790,11 @@
27.181 *)
27.182 fun is_notyet_input thy (itms:itm list) all ((i,v,f,d,ts):ori) pbt =
27.183 case find_first (eq1 d) pbt of
27.184 - Some (_,(_,pid)) =>(* val Some (_,(_,pid)) = find_first (eq1 d) pbt;
27.185 - val Some (_,_,_,_,itm_)=find_first (eq3 f d) itms;
27.186 + SOME (_,(_,pid)) =>(* val SOME (_,(_,pid)) = find_first (eq1 d) pbt;
27.187 + val SOME (_,_,_,_,itm_)=find_first (eq3 f d) itms;
27.188 *)
27.189 (case find_first (eq3 f d) itms of
27.190 - Some (_,_,_,_,itm_) =>
27.191 + SOME (_,_,_,_,itm_) =>
27.192 let
27.193 val ts' = (ts_in itm_) inter ts;
27.194 in if ts subset ts'
27.195 @@ -803,19 +803,19 @@
27.196 " already input", e_itm) (*2*)
27.197 else ("", ori_2itm thy itm_ pid all (i,v,f,d,ts\\ts')) (*3,4*)
27.198 end
27.199 - | None => ("", ori_2itm thy (Inc ((e_term,[]),(pid,[])))
27.200 + | NONE => ("", ori_2itm thy (Inc ((e_term,[]),(pid,[])))
27.201 pid all (i,v,f,d,ts)) (*1*)
27.202 )
27.203 - | None => ("", ori_2itm thy (Sup (d,ts))
27.204 + | NONE => ("", ori_2itm thy (Sup (d,ts))
27.205 e_term all (i,v,f,d,ts));
27.206 (*------------------------------------------------
27.207 fun eq3 f d (_,_,_,f',itm_) = f = f' andalso d = (d_in itm_);
27.208 fun is_notyet_input thy itms pval all ((id,vt,fd,d,ts):ori) pbt =
27.209 case find_first (eq1 d) pbt of
27.210 - Some (_,(_,pid)) => (* val Some (_,(_,pid)) = find_first (eq1 d) pbt;
27.211 + SOME (_,(_,pid)) => (* val SOME (_,(_,pid)) = find_first (eq1 d) pbt;
27.212 *)
27.213 (case seek_ppc id itms of
27.214 - Some (id',_,_,_,itm_) =>
27.215 + SOME (id',_,_,_,itm_) =>
27.216 let
27.217 val ts' = (ts_in itm_) inter ts;
27.218 in if ts'= [] then ("", ori_2itm itm_ (pid, pval) all
27.219 @@ -823,14 +823,14 @@
27.220 else (((strs2str' o
27.221 map (Sign.string_of_term (sign_of thy))) ts')^
27.222 " already input", e_itm) end
27.223 - | None =>
27.224 + | NONE =>
27.225 if all = ts
27.226 then ("", ori_2itm (Cor ((e_term,[]),(pid,[])))
27.227 (pid, pval) all (id,vt,fd,d,ts))
27.228 else ("", ori_2itm (Inc ((e_term,[]),(e_term,[])))
27.229 (pid, pval) all (id,vt,fd,d,ts))
27.230 )
27.231 - | None => ("", ori_2itm (Sup (e_term,[]))
27.232 + | NONE => ("", ori_2itm (Sup (e_term,[]))
27.233 (e_term, []) all (id,vt,fd,d,ts));----*)
27.234
27.235 fun test_types thy (d,ts) =
27.236 @@ -838,8 +838,8 @@
27.237 val s = !show_types; val _ = show_types:= true;
27.238 val opt = (try (comp_dts thy)) (d,ts);
27.239 val msg = case opt of
27.240 - Some _ => ""
27.241 - | None => ((Sign.string_of_term (sign_of thy) d)^" "^
27.242 + SOME _ => ""
27.243 + | NONE => ((Sign.string_of_term (sign_of thy) d)^" "^
27.244 ((strs2str' o map (Sign.string_of_term(sign_of thy)))ts)
27.245 ^" is illtyped");
27.246 val _ = show_types:= s
27.247 @@ -911,10 +911,10 @@
27.248 let
27.249 val i = 1 + (if ppc=[] then 0 else maxl (map #1 ppc));
27.250 in case parse thy ct' of (*should be done in applicable_in 4.00.FIXME*)
27.251 - None => Add (i,[],false,sel,Syn ct')
27.252 -(* val (Some ct) = parse thy ct';
27.253 + NONE => Add (i,[],false,sel,Syn ct')
27.254 +(* val (SOME ct) = parse thy ct';
27.255 *)
27.256 - | Some ct =>
27.257 + | SOME ct =>
27.258 let
27.259 val (d,ts(*,pval*)) = split_dts thy (term_of ct);
27.260 in if d = e_term
27.261 @@ -922,19 +922,19 @@
27.262
27.263 else
27.264 (case find_first (eq1 d) pbt of
27.265 - None => Add (i,[],true,sel,Sup ((d,ts)))
27.266 - | Some (f,(_,id)) =>
27.267 -(* val Some (f,(_,id)) = find_first (eq1 d) pbt;
27.268 + NONE => Add (i,[],true,sel,Sup ((d,ts)))
27.269 + | SOME (f,(_,id)) =>
27.270 +(* val SOME (f,(_,id)) = find_first (eq1 d) pbt;
27.271 *)
27.272 let
27.273 fun eq2 d ((i,_,_,_,itm_):itm) =
27.274 (d = (d_in itm_)) andalso i<>0;
27.275 in case find_first (eq2 d) ppc of
27.276 - None => Add (i,[],true,f, Cor ((d,ts), (id, (*pval*)
27.277 + NONE => Add (i,[],true,f, Cor ((d,ts), (id, (*pval*)
27.278 pbl_ids' thy d ts)))
27.279 - | Some (i',_,_,_,itm_) =>
27.280 -(* val Some (i',_,_,_,itm_) = find_first (eq2 d) ppc;
27.281 - val None = find_first (eq2 d) ppc;
27.282 + | SOME (i',_,_,_,itm_) =>
27.283 +(* val SOME (i',_,_,_,itm_) = find_first (eq2 d) ppc;
27.284 + val NONE = find_first (eq2 d) ppc;
27.285 *)
27.286 if is_list_dsc d
27.287 then let val ts = ts union (ts_in itm_)
27.288 @@ -959,8 +959,8 @@
27.289 let
27.290 val ctopt = parse thy ct;
27.291 in case ctopt of
27.292 - None => Err ("syntax error in "^ct)
27.293 - | Some ct =>(* val Some ct = ctopt;
27.294 + NONE => Err ("syntax error in "^ct)
27.295 + | SOME ct =>(* val SOME ct = ctopt;
27.296 val (msg,ori',all) = is_known thy sel oris (term_of ct);
27.297 val (msg,itm) = is_notyet_input thy ppc all ori' pbt;
27.298 *)
27.299 @@ -1026,7 +1026,7 @@
27.300 (thy, p, a);
27.301 *)
27.302 (cterm_of (sign_of thy) (dsc $ var);(*type check*)
27.303 - Some ((([1], str, dsc, (*[var]*)
27.304 + SOME ((([1], str, dsc, (*[var]*)
27.305 split_dts' (dsc, var))): preori)(*:ori without leading #*))
27.306 handle e as TYPE _ =>
27.307 (writeln (dashs 70^"\n"
27.308 @@ -1039,7 +1039,7 @@
27.309 ^"*** checked by theory: "^(theory2str thy)^"\n"
27.310 ^"*** "^dots 66);
27.311 print_exn e; (*raises exn again*)
27.312 - None);
27.313 + NONE);
27.314 (*> val pbt = (#ppc o get_pbt) ["univariate","equation"];
27.315 > val Const ("Script.SubProblem",_) $
27.316 (Const ("Pair",_) $ Free (thy', _) $
27.317 @@ -1048,7 +1048,7 @@
27.318 \[SqRoot_,solve_linear]) [bool_ (x+1- 2=0), real_ x])::bool list";
27.319 > val ags = isalist2list ags;
27.320 > mtc thy (hd pbt) (hd ags);
27.321 -val it = Some ([1],"#Given",Const (#,#),[# $ #]) *)
27.322 +val it = SOME ([1],"#Given",Const (#,#),[# $ #]) *)
27.323
27.324 (*.match each pat of the model-pattern with an actual argument;
27.325 precondition: copy-named vars are filtered out.*)
27.326 @@ -1067,10 +1067,10 @@
27.327 (*del?..*)if (is_copy_named_idstr o free2str) t then oris
27.328 else(*..del?*) let val opt = mtc thy p a;
27.329 in case opt of
27.330 - (* val Some ori = mtc thy p a;
27.331 + (* val SOME ori = mtc thy p a;
27.332 *)
27.333 - Some ori => matc thy pbt ags (oris @ [ori])
27.334 - | None => [](*WN050903 skipped by exn handled in match_ags*)
27.335 + SOME ori => matc thy pbt ags (oris @ [ori])
27.336 + | NONE => [](*WN050903 skipped by exn handled in match_ags*)
27.337 end;
27.338 (* run subp-rooteq.sml until Init_Proof before ...
27.339 > val Nd (PblObj {origin=(oris,_,_),...},_) = pt;(*from test/subp-rooteq.sml*)
27.340 @@ -1179,11 +1179,11 @@
27.341 (
27.342 (*writeln("### insert_ppc: itm= "^(itm2str_ itm));*)
27.343 case seek_ppc (#1 itm) ppc of
27.344 - (* val Some xxx = seek_ppc (#1 itm) ppc;
27.345 + (* val SOME xxx = seek_ppc (#1 itm) ppc;
27.346 *)
27.347 - Some _ => (*itm updated in is_notyet_input WN.11.03*)
27.348 + SOME _ => (*itm updated in is_notyet_input WN.11.03*)
27.349 overwrite_ppc thy itm ppc
27.350 - | None => (ppc @ [itm]));
27.351 + | NONE => (ppc @ [itm]));
27.352 in filter_out (eq_untouched ((d_in o #5) itm)) ppc' end;
27.353
27.354 (*from Isabelle/src/Pure/library.ML, _appends_ a new element*)
27.355 @@ -1633,7 +1633,7 @@
27.356 val pbl = init_pbl ppc (*fill in descriptions*)
27.357 (*--------------if you think, this should be done by the Dialog
27.358 in the java front-end, search there for WN060225-modelProblem----*)
27.359 - val (pbl,met) = case cas of None => (pbl,[])
27.360 + val (pbl,met) = case cas of NONE => (pbl,[])
27.361 | _ => complete_mod_ (oris, mpc, ppc, probl)
27.362 (*----------------------------------------------------------------*)
27.363 val tac_ = Model_Problem' (pI, pbl, met)
27.364 @@ -1651,7 +1651,7 @@
27.365 let val (PblObj {origin = (oris, (dI,_,_),_), ...}) = get_obj I pt p
27.366 val opt = refine_ori oris pI
27.367 in case opt of
27.368 - Some pI' =>
27.369 + SOME pI' =>
27.370 let val {met,ppc,...} = get_pbt pI'
27.371 val pbl = init_pbl ppc
27.372 (*val pt = update_pbl pt p pbl ..done by Model_Problem*)
27.373 @@ -1661,7 +1661,7 @@
27.374 Uistate pos pt
27.375 in ([(Refine_Tacitly pI, Refine_Tacitly' (pI,pI',dI,mI,(*pbl*)[]),
27.376 (pos, Uistate))], c, (pt,pos)) end
27.377 - | None => ([], [], ptp)
27.378 + | NONE => ([], [], ptp)
27.379 end
27.380
27.381 | nxt_specif (Refine_Problem pI) (ptp as (pt, pos as (p,_))) =
27.382 @@ -1669,8 +1669,8 @@
27.383 probl, ...}) = get_obj I pt p
27.384 val thy = if dI' = e_domID then dI else dI'
27.385 in case refine_pbl (assoc_thy thy) pI probl of
27.386 - None => ([], [], ptp)
27.387 - | Some (rfd as (pI',_)) =>
27.388 + NONE => ([], [], ptp)
27.389 + | SOME (rfd as (pI',_)) =>
27.390 let val (pos,c,_,pt) =
27.391 generate1 (assoc_thy thy)
27.392 (Refine_Problem' rfd) Uistate pos pt
27.393 @@ -1747,7 +1747,7 @@
27.394 val dI = if dI = "" then theory2theory' thy else dI
27.395 val thy = assoc_thy dI
27.396 val mI = if mI = [] then hd met else mI
27.397 - val hdl = case cas of None => pblterm dI pI | Some t => t
27.398 + val hdl = case cas of NONE => pblterm dI pI | SOME t => t
27.399 val (pt,_) = cappend_problem e_ptree [] e_istate ([], (dI,pI,mI))
27.400 ([], (dI,pI,mI), hdl)
27.401 val pt = update_spec pt [] (dI,pI,mI)
27.402 @@ -1783,8 +1783,8 @@
27.403 val {cas,ppc,thy=thy',...} = get_pbt pI (*take dI from _refined_ pbl*)
27.404 val dI = theory2theory' (maxthy thy thy');
27.405 val hdl = case cas of
27.406 - None => pblterm dI pI
27.407 - | Some t => subst_atomic ((vars_of_pbl_' ppc)
27.408 + NONE => pblterm dI pI
27.409 + | SOME t => subst_atomic ((vars_of_pbl_' ppc)
27.410 ~~~ vals_of_oris pors) t
27.411 val (pt,_) = cappend_problem e_ptree [] e_istate (fmz,(dI,pI,mI))
27.412 (pors,(dI,pI,mI),hdl)
27.413 @@ -1889,7 +1889,7 @@
27.414 | fld f (x::x'::xs) = f (fld f (x'::xs),x);
27.415 in ((fld f) o rev) xs end;
27.416 (*
27.417 -> val (Some ct) = parse thy "[a=b,c=d,e=f]";
27.418 +> val (SOME ct) = parse thy "[a=b,c=d,e=f]";
27.419 > val ces = map (cterm_of (sign_of thy)) (isalist2list (term_of ct));
27.420 > val conj = foldr1 HOLogic.mk_conj (isalist2list (term_of ct));
27.421 > cterm_of (sign_of thy) conj;
27.422 @@ -1901,7 +1901,7 @@
27.423 | foldl1 f (x::x'::[]) = f (x,x')
27.424 | foldl1 f (x::x'::xs) = f (x,foldl1 f (x'::xs));
27.425 (*
27.426 -> val (Some ct) = parse thy "[a=b,c=d,e=f,g=h]";
27.427 +> val (SOME ct) = parse thy "[a=b,c=d,e=f,g=h]";
27.428 > val ces = map (cterm_of (sign_of thy)) (isalist2list (term_of ct));
27.429 > val conj = foldl1 HOLogic.mk_conj (isalist2list (term_of ct));
27.430 > cterm_of (sign_of thy) conj;
27.431 @@ -2048,19 +2048,19 @@
27.432 let val (dI, pI, _) = get_somespec' spec spec'
27.433 val {cas,...} = get_pbt pI
27.434 in case cas of
27.435 - None => Form (pblterm dI pI)
27.436 - | Some t => Form (subst_atomic (mk_env probl) t)
27.437 + NONE => Form (pblterm dI pI)
27.438 + | SOME t => Form (subst_atomic (mk_env probl) t)
27.439 end;
27.440 (*vvv takes the tac _generating_ the formula=result, asm ok....
27.441 fun pt_result (PrfObj {result=(t,asm), tac,...}) =
27.442 (Form t,
27.443 - if null asm then None else Some asm,
27.444 - Some tac)
27.445 + if null asm then NONE else SOME asm,
27.446 + SOME tac)
27.447 | pt_result (PblObj {result=(t,asm), origin = (_,ospec,_), spec,...}) =
27.448 let val (_,_,metID) = some_spec ospec spec
27.449 in (Form t,
27.450 - if null asm then None else Some asm,
27.451 - if metID = e_metID then None else Some (Apply_Method metID)) end;
27.452 + if null asm then NONE else SOME asm,
27.453 + if metID = e_metID then NONE else SOME (Apply_Method metID)) end;
27.454 -------------------------------------------------------------------------*)
27.455
27.456
27.457 @@ -2075,7 +2075,7 @@
27.458 (* val (pt,([],Res)) = ptp;
27.459 *)
27.460 let val (f, asm) = get_obj g_result pt []
27.461 - in (Form f, None, asm) end
27.462 + in (Form f, NONE, asm) end
27.463 (* val p = [3,2];
27.464 *)
27.465 | pt_extract (pt,(p,Res)) =
27.466 @@ -2086,18 +2086,18 @@
27.467 then if is_pblobj' pt (lev_up p)
27.468 then let val (PblObj{spec=(_,pI,_),...}) =
27.469 get_obj I pt (lev_up p)
27.470 - in if pI = e_pblID then None
27.471 - else Some (Check_Postcond pI) end
27.472 - else Some End_Trans (*WN0502 TODO for other branches*)
27.473 + in if pI = e_pblID then NONE
27.474 + else SOME (Check_Postcond pI) end
27.475 + else SOME End_Trans (*WN0502 TODO for other branches*)
27.476 else let val p' = lev_on p
27.477 in if is_pblobj' pt p'
27.478 then let val (PblObj{origin = (_,(dI,pI,_),_),...}) =
27.479 get_obj I pt p'
27.480 - in Some (Subproblem (dI, pI)) end
27.481 + in SOME (Subproblem (dI, pI)) end
27.482 else if f = get_obj g_form pt p'
27.483 - then Some (get_obj g_tac pt p')
27.484 + then SOME (get_obj g_tac pt p')
27.485 (*because this Frm ~~~is not on worksheet*)
27.486 - else Some (Take (term2str (get_obj g_form pt p')))
27.487 + else SOME (Take (term2str (get_obj g_form pt p')))
27.488 end
27.489 in (Form f, tac, asm) end
27.490
27.491 @@ -2109,7 +2109,7 @@
27.492 val f = if is_pblobj ppobj then pt_model ppobj p_
27.493 else get_obj pt_form pt p
27.494 val tac = g_tac ppobj
27.495 - in (f, Some tac, []) end;
27.496 + in (f, SOME tac, []) end;
27.497
27.498
27.499 (**. get the formula from a ctree-node:
28.1 --- a/src/Tools/isac/ME/ctree.sml Wed Aug 18 13:53:15 2010 +0200
28.2 +++ b/src/Tools/isac/ME/ctree.sml Wed Aug 18 13:55:23 2010 +0200
28.3 @@ -202,7 +202,7 @@
28.4 type loc = loc_ * (* + interpreter-state *)
28.5 (loc_ * rls') (* -"- for script of the ruleset*)
28.6 option;
28.7 -val e_loc = ([],None):loc;
28.8 +val e_loc = ([],NONE):loc;
28.9 val ee_loc = (e_loc,e_loc);*)
28.10
28.11
29.1 --- a/src/Tools/isac/ME/generate.sml Wed Aug 18 13:53:15 2010 +0200
29.2 +++ b/src/Tools/isac/ME/generate.sml Wed Aug 18 13:55:23 2010 +0200
29.3 @@ -17,12 +17,12 @@
29.4 | Rls {scr=Script s,...} =>
29.5 (* val Rls {scr=Script s,...} = assoc_rls rls;
29.6 *)
29.7 - (ScrState ([(one_scr_arg s, t)], [], None, e_term, Sundef, true))
29.8 + (ScrState ([(one_scr_arg s, t)], [], NONE, e_term, Sundef, true))
29.9 | Seq {scr=EmptyScr,...} =>
29.10 raise error ("interSteps>..>init_istate: \""^rls^"\" has EmptyScr."
29.11 ^"use prep_rls for storing rule-sets !")
29.12 | Seq {srls=srls,scr=Script s,...} =>
29.13 - (ScrState ([(one_scr_arg s, t)], [], None, e_term, Sundef, true)))
29.14 + (ScrState ([(one_scr_arg s, t)], [], NONE, e_term, Sundef, true)))
29.15 | init_istate (Rewrite_Set_Inst (subs, rls)) =
29.16 (* val (Rewrite_Set_Inst (subs, rls)) = (get_obj g_tac pt p);
29.17 *)
29.18 @@ -33,7 +33,7 @@
29.19 ^"use prep_rls for storing rule-sets !")
29.20 | Rls {scr=Script s,...} =>
29.21 let val (a1, a2) = two_scr_arg s
29.22 - in (ScrState ([(a1, v), (a2, t)],[], None, e_term, Sundef,true)) end
29.23 + in (ScrState ([(a1, v), (a2, t)],[], NONE, e_term, Sundef,true)) end
29.24 | Seq {scr=EmptyScr,...} =>
29.25 raise error ("interSteps>..>init_istate: \""^rls^"\" has EmptyScr."
29.26 ^"use prep_rls for storing rule-sets !")
29.27 @@ -41,7 +41,7 @@
29.28 *)
29.29 | Seq {scr=Script s,...} =>
29.30 let val (a1, a2) = two_scr_arg s
29.31 - in (ScrState ([(a1, v), (a2, t)],[], None, e_term, Sundef,true)) end
29.32 + in (ScrState ([(a1, v), (a2, t)],[], NONE, e_term, Sundef,true)) end
29.33 end;
29.34 *)
29.35 (*~~~~~~~~~~~~~~~~~~~~~~copy for dev. until del.~~~~~~~~~~~~~~~~~~~~~~~~~*)
29.36 @@ -58,12 +58,12 @@
29.37 | Rls {scr=Script s,...} =>
29.38 (* val Rls {scr=Script s,...} = assoc_rls rls;
29.39 *)
29.40 - (ScrState ([(one_scr_arg s, t)], [], None, e_term, Sundef, true))
29.41 + (ScrState ([(one_scr_arg s, t)], [], NONE, e_term, Sundef, true))
29.42 | Seq {scr=EmptyScr,...} =>
29.43 raise error ("interSteps>..>init_istate: \""^rls^"\" has EmptyScr."
29.44 ^"use prep_rls for storing rule-sets !")
29.45 | Seq {srls=srls,scr=Script s,...} =>
29.46 - (ScrState ([(one_scr_arg s, t)], [], None, e_term, Sundef, true)))
29.47 + (ScrState ([(one_scr_arg s, t)], [], NONE, e_term, Sundef, true)))
29.48 (* val ((Rewrite_Set_Inst (subs, rls)), t) = ((get_obj g_tac pt p), t);
29.49 *)
29.50 | init_istate (Rewrite_Set_Inst (subs, rls)) t =
29.51 @@ -75,7 +75,7 @@
29.52 ^"use prep_rls for storing rule-sets !")
29.53 | Rls {scr=Script s,...} =>
29.54 let val (form, bdv) = two_scr_arg s
29.55 - in (ScrState ([(form, t), (bdv, v)],[], None, e_term, Sundef,true))
29.56 + in (ScrState ([(form, t), (bdv, v)],[], NONE, e_term, Sundef,true))
29.57 end
29.58 | Seq {scr=EmptyScr,...} =>
29.59 raise error ("interSteps>..>init_istate: \""^rls^"\" has EmptyScr."
29.60 @@ -84,7 +84,7 @@
29.61 *)
29.62 | Seq {scr=Script s,...} =>
29.63 let val (form, bdv) = two_scr_arg s
29.64 - in (ScrState ([(form, t), (bdv, v)],[], None, e_term, Sundef,true))
29.65 + in (ScrState ([(form, t), (bdv, v)],[], NONE, e_term, Sundef,true))
29.66 end
29.67 end;
29.68
29.69 @@ -322,13 +322,13 @@
29.70 writeln("###generate1 Apply_Method': topt= "^termopt2str topt);
29.71 writeln("###generate1 Apply_Method': is = "^istate2str is);*)
29.72 case topt of
29.73 - Some t =>
29.74 + SOME t =>
29.75 let val (pt,c) = cappend_form pt p is t
29.76 (*val _= writeln("###generate1 Apply_Method: after cappend")*)
29.77 in (pos,c, EmptyMout,pt)
29.78 end
29.79 - | None =>
29.80 - (pos,[],EmptyMout,update_env pt p (Some is)))
29.81 + | NONE =>
29.82 + (pos,[],EmptyMout,update_env pt p (SOME is)))
29.83 (* val (thy, (Take' t), l, (p,p_), pt) =
29.84 ((assoc_thy "Isac.thy"), tac_, is, pos, pt);
29.85 *)
29.86 @@ -410,7 +410,7 @@
29.87 val pt = update_branch pt p TransitiveB (*040312*)
29.88
29.89 val is = init_istate (Rewrite_Set_Inst (subst2subs subs, id_rls rls)) f
29.90 - val tac_ = Apply_Method' (e_metID, Some t, is)
29.91 + val tac_ = Apply_Method' (e_metID, SOME t, is)
29.92 val pos' = ((lev_on o lev_dn) p, Frm)
29.93 in (*implicit Take*) generate1 thy tac_ is pos' pt end
29.94
29.95 @@ -428,7 +428,7 @@
29.96 val pt = update_branch pt p TransitiveB (*040312*)
29.97
29.98 val is = init_istate (Rewrite_Set (id_rls rls)) f
29.99 - val tac_ = Apply_Method' (e_metID, Some t, is)
29.100 + val tac_ = Apply_Method' (e_metID, SOME t, is)
29.101 val pos' = ((lev_on o lev_dn) p, Frm)
29.102 in (*implicit Take*) generate1 thy tac_ is pos' pt end
29.103
29.104 @@ -519,7 +519,7 @@
29.105 * (1) FIXME other branchtyptes than Transitive will change 'embed_deriv' *
29.106 * (2) FIXME and eventually 'compare_step' (ie. the script interpreter) *
29.107 * (3) FIXME and eventually 'lev_back' *
29.108 - *# Some improvements are evident FIXME.040215 '_deriv'ation: *
29.109 + *# SOME improvements are evident FIXME.040215 '_deriv'ation: *
29.110 * (1) FIXME nest Rls_ in 'make_deriv' *
29.111 * (2) FIXME do the not-reversed part in 'make_deriv' by scripts -- thus *
29.112 * user-input will become possible in this part of a derivation *
29.113 @@ -549,7 +549,7 @@
29.114 (*inform at Frm: replace the whole PrfObj by a Transitive-ProfObj FIXME?0402
29.115 and transfer the istate (from _after_ compare_deriv) from Frm to Res*)
29.116 let val (res, asm) = (res_from_taci o last_elem) tacis
29.117 - val (Some ist,_) = get_obj g_loc pt p
29.118 + val (SOME ist,_) = get_obj g_loc pt p
29.119 val form = get_obj g_form pt p
29.120 (*val p = lev_on p; ---------------only difference to (..,Res) below*)
29.121 val tacis = (Begin_Trans, Begin_Trans' form, (pos, Uistate))
29.122 @@ -570,7 +570,7 @@
29.123 (*inform at Res: append a Transitive-PrfObj FIXME?0402 other branch-types ?
29.124 and transfer the istate (from _after_ compare_deriv) from Res to new Res*)
29.125 let val (res, asm) = (res_from_taci o last_elem) tacis
29.126 - val (_, Some ist) = get_obj g_loc pt p
29.127 + val (_, SOME ist) = get_obj g_loc pt p
29.128 val (f,a) = get_obj g_result pt p
29.129 val p = lev_on p(*---------------only difference to (..,Frm) above*);
29.130 val tacis = (Begin_Trans, Begin_Trans' f, ((p, Frm), Uistate))
30.1 --- a/src/Tools/isac/ME/inform.sml Wed Aug 18 13:53:15 2010 +0200
30.2 +++ b/src/Tools/isac/ME/inform.sml Wed Aug 18 13:55:23 2010 +0200
30.3 @@ -162,7 +162,7 @@
30.4 val its = add_id its_
30.5 val pits = map flattup2 its
30.6 val (pI, mI) = if mI <> ["no_met"] then (pI, mI)
30.7 - else let val Some (pI,_) = refine_pbl thy pI pits
30.8 + else let val SOME (pI,_) = refine_pbl thy pI pits
30.9 in (pI, (hd o #met o get_pbt) pI) end
30.10 val {ppc,pre,prls,...} = get_met mI
30.11 val its_ = map (dtss2itm_ ppc) dtss (*([1],true,"#Given",Cor (...))*)
30.12 @@ -181,8 +181,8 @@
30.13 val pits = map flattup2 its
30.14 val (pI, mI) = if mI <> ["no_met"] then (pI, mI)
30.15 else case refine_pbl thy pI pits of
30.16 - Some (pI,_) => (pI, (hd o #met o get_pbt) pI)
30.17 - | None => (pI, (hd o #met o get_pbt) pI)
30.18 + SOME (pI,_) => (pI, (hd o #met o get_pbt) pI)
30.19 + | NONE => (pI, (hd o #met o get_pbt) pI)
30.20 val {ppc,pre,prls,...} = get_met mI
30.21 val its_ = map (dtss2itm_ ppc) dtss (*([1],true,"#Given",Cor (...))*)
30.22 val its = add_id its_
30.23 @@ -198,14 +198,14 @@
30.24 fun cas_input hdt =
30.25 let val (h,argl) = strip_comb hdt
30.26 in case assoc (!castab, h) of
30.27 - None => None
30.28 + NONE => NONE
30.29 (*let val (pt,_) =
30.30 cappend_problem e_ptree [] e_istate
30.31 ([], e_spec) ([], e_spec, e_term)
30.32 in (pt, (false, Pbl, e_term(*FIXXME031:'not found'*),
30.33 [], [], e_spec)) end*)
30.34 - | Some (spec as (dI,_,_), argl2dtss) =>
30.35 - (* val Some (spec as (dI,_,_), argl2dtss ) = assoc (!castab, h);
30.36 + | SOME (spec as (dI,_,_), argl2dtss) =>
30.37 + (* val SOME (spec as (dI,_,_), argl2dtss ) = assoc (!castab, h);
30.38 *)
30.39 let val dtss = argl2dtss argl
30.40 val (pI, pits, mI, mits, pre) = cas_input_ spec dtss
30.41 @@ -216,7 +216,7 @@
30.42 val pt = update_spec pt [] spec
30.43 val pt = update_pbl pt [] pits
30.44 val pt = update_met pt [] mits
30.45 - in Some (pt, (true, Met, hdt, mits, pre, spec):ocalhd) end
30.46 + in SOME (pt, (true, Met, hdt, mits, pre, spec):ocalhd) end
30.47 end;
30.48
30.49 (*lazy evaluation for Isac.thy*)
30.50 @@ -281,8 +281,8 @@
30.51 let
30.52 val thy = assoc_thy dI;
30.53 in case parse thy ct of
30.54 - None => (0,[],false,sel, Syn ct):itm
30.55 - | Some ct => (* val Some ct = parse thy ct;
30.56 + NONE => (0,[],false,sel, Syn ct):itm
30.57 + | SOME ct => (* val SOME ct = parse thy ct;
30.58 *)
30.59 (case is_known thy sel oris (term_of ct) of
30.60 (* val ("",ori'(*ts='ct'*), all) = is_known thy sel oris (term_of ct);
30.61 @@ -309,15 +309,15 @@
30.62 fun fstr2itm_ thy pbt (f, str) =
30.63 let val topt = parse thy str
30.64 in case topt of
30.65 - None => ([], false, f, Syn str)
30.66 - | Some ct =>
30.67 -(* val Some ct = parse thy str;
30.68 + NONE => ([], false, f, Syn str)
30.69 + | SOME ct =>
30.70 +(* val SOME ct = parse thy str;
30.71 *)
30.72 let val (d,ts) = ((split_dts thy) o term_of) ct
30.73 val popt = find_first (eq7 (f,d)) pbt
30.74 in case popt of
30.75 - None => ([1](*??*), true(*??*), f, Sup (d,ts))
30.76 - | Some (f, (d, id)) => ([1], true, f, Cor ((d,ts), (id, ts)))
30.77 + NONE => ([1](*??*), true(*??*), f, Sup (d,ts))
30.78 + | SOME (f, (d, id)) => ([1], true, f, Cor ((d,ts), (id, ts)))
30.79 end
30.80 end;
30.81
30.82 @@ -609,8 +609,8 @@
30.83 let fun derivat ([]:(term * rule * (term * term list)) list) = e_term
30.84 | derivat dt = (#1 o #3 o last_elem) dt
30.85 fun equal (_,_,(t1, _)) (_,_,(t2, _)) = t1=t2
30.86 - val fod = make_deriv (Isac"") erls rules (snd rew_ord) None fo
30.87 - val ifod = make_deriv (Isac"") erls rules (snd rew_ord) None ifo
30.88 + val fod = make_deriv (Isac"") erls rules (snd rew_ord) NONE fo
30.89 + val ifod = make_deriv (Isac"") erls rules (snd rew_ord) NONE ifo
30.90 in case (fod, ifod) of
30.91 ([], []) => if fo = ifo then (true, [])
30.92 else (false, [])
30.93 @@ -679,7 +679,7 @@
30.94 ((Subproblem _, _, _)::_) =>
30.95 let val ptp as (pt, (p,_)) = all_modspec ptp
30.96 val mI = get_obj g_metID pt p
30.97 - in nxt_solv (Apply_Method' (mI, None, e_istate))
30.98 + in nxt_solv (Apply_Method' (mI, NONE, e_istate))
30.99 e_istate ptp end
30.100 | _ => cs';
30.101 in compare_step (tacis, c @ c' @ c'', ptp) ifo end
30.102 @@ -706,9 +706,9 @@
30.103 *)
30.104 fun inform (cs as (_, _, ptp as (pt, pos as (p, p_))): calcstate') istr =
30.105 case parse (assoc_thy "Isac.thy") istr of
30.106 -(* val Some ifo = parse (assoc_thy "Isac.thy") istr;
30.107 +(* val SOME ifo = parse (assoc_thy "Isac.thy") istr;
30.108 *)
30.109 - Some ifo =>
30.110 + SOME ifo =>
30.111 let val ifo = term_of ifo
30.112 val fo = case p_ of Frm => get_obj g_form pt p
30.113 | Res => (fst o (get_obj g_result pt)) p
30.114 @@ -717,15 +717,15 @@
30.115 then ("same-formula", cs)
30.116 (*thus ctree not cut with replaceFormula!*)
30.117 else case cas_input ifo of
30.118 -(* val Some (pt, _) = cas_input ifo;
30.119 +(* val SOME (pt, _) = cas_input ifo;
30.120 *)
30.121 - Some (pt, _) => ("ok",([],[],(pt, (p, Met))))
30.122 - | None =>
30.123 + SOME (pt, _) => ("ok",([],[],(pt, (p, Met))))
30.124 + | NONE =>
30.125 compare_step ([],[],(pt,
30.126 (*last step re-calc in compare_step TODO*)
30.127 lev_back pos)) ifo
30.128 end
30.129 - | None => ("syntax error in '"^istr^"'", e_calcstate');
30.130 + | NONE => ("syntax error in '"^istr^"'", e_calcstate');
30.131
30.132
30.133 (*------------------------------------------------------------------(**)
31.1 --- a/src/Tools/isac/ME/mathengine.sml Wed Aug 18 13:53:15 2010 +0200
31.2 +++ b/src/Tools/isac/ME/mathengine.sml Wed Aug 18 13:55:23 2010 +0200
31.3 @@ -66,9 +66,9 @@
31.4 let val p' = par_pblobj pt p
31.5 val (_,pI,_) = get_obj g_spec pt p'
31.6 val (_,(_,oI,_),_) = get_obj g_origin pt p'
31.7 - in if pI <> e_pblID then Some pI
31.8 - else if oI <> e_pblID then Some oI
31.9 - else None end;
31.10 + in if pI <> e_pblID then SOME pI
31.11 + else if oI <> e_pblID then SOME oI
31.12 + else NONE end;
31.13 (*fun get_pblID (pt, (p,_):pos') =
31.14 ((snd3 o (get_obj g_spec pt)) (par_pblobj pt p));*)
31.15
31.16 @@ -148,7 +148,7 @@
31.17 (e_rls, sc, RrlsState (ii t))
31.18 | Rls {srls=srls,scr=sc as Script s,...} =>
31.19 (srls, sc, ScrState ([(one_scr_arg s,t)], [],
31.20 - None, e_term, Sundef, true));
31.21 + NONE, e_term, Sundef, true));
31.22 val pt = update_tac pt (fst p) (Detail_Set (id_rls rls));
31.23 val (p,cid,_,pt) = generate1 thy (Begin_Trans' t) is p pt;
31.24 val nx = (tac_2tac o fst3) (next_tac (thy',srls) (pt,p) sc is);
31.25 @@ -186,7 +186,7 @@
31.26 Apply_Method mI =>
31.27 (* val Apply_Method mI = tac;
31.28 *)
31.29 - nxt_solv (Apply_Method' (mI, None, e_istate)) e_istate ptp
31.30 + nxt_solv (Apply_Method' (mI, NONE, e_istate)) e_istate ptp
31.31 | _ => nxt_specif tac ptp end
31.32 end;
31.33
31.34 @@ -253,9 +253,9 @@
31.35 (* val [] = tacis;
31.36 *)
31.37 | _ => (case pIopt of
31.38 - None => ("no-fmz-spec", ([], [], ptp))
31.39 - | Some pI =>
31.40 -(* val Some pI = pIopt;
31.41 + NONE => ("no-fmz-spec", ([], [], ptp))
31.42 + | SOME pI =>
31.43 +(* val SOME pI = pIopt;
31.44 val cs = (if p_ mem [Pbl,Met] andalso is_none (get_obj g_env pt (fst p))
31.45 then nxt_specify_ (pt,ip) else nxt_solve_ (pt,ip))
31.46 handle _ => ([], ptp);
31.47 @@ -396,12 +396,12 @@
31.48 fun tryrefine pI pt (pos as (p,_):pos') =
31.49 let val PblObj {probl,origin=(os,_,hdl),...} = get_obj I pt p
31.50 in case refine_pbl (assoc_thy "Isac.thy") pI probl of
31.51 - None => (*copy from context_pbl*)
31.52 + NONE => (*copy from context_pbl*)
31.53 let val {ppc,where_,prls,...} = get_pbt pI
31.54 val (_, (pbl, pre)) = match_itms_oris (assoc_thy "Isac.thy")
31.55 probl (ppc,where_,prls) os
31.56 in (false, pI, hdl, pbl, pre) end
31.57 - | Some (pI, (pbl, pre)) =>
31.58 + | SOME (pI, (pbl, pre)) =>
31.59 (true, pI, hdl, pbl, pre)
31.60 end;
31.61
32.1 --- a/src/Tools/isac/ME/ptyps.sml Wed Aug 18 13:53:15 2010 +0200
32.2 +++ b/src/Tools/isac/ME/ptyps.sml Wed Aug 18 13:55:23 2010 +0200
32.3 @@ -450,7 +450,7 @@
32.4 it contains "#Given","#Where","#Find","#Relate"-patterns*)
32.5 met : metID list}; (* methods solving the pbt*)
32.6 val e_pbt = {guh="pbl_empty",mathauthors=[],init=e_pblID,thy=ProtoPure.thy,
32.7 - cas=None,prls=Erls,where_=[],ppc=[],met=[]}:pbt;
32.8 + cas=NONE,prls=Erls,where_=[],ppc=[],met=[]}:pbt;
32.9 fun pbt2 (str, (t1, t2)) =
32.10 pair2str (str, pair2str (term2str t1, term2str t2));
32.11 fun pbt2str pbt = (strs2str o (map (linefeed o pbt2))) pbt;
32.12 @@ -556,29 +556,29 @@
32.13 "pbl_" =>
32.14 let fun node ids gu (Ptyp (id,[n as {guh,...} : pbt], ns)) =
32.15 if gu = guh
32.16 - then Some ((ids@[id]) : kestoreID)
32.17 + then SOME ((ids@[id]) : kestoreID)
32.18 else nodes (ids@[id]) gu ns
32.19 - and nodes _ _ [] = None
32.20 + and nodes _ _ [] = NONE
32.21 | nodes ids gu (n::ns) =
32.22 - case node ids gu n of Some id => Some id
32.23 - | None => nodes ids gu ns
32.24 + case node ids gu n of SOME id => SOME id
32.25 + | NONE => nodes ids gu ns
32.26 in case nodes [] guh (!ptyps) of
32.27 - Some id => rev id
32.28 - | None => error ("guh2kestoreID: '" ^ guh ^ "' " ^
32.29 + SOME id => rev id
32.30 + | NONE => error ("guh2kestoreID: '" ^ guh ^ "' " ^
32.31 "not found in (!ptyps)")
32.32 end
32.33 | "met_" =>
32.34 let fun node ids gu (Ptyp (id,[n as {guh,...} : met], ns)) =
32.35 if gu = guh
32.36 - then Some ((ids@[id]) : kestoreID)
32.37 + then SOME ((ids@[id]) : kestoreID)
32.38 else nodes (ids@[id]) gu ns
32.39 - and nodes _ _ [] = None
32.40 + and nodes _ _ [] = NONE
32.41 | nodes ids gu (n::ns) =
32.42 - case node ids gu n of Some id => Some id
32.43 - | None => nodes ids gu ns
32.44 + case node ids gu n of SOME id => SOME id
32.45 + | NONE => nodes ids gu ns
32.46 in case nodes [] guh (!mets) of
32.47 - Some id => id
32.48 - | None => error ("guh2kestoreID: '" ^ guh ^ "' " ^
32.49 + SOME id => id
32.50 + | NONE => error ("guh2kestoreID: '" ^ guh ^ "' " ^
32.51 "not found in (!mets)") end
32.52 | _ => error ("guh2kestoreID called with '" ^ guh ^ "'");
32.53 (*> guh2kestoreID "pbl_equ_univ_lin";
32.54 @@ -634,7 +634,7 @@
32.55 ("#Find" ,["solution ss___"](*___ is copy-named*))
32.56 ],
32.57 append_rls "e_rls" e_rls [(*for preds in where_*)],
32.58 - Some "solveSystem es_ vs_",
32.59 + SOME "solveSystem es_ vs_",
32.60 [])));
32.61 *)
32.62 let fun eq f (f', _) = f = f';
32.63 @@ -704,9 +704,9 @@
32.64 (raise error ("prep_pbt: more than one '#Where' in "^
32.65 (strs2str pblID))));
32.66 in ({guh=guh,mathauthors=maa,init=init,
32.67 - thy=thy,cas= case ca of None => None
32.68 - | Some s =>
32.69 - Some ((term_of o the o (parse thy)) s),
32.70 + thy=thy,cas= case ca of NONE => NONE
32.71 + | SOME s =>
32.72 + SOME ((term_of o the o (parse thy)) s),
32.73 prls=ev,where_=wh,ppc= gi @ fi @ re,
32.74 met=metIDs}, pblID):pbt * pblID end;
32.75 (* prep_pbt thy (pblID, dsc_dats, metIDs);
32.76 @@ -882,32 +882,32 @@
32.77 for matching a problemtype; returns true only for itms found in pbt .*)
32.78 fun chk_ thy pbt ((i,vats,b,f,Cor ((d,vs),_)):itm) =
32.79 (case find_first (eq1 d) pbt of
32.80 - Some (_,(_,id)) => ((i,vats,b,f,Cor ((d,vs),
32.81 + SOME (_,(_,id)) => ((i,vats,b,f,Cor ((d,vs),
32.82 (id, pbl_ids' thy d vs))):itm)
32.83 - | None => (i,vats,false,f,Sup (d,vs)))
32.84 + | NONE => (i,vats,false,f,Sup (d,vs)))
32.85 | chk_ thy pbt ((i,vats,b,f,Inc ((d,vs),_)):itm) =
32.86 (case find_first (eq1 d) pbt of
32.87 - Some (_,(_,id)) => ((i,vats,b,f,Cor ((d,vs),
32.88 + SOME (_,(_,id)) => ((i,vats,b,f,Cor ((d,vs),
32.89 (id, pbl_ids' thy d vs))):itm)
32.90 - | None => (i,vats,false,f,Sup (d,vs)))
32.91 + | NONE => (i,vats,false,f,Sup (d,vs)))
32.92
32.93 | chk_ thy pbt (itm as (i,vats,b,f,Syn ct):itm) = itm
32.94 | chk_ thy pbt (itm as (i,vats,b,f,Typ ct):itm) = itm
32.95
32.96 | chk_ thy pbt ((i,vats,b,f,Sup (d,vs)):itm) =
32.97 (case find_first (eq1 d) pbt of
32.98 - Some (_,(_,id)) => ((i,vats,b,f,Cor ((d,vs),
32.99 + SOME (_,(_,id)) => ((i,vats,b,f,Cor ((d,vs),
32.100 (id, pbl_ids' thy d vs))):itm)
32.101 - | None => (i,vats,false,f,Sup (d,vs)))
32.102 + | NONE => (i,vats,false,f,Sup (d,vs)))
32.103 (* val (i,vats,b,f,Mis (d,vs)) = i4;
32.104 *)
32.105 | chk_ thy pbt ((i,vats,b,f,Mis (d,vs)):itm) =
32.106 (case find_first (eq1 d) pbt of
32.107 -(* val Some (_,(_,id)) = find_first (eq1 d) pbt;
32.108 +(* val SOME (_,(_,id)) = find_first (eq1 d) pbt;
32.109 *)
32.110 - Some (_,(_,id)) => raise error "chk_: ((i,vats,b,f,Cor ((d,vs),\
32.111 + SOME (_,(_,id)) => raise error "chk_: ((i,vats,b,f,Cor ((d,vs),\
32.112 \(id, pbl_ids' d vs))):itm)"
32.113 - | None => (i,vats,false,f,Sup (d,[vs])));
32.114 + | NONE => (i,vats,false,f,Sup (d,[vs])));
32.115
32.116 (* chk_ thy pbt i
32.117 *)
32.118 @@ -931,10 +931,10 @@
32.119 if such one is untouched, return this one, otherwise create new itm .*)
32.120 fun chk_m (itms:itm list) untouched (p as (f,(d,id))) =
32.121 case find_first (eq2 p) itms of
32.122 - Some _ => []
32.123 - | None => (case find_first (eq2 p) untouched of
32.124 - Some itm => [itm]
32.125 - | None => [(0,[],false,f,Mis (d,id)):itm]);
32.126 + SOME _ => []
32.127 + | NONE => (case find_first (eq2 p) untouched of
32.128 + SOME itm => [itm]
32.129 + | NONE => [(0,[],false,f,Mis (d,id)):itm]);
32.130 (* val itms = itms'';
32.131 *)
32.132 fun chk_mis mvat itms untouched pbt =
32.133 @@ -976,7 +976,7 @@
32.134
32.135 fun eqdsc_pbt_itm ((_,(d,_))) ((_,_,_,_,itm_):itm) = d = d_in itm_;
32.136 fun notmem pbl pbt1 = case find_first (eqdsc_pbt_itm pbt1) pbl of
32.137 - Some _ => false | None => true;
32.138 + SOME _ => false | NONE => true;
32.139 (*1*)val mis = (*(map (cons2 (fst, fst o snd)))o*) (filter (notmem pbl)) pbt;
32.140
32.141 fun eqdsc_ori (_,(d,_)) ((_,_,_,d',_):ori) = d = d';
32.142 @@ -1002,18 +1002,18 @@
32.143 returns true only for itms found in pbt .*)
32.144 fun chk1_ thy pbt ((i,vats,f,d,vs):ori) =
32.145 case find_first (eq1 d) pbt of
32.146 - Some (_,(_,id)) => [(i,vats,true,f,
32.147 + SOME (_,(_,id)) => [(i,vats,true,f,
32.148 Cor ((d,vs), (id, pbl_ids' thy d vs))):itm]
32.149 - | None => [];
32.150 + | NONE => [];
32.151
32.152 (* elem 'p' of pbt contained in itms ? *)
32.153 fun chk1_m (itms:itm list) p =
32.154 case find_first (eq2 p) itms of
32.155 - Some _ => true | None => false;
32.156 + SOME _ => true | NONE => false;
32.157 fun chk1_m' (oris: ori list) (p as (f,(d,t))) =
32.158 case find_first (eq2' p) oris of
32.159 - Some _ => []
32.160 - | None => [(f, Mis (d, t))];
32.161 + SOME _ => []
32.162 + | NONE => [(f, Mis (d, t))];
32.163 fun pair0vatsfalse (f,itm_) = (0,[],false,f,itm_):itm;
32.164
32.165 fun chk1_mis mvat itms ppc = foldl and_ (true, map (chk1_m itms) ppc);
32.166 @@ -1114,19 +1114,19 @@
32.167 fun refin (pblRD:pblRD) ori
32.168 ((Ptyp (pI,[py],[])):pbt ptyp) =
32.169 if match_oris (#thy py) (#prls py) ori (#ppc py, #where_ py)
32.170 - then Some ((pblRD @ [pI]):pblRD)
32.171 - else None
32.172 + then SOME ((pblRD @ [pI]):pblRD)
32.173 + else NONE
32.174 | refin pblRD ori (Ptyp (pI,[py],pys)) =
32.175 if match_oris (#thy py) (#prls py) ori (#ppc py, #where_ py)
32.176 then (case refins (pblRD @ [pI]) ori pys of
32.177 - Some pblRD' => Some pblRD'
32.178 - | None => Some (pblRD @ [pI]))
32.179 - else None
32.180 -and refins pblRD ori [] = None
32.181 + SOME pblRD' => SOME pblRD'
32.182 + | NONE => SOME (pblRD @ [pI]))
32.183 + else NONE
32.184 +and refins pblRD ori [] = NONE
32.185 | refins pblRD ori ((p as Ptyp (pI,_,_))::pts) =
32.186 (case refin pblRD ori p of
32.187 - Some pblRD' => Some pblRD'
32.188 - | None => refins pblRD ori pts);
32.189 + SOME pblRD' => SOME pblRD'
32.190 + | NONE => refins pblRD ori pts);
32.191
32.192 (*. refine a problem; version providing output for math-experts .*)
32.193 fun refin' (pblRD:pblRD) fmz pbls ((Ptyp (pI,[py],[])):pbt ptyp) =
32.194 @@ -1213,10 +1213,10 @@
32.195 let val opt = app_ptyp (refin ((rev o tl) pblID) oris)
32.196 pblID (rev pblID) (!ptyps);
32.197 in case opt of
32.198 - Some pblRD => let val (pblID':pblID) =(rev pblRD)
32.199 - in if pblID' = pblID then None
32.200 - else Some pblID' end
32.201 - | None => None end;
32.202 + SOME pblRD => let val (pblID':pblID) =(rev pblRD)
32.203 + in if pblID' = pblID then NONE
32.204 + else SOME pblID' end
32.205 + | NONE => NONE end;
32.206 fun refine_ori' oris pI = (the (refine_ori oris pI)) handle _ => pI;
32.207
32.208 (*. for tactic Refine_Problem .*);
32.209 @@ -1226,9 +1226,9 @@
32.210 fun refine_pbl thy (pblID:pblID) itms =
32.211 case refined_ (app_ptyp (refin'' thy ((rev o tl) pblID) itms [])
32.212 pblID (rev pblID) (!ptyps)) of
32.213 - None => None
32.214 - | Some (Match_ (rfd as (pI',_))) =>
32.215 - if pblID = pI' then None else Some rfd;
32.216 + NONE => NONE
32.217 + | SOME (Match_ (rfd as (pI',_))) =>
32.218 + if pblID = pI' then NONE else SOME rfd;
32.219
32.220
32.221 (*. for math-experts .*)
33.1 --- a/src/Tools/isac/ME/rewtools.sml Wed Aug 18 13:53:15 2010 +0200
33.2 +++ b/src/Tools/isac/ME/rewtools.sml Wed Aug 18 13:55:23 2010 +0200
33.3 @@ -32,8 +32,8 @@
33.4 val (lhs,rhs) = (dest_equals' o strip_trueprop
33.5 o Logic.strip_imp_concl) prop;
33.6 val prop' = case strip_imp_prems' prop of
33.7 - None => Trueprop $ (mk_equality (rhs, lhs))
33.8 - | Some cs =>
33.9 + NONE => Trueprop $ (mk_equality (rhs, lhs))
33.10 + | SOME cs =>
33.11 ins_concl cs (Trueprop $ (mk_equality (rhs, lhs)));
33.12 in assbl_thm sign_ref der maxidx shyps hyps (*tpairs*) prop' end;
33.13 (*
33.14 @@ -64,7 +64,7 @@
33.15
33.16
33.17
33.18 -(*.derive normalform of a rls, or derive until Some goal,
33.19 +(*.derive normalform of a rls, or derive until SOME goal,
33.20 and record rules applied and rewrites.
33.21 val it = fn
33.22 : theory
33.23 @@ -86,22 +86,22 @@
33.24 and unreflectedly adapted to extion of rules by Rls_: returns Rls_("sym_simpl..
33.25 -- replaced below*)
33.26 (* val (thy, erls, rs, ro, goal, tt) = (thy, erls, rs, ro, goal, t);
33.27 - val (thy, erls, rs, ro, goal, tt) = (thy, Atools_erls, rules, ro, None, tt);
33.28 + val (thy, erls, rs, ro, goal, tt) = (thy, Atools_erls, rules, ro, NONE, tt);
33.29 *)
33.30 fun make_deriv thy erls (rs:rule list) ro(*rew_ord*) goal tt =
33.31 let datatype switch = Appl | Noap
33.32 fun rew_once lim rts t Noap [] =
33.33 (case goal of
33.34 - None => rts
33.35 - | Some g =>
33.36 + NONE => rts
33.37 + | SOME g =>
33.38 raise error ("make_deriv: no derivation for "^(term2str t)))
33.39 | rew_once lim rts t Appl [] =
33.40 (*(case rs of Rls _ =>*) rew_once lim rts t Noap rs
33.41 (*| Seq _ => rts) FIXXXXXME 14.3.03*)
33.42 | rew_once lim rts t apno rs' =
33.43 (case goal of
33.44 - None => rew_or_calc lim rts t apno rs'
33.45 - | Some g =>
33.46 + NONE => rew_or_calc lim rts t apno rs'
33.47 + | SOME g =>
33.48 if g = t then rts
33.49 else rew_or_calc lim rts t apno rs')
33.50 and rew_or_calc lim rts t apno (rrs' as (r::rs')) =
33.51 @@ -114,8 +114,8 @@
33.52 (if not (!trace_rewrite) then () else
33.53 writeln ("### trying thm '" ^ thmid ^ "'");
33.54 case rewrite_ thy ro erls true tm t of
33.55 - None => rew_once lim rts t apno rs'
33.56 - | Some (t',a') =>
33.57 + NONE => rew_once lim rts t apno rs'
33.58 + | SOME (t',a') =>
33.59 (if ! trace_rewrite
33.60 then writeln ("### rewrites to: "^(term2str t')) else();
33.61 rew_once (lim-1) (rts@[(t,r,(t',a'))]) t' Appl rrs'))
33.62 @@ -124,9 +124,9 @@
33.63 writeln ("### trying calc. '" ^ op_ ^ "'")
33.64 val t = uminus_to_string t
33.65 in case get_calculation_ thy c t of
33.66 - None => rew_once lim rts t apno rs'
33.67 - | Some (thmid, tm) =>
33.68 - (let val Some (t',a') = rewrite_ thy ro erls true tm t
33.69 + NONE => rew_once lim rts t apno rs'
33.70 + | SOME (thmid, tm) =>
33.71 + (let val SOME (t',a') = rewrite_ thy ro erls true tm t
33.72 val _ = if not (!trace_rewrite) then () else
33.73 writeln("### calc. to: " ^ (term2str t'))
33.74 val r' = Thm (thmid, tm)
33.75 @@ -141,15 +141,15 @@
33.76 writeln((idt"#"(i+1))^" try cal1: "^op_^"'") else ();
33.77 val ct = uminus_to_string ct
33.78 in case get_calculation_ thy cc ct of
33.79 - None => (ct, asm)
33.80 - | Some (thmid, thm') =>
33.81 + NONE => (ct, asm)
33.82 + | SOME (thmid, thm') =>
33.83 let
33.84 val pairopt =
33.85 rewrite__ thy (i+1) bdv ((snd o #rew_ord o rep_rls) rls)
33.86 ((#erls o rep_rls) rls) put_asm thm' ct;
33.87 - val _ = if pairopt <> None then ()
33.88 + val _ = if pairopt <> NONE then ()
33.89 else raise error("rewrite_set_, rewrite_ \""^
33.90 - (string_of_thmI thm')^"\" "^(term2str ct)^" = None")
33.91 + (string_of_thmI thm')^"\" "^(term2str ct)^" = NONE")
33.92 val _ = if ! trace_rewrite andalso i < ! depth
33.93 then writeln((idt"="(i+1))^" cal1. to: "^
33.94 (term2str ((fst o the) pairopt)))
33.95 @@ -159,13 +159,13 @@
33.96 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*)
33.97 | Rls_ rls =>
33.98 (case rewrite_set_ thy true rls t of
33.99 - None => rew_once lim rts t apno rs'
33.100 - | Some (t',a') =>
33.101 + NONE => rew_once lim rts t apno rs'
33.102 + | SOME (t',a') =>
33.103 rew_once (lim-1) (rts @ [(t,r,(t',a'))]) t' Appl rrs');
33.104 (*WN060829 | Rls_ rls =>
33.105 (case rewrite_set_ thy true rls t of
33.106 - None => rew_once lim rts t apno rs'
33.107 - | Some (t',a') =>
33.108 + NONE => rew_once lim rts t apno rs'
33.109 + | SOME (t',a') =>
33.110 if ro [] (t, t') then rew_once lim rts t apno rs'
33.111 else rew_once (lim-1) (rts@[(t,r,(t',a'))]) t' Appl rrs');
33.112 ...lead to deriv = [] with make_polynomial.
33.113 @@ -227,7 +227,7 @@
33.114
33.115 (*version for reverse rewrite used before 040214*)
33.116 fun rev_deriv (t, r, (t', a)) = (sym_Thm r, (t, a));
33.117 -(* val (thy, erls, rs, ro, goal, t) = (thy, eval_rls, rules, ro, None, t');
33.118 +(* val (thy, erls, rs, ro, goal, t) = (thy, eval_rls, rules, ro, NONE, t');
33.119 *)
33.120 fun reverse_deriv thy erls (rs:rule list) ro(*rew_ord*) goal t =
33.121 (rev o (map rev_deriv)) (make_deriv thy erls (rs:rule list) ro goal t);
33.122 @@ -382,10 +382,10 @@
33.123 (#1:theory' * theory -> theory'))
33.124 (rev (!theory'))
33.125 in case find_first (thy_contains_thm str) startsearch of
33.126 - Some (thy',_) => ("IsacKnowledge", thy')
33.127 - | None => (case assoc (!isab_thm_thy (*see Isac.ML*), str) of
33.128 - Some (thyID,_) => ("Isabelle", thyID)
33.129 - | None =>
33.130 + SOME (thy',_) => ("IsacKnowledge", thy')
33.131 + | NONE => (case assoc (!isab_thm_thy (*see Isac.ML*), str) of
33.132 + SOME (thyID,_) => ("Isabelle", thyID)
33.133 + | NONE =>
33.134 raise error ("thy_containing_thm: theorem '"^str^
33.135 "' not in !theory' above thy '"^thy'^"'"))
33.136 end;
33.137 @@ -410,7 +410,7 @@
33.138 -> theory'))
33.139 (rev (!ruleset'))
33.140 in case assoc (startsearch, rls') of
33.141 - Some (thy', _) => ("IsacKnowledge", thyID2theory' thy')
33.142 + SOME (thy', _) => ("IsacKnowledge", thyID2theory' thy')
33.143 | _ => raise error ("thy_containing_rls : rls '"^rls'^
33.144 "' not in !rulset' above thy '"^thy'^"'")
33.145 end;
33.146 @@ -426,7 +426,7 @@
33.147 val startsearch = filter_out ((curry ((op mem) o swap) dropthy's) o
33.148 (#1 : calc -> string)) (rev (!calclist'))
33.149 in case assoc (startsearch, strip_thy termop) of
33.150 - Some (th_termop, _) => ("IsacKnowledge", strip_thy th_termop)
33.151 + SOME (th_termop, _) => ("IsacKnowledge", strip_thy th_termop)
33.152 | _ => raise error ("thy_containing_rls : rls '"^termop^
33.153 "' not in !calclist' above thy '"^thy'^"'")
33.154 end;
33.155 @@ -653,19 +653,19 @@
33.156 fun try_rew thy ((_, ro):rew_ord) erls (subst:subst) f (thm' as Thm(id, thm)) =
33.157 if contains_bdv thm
33.158 then case rewrite_inst_ thy ro erls false subst thm f of
33.159 - Some (f',_) =>[rule2tac subst thm']
33.160 - | None => []
33.161 + SOME (f',_) =>[rule2tac subst thm']
33.162 + | NONE => []
33.163 else (case rewrite_ thy ro erls false thm f of
33.164 - Some (f',_) => [rule2tac [] thm']
33.165 - | None => [])
33.166 + SOME (f',_) => [rule2tac [] thm']
33.167 + | NONE => [])
33.168 | try_rew thy _ _ _ f (cal as Calc c) =
33.169 (case get_calculation_ thy c f of
33.170 - Some (str, _) => [rule2tac [] cal]
33.171 - | None => [])
33.172 + SOME (str, _) => [rule2tac [] cal]
33.173 + | NONE => [])
33.174 | try_rew thy _ _ _ f (cal as Cal1 c) =
33.175 (case get_calculation_ thy c f of
33.176 - Some (str, _) => [rule2tac [] cal]
33.177 - | None => [])
33.178 + SOME (str, _) => [rule2tac [] cal]
33.179 + | NONE => [])
33.180 | try_rew thy _ _ subst f (Rls_ rls) = filter_appl_rews thy subst f rls
33.181 and filter_appl_rews thy subst f (Rls {rew_ord = ro, erls, rules,...}) =
33.182 distinct (flat (map (try_rew thy ro erls subst f) rules))
34.1 --- a/src/Tools/isac/ME/script.sml Wed Aug 18 13:53:15 2010 +0200
34.2 +++ b/src/Tools/isac/ME/script.sml Wed Aug 18 13:55:23 2010 +0200
34.3 @@ -137,20 +137,20 @@
34.4
34.5 (* get a subterm t with test t, and record location *)
34.6 fun get l test (t as Const (s,T)) =
34.7 - if test t then Some (l,t) else None
34.8 + if test t then SOME (l,t) else NONE
34.9 | get l test (t as Free (s,T)) =
34.10 - if test t then Some (l,t) else None
34.11 + if test t then SOME (l,t) else NONE
34.12 | get l test (t as Bound n) =
34.13 - if test t then Some (l,t) else None
34.14 + if test t then SOME (l,t) else NONE
34.15 | get l test (t as Var (s,T)) =
34.16 - if test t then Some (l,t) else None
34.17 + if test t then SOME (l,t) else NONE
34.18 | get l test (t as Abs (s,T,body)) =
34.19 - if test t then Some (l:loc_,t) else get ((l@[D]):loc_) test body
34.20 + if test t then SOME (l:loc_,t) else get ((l@[D]):loc_) test body
34.21 | get l test (t as t1 $ t2) =
34.22 - if test t then Some (l,t)
34.23 + if test t then SOME (l,t)
34.24 else case get (l@[L]) test t1 of
34.25 - None => get (l@[R]) test t2
34.26 - | Some (l',t') => Some (l',t');
34.27 + NONE => get (l@[R]) test t2
34.28 + | SOME (l',t') => SOME (l',t');
34.29 (*18.6.00
34.30 > val sss = ((term_of o the o (parse thy))
34.31 "Script Solve_root_equation (eq_::bool) (v_::real) (err_::bool) =\
34.32 @@ -170,21 +170,21 @@
34.33 (*30.4.02: vvv--- doesnt work with curried functions ---> get_tac ------
34.34 (*18.6.00: below _ALL_ negotiables must be in fun-patterns !
34.35 then the last (non)pattern must be a subproblem*)
34.36 -fun init_frm thy (Const ("Script.Rewrite",_) $ _ $ _ $ eq) = Some eq
34.37 - | init_frm thy (Const ("Script.Rewrite'_Inst",_) $ _ $ _ $ _ $ eq) = Some eq
34.38 - | init_frm thy (Const ("Script.Rewrite'_Set",_) $ _ $ _ $ eq) = Some eq
34.39 +fun init_frm thy (Const ("Script.Rewrite",_) $ _ $ _ $ eq) = SOME eq
34.40 + | init_frm thy (Const ("Script.Rewrite'_Inst",_) $ _ $ _ $ _ $ eq) = SOME eq
34.41 + | init_frm thy (Const ("Script.Rewrite'_Set",_) $ _ $ _ $ eq) = SOME eq
34.42 | init_frm thy (Const ("Script.Rewrite'_Set'_Inst",_) $ _ $ _ $ _ $ eq) =
34.43 - Some eq
34.44 - | init_frm thy (Const ("Script.Calculate",_) $ _ $ t) = Some t
34.45 + SOME eq
34.46 + | init_frm thy (Const ("Script.Calculate",_) $ _ $ t) = SOME t
34.47 | init_frm thy t =
34.48 (*if ((strip_thy o (term_str thy) o head_of) t) mem (!subpbls)
34.49 - then None
34.50 + then NONE
34.51 else *)raise error ("init_frm: not impl. for "^
34.52 (Sign.string_of_term (sign_of thy) t));
34.53
34.54 > val t = (term_of o the o (parse thy))
34.55 "Rewrite square_equation_left True (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))";
34.56 -> val Some ini = init_frm thy t;
34.57 +> val SOME ini = init_frm thy t;
34.58 > Sign.string_of_term (sign_of thy) ini;
34.59 val it = "sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x)" : string
34.60
34.61 @@ -196,13 +196,13 @@
34.62
34.63 > val t = (term_of o the o (parse thy))
34.64 "Rewrite_Set norm_equation False x + #1 = #2";
34.65 -> val Some ini = init_frm thy t;
34.66 +> val SOME ini = init_frm thy t;
34.67 > Sign.string_of_term (sign_of thy) ini;
34.68 val it = "x + #1 = #2" : string
34.69
34.70 > val t = (term_of o the o (parse thy))
34.71 "Rewrite_Set_Inst [(bdv,x)] isolate_bdv False x + #1 = #2";
34.72 -> val Some ini = init_frm thy t;
34.73 +> val SOME ini = init_frm thy t;
34.74 > Sign.string_of_term (sign_of thy) ini;
34.75 val it = "x + #1 = #2" : string *)
34.76
34.77 @@ -213,49 +213,49 @@
34.78 *)
34.79 let
34.80 fun get_t y (Const ("Script.Seq",_) $ e1 $ e2) a =
34.81 - (case get_t y e1 a of None => get_t y e2 a | la => la)
34.82 + (case get_t y e1 a of NONE => get_t y e2 a | la => la)
34.83 | get_t y (Const ("Script.Seq",_) $ e1 $ e2 $ a) _ =
34.84 - (case get_t y e1 a of None => get_t y e2 a | la => la)
34.85 + (case get_t y e1 a of NONE => get_t y e2 a | la => la)
34.86 | get_t y (Const ("Script.Try",_) $ e) a = get_t y e a
34.87 | get_t y (Const ("Script.Try",_) $ e $ a) _ = get_t y e a
34.88 | get_t y (Const ("Script.Repeat",_) $ e) a = get_t y e a
34.89 | get_t y (Const ("Script.Repeat",_) $ e $ a) _ = get_t y e a
34.90 | get_t y (Const ("Script.Or",_) $e1 $ e2) a =
34.91 - (case get_t y e1 a of None => get_t y e2 a | la => la)
34.92 + (case get_t y e1 a of NONE => get_t y e2 a | la => la)
34.93 | get_t y (Const ("Script.Or",_) $e1 $ e2 $ a) _ =
34.94 - (case get_t y e1 a of None => get_t y e2 a | la => la)
34.95 + (case get_t y e1 a of NONE => get_t y e2 a | la => la)
34.96 | get_t y (Const ("Script.While",_) $ c $ e) a = get_t y e a
34.97 | get_t y (Const ("Script.While",_) $ c $ e $ a) _ = get_t y e a
34.98 | get_t y (Const ("Script.Letpar",_) $ e1 $ Abs (_,_,e2)) a =
34.99 - (case get_t y e1 a of None => get_t y e2 a | la => la)
34.100 + (case get_t y e1 a of NONE => get_t y e2 a | la => la)
34.101 (*| get_t y (Const ("Let",_) $ e1 $ Abs (_,_,e2)) a =
34.102 (writeln("get_t: Let e1= "^(term2str e1)^", e2= "^(term2str e2));
34.103 - case get_t y e1 a of None => get_t y e2 a | la => la)
34.104 + case get_t y e1 a of NONE => get_t y e2 a | la => la)
34.105 | get_t y (Abs (_,_,e)) a = get_t y e a*)
34.106 | get_t y (Const ("Let",_) $ e1 $ Abs (_,_,e2)) a =
34.107 get_t y e1 a (*don't go deeper without evaluation !*)
34.108 - | get_t y (Const ("If",_) $ c $ e1 $ e2) a = None
34.109 - (*(case get_t y e1 a of None => get_t y e2 a | la => la)*)
34.110 + | get_t y (Const ("If",_) $ c $ e1 $ e2) a = NONE
34.111 + (*(case get_t y e1 a of NONE => get_t y e2 a | la => la)*)
34.112
34.113 - | get_t y (Const ("Script.Rewrite",_) $ _ $ _ $ a) _ = Some a
34.114 - | get_t y (Const ("Script.Rewrite",_) $ _ $ _ ) a = Some a
34.115 - | get_t y (Const ("Script.Rewrite'_Inst",_) $ _ $ _ $ _ $ a) _ = Some a
34.116 - | get_t y (Const ("Script.Rewrite'_Inst",_) $ _ $ _ $ _ ) a = Some a
34.117 - | get_t y (Const ("Script.Rewrite'_Set",_) $ _ $ _ $ a) _ = Some a
34.118 - | get_t y (Const ("Script.Rewrite'_Set",_) $ _ $ _ ) a = Some a
34.119 - | get_t y (Const ("Script.Rewrite'_Set'_Inst",_) $ _ $ _ $ _ $a)_ =Some a
34.120 - | get_t y (Const ("Script.Rewrite'_Set'_Inst",_) $ _ $ _ $ _ ) a =Some a
34.121 - | get_t y (Const ("Script.Calculate",_) $ _ $ a) _ = Some a
34.122 - | get_t y (Const ("Script.Calculate",_) $ _ ) a = Some a
34.123 + | get_t y (Const ("Script.Rewrite",_) $ _ $ _ $ a) _ = SOME a
34.124 + | get_t y (Const ("Script.Rewrite",_) $ _ $ _ ) a = SOME a
34.125 + | get_t y (Const ("Script.Rewrite'_Inst",_) $ _ $ _ $ _ $ a) _ = SOME a
34.126 + | get_t y (Const ("Script.Rewrite'_Inst",_) $ _ $ _ $ _ ) a = SOME a
34.127 + | get_t y (Const ("Script.Rewrite'_Set",_) $ _ $ _ $ a) _ = SOME a
34.128 + | get_t y (Const ("Script.Rewrite'_Set",_) $ _ $ _ ) a = SOME a
34.129 + | get_t y (Const ("Script.Rewrite'_Set'_Inst",_) $ _ $ _ $ _ $a)_ =SOME a
34.130 + | get_t y (Const ("Script.Rewrite'_Set'_Inst",_) $ _ $ _ $ _ ) a =SOME a
34.131 + | get_t y (Const ("Script.Calculate",_) $ _ $ a) _ = SOME a
34.132 + | get_t y (Const ("Script.Calculate",_) $ _ ) a = SOME a
34.133
34.134 - | get_t y (Const ("Script.Substitute",_) $ _ $ a) _ = Some a
34.135 - | get_t y (Const ("Script.Substitute",_) $ _ ) a = Some a
34.136 + | get_t y (Const ("Script.Substitute",_) $ _ $ a) _ = SOME a
34.137 + | get_t y (Const ("Script.Substitute",_) $ _ ) a = SOME a
34.138
34.139 - | get_t y (Const ("Script.SubProblem",_) $ _ $ _) _ = None
34.140 + | get_t y (Const ("Script.SubProblem",_) $ _ $ _) _ = NONE
34.141
34.142 | get_t y x _ =
34.143 ((*writeln ("### get_t yac: list-expr "^(term2str x));*)
34.144 - None)
34.145 + NONE)
34.146 in get_t thy body e_term end;
34.147
34.148 (*FIXME: get 1st stac by next_stac [] instead of ... ?? 29.7.02*)
34.149 @@ -263,9 +263,9 @@
34.150 *)
34.151 fun init_form thy (Script sc) env =
34.152 (case get_stac thy sc of
34.153 - None => None (*raise error ("init_form: no 1st stac in "^
34.154 + NONE => NONE (*raise error ("init_form: no 1st stac in "^
34.155 (Sign.string_of_term (sign_of thy) sc))*)
34.156 - | Some stac => Some (subst_atomic env stac))
34.157 + | SOME stac => SOME (subst_atomic env stac))
34.158 | init_form _ _ _ = raise error "init_form: no match";
34.159
34.160 (* use"ME/script.sml";
34.161 @@ -310,12 +310,12 @@
34.162
34.163
34.164 (*WN020526: not clear, when a is available in ass_up for eva-_true*)
34.165 -(*WN060906: in "fun handle_leaf" eg. uses "Some M__"(from some PREVIOUS
34.166 +(*WN060906: in "fun handle_leaf" eg. uses "SOME M__"(from some PREVIOUS
34.167 curried Rewrite) for CURRENT value (which may be different from PREVIOUS);
34.168 - thus "None" must be set at the end of currying (ill designed anyway)*)
34.169 -fun upd_env_opt env (Some a, v) = upd_env env (a,v)
34.170 - | upd_env_opt env (None, v) =
34.171 - (writeln("*** upd_env_opt: (None,"^(term2str v)^")");env);
34.172 + thus "NONE" must be set at the end of currying (ill designed anyway)*)
34.173 +fun upd_env_opt env (SOME a, v) = upd_env env (a,v)
34.174 + | upd_env_opt env (NONE, v) =
34.175 + (writeln("*** upd_env_opt: (NONE,"^(term2str v)^")");env);
34.176
34.177
34.178 type dsc = typ; (*<-> nam..unknow in Descript.thy*)
34.179 @@ -377,11 +377,11 @@
34.180 fun test_dsc d (_,_,_,_,itm_) = (d = d_in itm_)
34.181 fun itm2arg itms (_,(d,_)) =
34.182 case find_first (test_dsc d) itms of
34.183 - None =>
34.184 + NONE =>
34.185 raise error ("itms2args: '"^term2str d^"' not in itms")
34.186 - (*| Some (_,_,_,_,itm_) => mk_arg thy (d_in itm_) (ts_in itm_);
34.187 + (*| SOME (_,_,_,_,itm_) => mk_arg thy (d_in itm_) (ts_in itm_);
34.188 penv postponed; presently penv holds already env for script*)
34.189 - | Some (_,_,_,_,itm_) => penvval_in itm_
34.190 + | SOME (_,_,_,_,itm_) => penvval_in itm_
34.191 fun sel_given_find (s,_) = (s = "#Given") orelse (s = "#Find")
34.192 val pats = (#ppc o get_met) mI
34.193 in (flat o (map (itm2arg itms))) pats end;
34.194 @@ -506,8 +506,8 @@
34.195 val dI = theory2theory' thy (*.take dI from _refined_ pbl.*)
34.196 val dI = theory2theory' (maxthy (assoc_thy dI) (rootthy pt));
34.197 val hdl = case cas of
34.198 - None => pblterm dI pI
34.199 - | Some t => subst_atomic ((vars_of_pbl_' ppc) ~~~ vals) t
34.200 + NONE => pblterm dI pI
34.201 + | SOME t => subst_atomic ((vars_of_pbl_' ppc) ~~~ vals) t
34.202 val f = subpbl (strip_thy dI) pI
34.203 in (Subproblem (dI, pI),
34.204 Subproblem' ((dI, pI, mI), pors, hdl, fmz_, f))
34.205 @@ -557,7 +557,7 @@
34.206 "#0 <= #9 + #4 * x & #0 <= sqrt x + sqrt (#-3 + x)";
34.207 > val pred = subst_atomic [s] asm;
34.208 > rewrite_set_ thy false (cterm_of (sign_of thy) pred);
34.209 -val it = None : (cterm * cterm list) option !!!!!!!!!!!!!!!!!!!!!!!!!!!!
34.210 +val it = NONE : (cterm * cterm list) option !!!!!!!!!!!!!!!!!!!!!!!!!!!!
34.211 > eval_true' (string_of_thy thy) "eval_rls" (subst_atomic [s] pred);
34.212 val it = false : bool
34.213
34.214 @@ -567,7 +567,7 @@
34.215 "#0 <= #9 + #4 * x & #0 <= sqrt x + sqrt (#5 + x)";
34.216 > val pred = subst_atomic [s] asm;
34.217 > rewrite_set_ thy false (cterm_of (sign_of thy) pred);
34.218 -val it = Some ("True & True",[]) : (cterm * cterm list) option
34.219 +val it = SOME ("True & True",[]) : (cterm * cterm list) option
34.220 > eval_true' (string_of_thy thy) "eval_rls" (subst_atomic [s] pred);
34.221 val it = true : bool`*)
34.222
34.223 @@ -661,7 +661,7 @@
34.224 "Rewrite rroot_square_inv False (#0+(sqrt(sqrt(sqrt a))^^^#2)^^^#2=#0)";
34.225 > assod e_rls m stac;
34.226 val it =
34.227 - (Some (Rewrite' (#,#,#,#,#,#,#)),Const ("empty","RealDef.real"),
34.228 + (SOME (Rewrite' (#,#,#,#,#,#,#)),Const ("empty","RealDef.real"),
34.229 Const ("empty","RealDef.real")) : tac_ option * term * term*)
34.230
34.231 | assod pt d (m as Rewrite_Set_Inst' (thy',put,sub,rls,f,(f',asm)))
34.232 @@ -773,8 +773,8 @@
34.233 val dI = theory2theory' thy (*take dI from _refined_ pbl*)
34.234 val dI = theory2theory' (maxthy (assoc_thy dI) (rootthy pt))
34.235 val hdl = case cas of
34.236 - None => pblterm dI pI
34.237 - | Some t => subst_atomic ((vars_of_pbl_' ppc) ~~~ vals) t
34.238 + NONE => pblterm dI pI
34.239 + | SOME t => subst_atomic ((vars_of_pbl_' ppc) ~~~ vals) t
34.240 val f = subpbl (strip_thy dI) pI
34.241 in if domID = dI andalso pblID = pI
34.242 then Ass (Subproblem' ((dI, pI, mI), pors, hdl, fmz_, f), f)
34.243 @@ -930,10 +930,10 @@
34.244 rep_tac_ (Rewrite'
34.245 ("Script.thy","tless_true","eval_rls",false,
34.246 ("square_equation_left",""),f,(f',[])));
34.247 -> val Some ct = parse thy
34.248 +> val SOME ct = parse thy
34.249 "Rewrite square_equation_left True (x=#1+#2)";
34.250 > rewrite_ Script.thy tless_true eval_rls true thm ct;
34.251 -val it = Some ("x = #3",[]) : (cterm * cterm list) option
34.252 +val it = SOME ("x = #3",[]) : (cterm * cterm list) option
34.253 *)
34.254 | rep_tac_ (Rewrite_Set_Inst'
34.255 (thy',put,subs,rls,f,(f',asm))) =
34.256 @@ -1102,7 +1102,7 @@
34.257 ((*writeln("### assy While $ c $ e $ a, upd_env= "^
34.258 (subst2str (upd_env E (a,v))));*)
34.259 if eval_true_ thy srls (subst_atomic (upd_env E (a,v)) c)
34.260 - then assy ya ((E, l@[L,R], Some a,v,S,b),ss) e
34.261 + then assy ya ((E, l@[L,R], SOME a,v,S,b),ss) e
34.262 else NasNap (v, E))
34.263
34.264 | assy (ya as (((thy,srls),_),_)) ((E,l,a,v,S,b),ss)
34.265 @@ -1120,7 +1120,7 @@
34.266
34.267 | assy ya ((E,l,_,v,S,b),ss) (Const ("Script.Try",_) $ e $ a) =
34.268 ((*writeln("### assy Try $ e $ a, l= "^(loc_2str l));*)
34.269 - case assy ya ((E, l@[L,R], Some a,v,S,b),ss) e of
34.270 + case assy ya ((E, l@[L,R], SOME a,v,S,b),ss) e of
34.271 ay => ay)
34.272
34.273 | assy ya ((E,l,a,v,S,b),ss) (Const ("Script.Try",_) $ e) =
34.274 @@ -1132,10 +1132,10 @@
34.275 *)
34.276 | assy ya ((E,l,_,v,S,b),ss) (Const ("Script.Seq",_) $e1 $ e2 $ a) =
34.277 ((*writeln("### assy Seq $e1 $ e2 $ a, E= "^(subst2str E));*)
34.278 - case assy ya ((E, l@[L,L,R], Some a,v,S,b),ss) e1 of
34.279 - NasNap (v, E) => assy ya ((E, l@[L,R], Some a,v,S,b),ss) e2
34.280 + case assy ya ((E, l@[L,L,R], SOME a,v,S,b),ss) e1 of
34.281 + NasNap (v, E) => assy ya ((E, l@[L,R], SOME a,v,S,b),ss) e2
34.282 | NasApp ((E,_,_,v,_,_),ss) =>
34.283 - assy ya ((E, l@[L,R], Some a,v,S,b),ss) e2
34.284 + assy ya ((E, l@[L,R], SOME a,v,S,b),ss) e2
34.285 | ay => ay)
34.286
34.287 | assy ya ((E,l,a,v,S,b),ss) (Const ("Script.Seq",_) $e1 $ e2) =
34.288 @@ -1146,20 +1146,20 @@
34.289 | ay => ay)
34.290
34.291 | assy ya ((E,l,_,v,S,b),ss) (Const ("Script.Repeat",_) $ e $ a) =
34.292 - assy ya ((E,(l@[L,R]),Some a,v,S,b),ss) e
34.293 + assy ya ((E,(l@[L,R]),SOME a,v,S,b),ss) e
34.294
34.295 | assy ya ((E,l,a,v,S,b),ss) (Const ("Script.Repeat",_) $ e) =
34.296 assy ya ((E,(l@[R]),a,v,S,b),ss) e
34.297
34.298 (*15.6.02: ass,app Or nochmals "uberlegen FIXXXME*)
34.299 | assy (y, Aundef) ((E,l,_,v,S,b),ss) (Const ("Script.Or",_) $e1 $ e2 $ a) =
34.300 - (case assy (y, AssOnly) ((E,(l@[L,L,R]),Some a,v,S,b),ss) e1 of
34.301 + (case assy (y, AssOnly) ((E,(l@[L,L,R]),SOME a,v,S,b),ss) e1 of
34.302 NasNap (v, E) =>
34.303 - (case assy (y, AssOnly) ((E,(l@[L,R]),Some a,v,S,b),ss) e2 of
34.304 + (case assy (y, AssOnly) ((E,(l@[L,R]),SOME a,v,S,b),ss) e2 of
34.305 NasNap (v, E) =>
34.306 - (case assy (y, AssGen) ((E,(l@[L,L,R]),Some a,v,S,b),ss) e1 of
34.307 + (case assy (y, AssGen) ((E,(l@[L,L,R]),SOME a,v,S,b),ss) e1 of
34.308 NasNap (v, E) =>
34.309 - assy (y, AssGen) ((E, (l@[L,R]), Some a,v,S,b),ss) e2
34.310 + assy (y, AssGen) ((E, (l@[L,R]), SOME a,v,S,b),ss) e2
34.311 | ay => ay)
34.312 | ay =>(ay))
34.313 | NasApp _ => raise error ("assy: FIXXXME ///must not return NasApp///")
34.314 @@ -1306,12 +1306,12 @@
34.315 ((*writeln("### ass_up: While c= "^
34.316 (term2str (subst_atomic (upd_env E (a,v)) c)));*)
34.317 if eval_true_ y s (subst_atomic (upd_env E (a,v)) c)
34.318 - then (case assy (((y,s),d),Aundef) ((E, l@[L,R], Some a,v,S,b),ss) e of
34.319 - NasNap (v,E') => astep_up ys ((E',l, Some a,v,S,b),ss)
34.320 + then (case assy (((y,s),d),Aundef) ((E, l@[L,R], SOME a,v,S,b),ss) e of
34.321 + NasNap (v,E') => astep_up ys ((E',l, SOME a,v,S,b),ss)
34.322 | NasApp ((E',l,a,v,S,b),ss) =>
34.323 ass_up ys ((E',l,a,v,S,b),ss) t (*WN050930 't' was not assigned*)
34.324 | ay => ay)
34.325 - else astep_up ys ((E,l, Some a,v,S,b),ss)
34.326 + else astep_up ys ((E,l, SOME a,v,S,b),ss)
34.327 )
34.328
34.329 | ass_up (ys as (y,s,_,d)) ((E,l,a,v,S,b),ss)
34.330 @@ -1329,8 +1329,8 @@
34.331
34.332 | ass_up (ys as (y,s,_,d)) ((E,l,_,v,S,b),ss)
34.333 (t as Const ("Script.Repeat",_) $ e $ a) =
34.334 - (case assy (((y,s),d), Aundef) ((E, (l@[L,R]), Some a,v,S,b),ss) e of
34.335 - NasNap (v,E') => astep_up ys ((E',l, Some a,v,S,b),ss)
34.336 + (case assy (((y,s),d), Aundef) ((E, (l@[L,R]), SOME a,v,S,b),ss) e of
34.337 + NasNap (v,E') => astep_up ys ((E',l, SOME a,v,S,b),ss)
34.338 | NasApp ((E',l,a,v,S,b),ss) =>
34.339 ass_up ys ((E',l,a,v,S,b),ss) t
34.340 | ay => ay)
34.341 @@ -1572,7 +1572,7 @@
34.342 ((*writeln("### appy While $ c $ e $ a, upd_env= "^
34.343 (subst2str (upd_env E (a,v))));*)
34.344 if eval_true_ th sr (subst_atomic (upd_env E (a,v)) c)
34.345 - then appy thy ptp E (l@[L,R]) e (Some a) v
34.346 + then appy thy ptp E (l@[L,R]) e (SOME a) v
34.347 else Skip (v, E))
34.348
34.349 | appy (thy as (th,sr)) ptp E l
34.350 @@ -1596,7 +1596,7 @@
34.351 | appy thy ptp E (*env*) l
34.352 (Const ("Script.Repeat"(*1*),_) $ e $ a) _ v =
34.353 ((*writeln("### appy Repeat a: ");*)
34.354 - appy thy ptp E (*env*) (l@[L,R]) e (Some a) v)
34.355 + appy thy ptp E (*env*) (l@[L,R]) e (SOME a) v)
34.356 (* val (thy, ptp, E, l, (Const ("Script.Repeat",_) $ e), _, v) =
34.357 (thy, ptp, E, (l@[R]), e, a, v);
34.358 *)
34.359 @@ -1610,7 +1610,7 @@
34.360 *)
34.361 | appy thy ptp E l
34.362 (t as Const ("Script.Try",_) $ e $ a) _ v =
34.363 - (case appy thy ptp E (l@[L,R]) e (Some a) v of
34.364 + (case appy thy ptp E (l@[L,R]) e (SOME a) v of
34.365 Napp E => ((*writeln("### appy Try "^
34.366 (Sign.string_of_term (sign_of (assoc_thy thy)) t));*)
34.367 Skip (v, E))
34.368 @@ -1631,9 +1631,9 @@
34.369
34.370 | appy thy ptp E l
34.371 (Const ("Script.Or"(*1*),_) $e1 $ e2 $ a) _ v =
34.372 - (case appy thy ptp E (l@[L,L,R]) e1 (Some a) v of
34.373 + (case appy thy ptp E (l@[L,L,R]) e1 (SOME a) v of
34.374 Appy lme => Appy lme
34.375 - | _ => appy thy ptp E (*env*) (l@[L,R]) e2 (Some a) v)
34.376 + | _ => appy thy ptp E (*env*) (l@[L,R]) e2 (SOME a) v)
34.377
34.378 | appy thy ptp E l
34.379 (Const ("Script.Or"(*2*),_) $e1 $ e2) a v =
34.380 @@ -1650,8 +1650,8 @@
34.381 (Const ("Script.Seq"(*1*),_) $ e1 $ e2 $ a) _ v =
34.382 ((*writeln("### appy Seq $ e1 $ e2 $ a, upd_env= "^
34.383 (subst2str (upd_env E (a,v))));*)
34.384 - case appy thy ptp E (l@[L,L,R]) e1 (Some a) v of
34.385 - Skip (v,E) => appy thy ptp E (l@[L,R]) e2 (Some a) v
34.386 + case appy thy ptp E (l@[L,L,R]) e1 (SOME a) v of
34.387 + Skip (v,E) => appy thy ptp E (l@[L,R]) e2 (SOME a) v
34.388 | ay => ay)
34.389
34.390 (* val (thy, ptp, E, l, (Const ("Script.Seq",_) $ e1 $ e2), _, v)=
34.391 @@ -1887,10 +1887,10 @@
34.392 (f', Sundef(*FIXME is no value of next_tac! vor 8.6.03*)))
34.393 (*finished*)
34.394 else (case next_rule rss f of
34.395 - None => (Empty_Tac_, Uistate, (e_term, Sundef)) (*helpless*)
34.396 -(* val Some (Thm (id,thm)) = next_rule rss f;
34.397 + NONE => (Empty_Tac_, Uistate, (e_term, Sundef)) (*helpless*)
34.398 +(* val SOME (Thm (id,thm)) = next_rule rss f;
34.399 *)
34.400 - | Some (Thm (id,thm))(*8.6.03: muss auch f' liefern ?!!*) =>
34.401 + | SOME (Thm (id,thm))(*8.6.03: muss auch f' liefern ?!!*) =>
34.402 (Rewrite' (thy, "e_rew_ord", e_rls,(*!?!8.6.03*) false,
34.403 (id, string_of_thmI thm), f,(e_term,[(*!?!8.6.03*)])),
34.404 Uistate, (e_term, Sundef))) (*next stac*)
34.405 @@ -1902,7 +1902,7 @@
34.406 (ScrState (E,l,a,v,s,b)) =
34.407 ((*writeln("### next_tac-----------------: E= ");
34.408 writeln( istate2str (ScrState (E,l,a,v,s,b)));*)
34.409 - case if l=[] then appy thy ptp E [R] body None v
34.410 + case if l=[] then appy thy ptp E [R] body NONE v
34.411 else nstep_up thy ptp sc E l Skip_ a v of
34.412 Skip (v,_) => (*finished*)
34.413 (case par_pbl_det pt p of
34.414 @@ -1956,7 +1956,7 @@
34.415 \formals: "^terms2str formals^"\n\
34.416 \actuals: "^terms2str actuals)
34.417 val env = relate_args [] formals actuals;
34.418 - in (ScrState (env,[],None,e_term,Safe,true), scr):istate * scr end;
34.419 + in (ScrState (env,[],NONE,e_term,Safe,true), scr):istate * scr end;
34.420
34.421 (*.decide, where to get script/istate from:
34.422 (*1*) from PblObj.env: at begin of script if no init_form
34.423 @@ -1967,8 +1967,8 @@
34.424 fun from_pblobj_or_detail' thy' (p,p_) pt =
34.425 if p_ mem [Pbl,Met]
34.426 then case get_obj g_env pt p of
34.427 - None => raise error "from_pblobj_or_detail': no istate"
34.428 - | Some is =>
34.429 + NONE => raise error "from_pblobj_or_detail': no istate"
34.430 + | SOME is =>
34.431 let val metID = get_obj g_metID pt p
34.432 val {srls,...} = get_met metID
34.433 in (srls, is, (#scr o get_met) metID) end
34.434 @@ -2037,7 +2037,7 @@
34.435 > val Script sc = (#scr o get_met) ("SqRoot.thy","sqrt-equ-test");
34.436 > val env = [((term_of o the o (parse Isac.thy)) "bdv",
34.437 (term_of o the o (parse Isac.thy)) "x")];
34.438 -> map ((stac2tac pt thy) o #2 o(subst_stacexpr env None e_term)) (stacpbls sc);
34.439 +> map ((stac2tac pt thy) o #2 o(subst_stacexpr env NONE e_term)) (stacpbls sc);
34.440 *)
34.441
34.442
35.1 --- a/src/Tools/isac/ME/solve.sml Wed Aug 18 13:53:15 2010 +0200
35.2 +++ b/src/Tools/isac/ME/solve.sml Wed Aug 18 13:55:23 2010 +0200
35.3 @@ -95,7 +95,7 @@
35.4 ("cancel","cancel"),("pow","pow"),("sqrt","sqrt")];
35.5 fun op_intern op_ =
35.6 case assoc (ops,op_) of
35.7 - Some op' => op' | None => raise error ("op_intern: no op= "^op_);
35.8 + SOME op' => op' | NONE => raise error ("op_intern: no op= "^op_);
35.9 -----------------------*)
35.10
35.11
35.12 @@ -139,15 +139,15 @@
35.13 val p = lev_dn p;
35.14 in
35.15 case ini of
35.16 - Some t => (* val Some t = ini;
35.17 + SOME t => (* val SOME t = ini;
35.18 *)
35.19 let val (pos,c,_,pt) =
35.20 - generate1 thy (Apply_Method' (mI, Some t, is))
35.21 + generate1 thy (Apply_Method' (mI, SOME t, is))
35.22 is (lev_on p, Frm)(*implicit Take*) pt;
35.23 - in ("ok",([(Apply_Method mI, Apply_Method' (mI, Some t, is),
35.24 + in ("ok",([(Apply_Method mI, Apply_Method' (mI, SOME t, is),
35.25 ((lev_on p, Frm), is))], c, (pt,pos)):calcstate')
35.26 end
35.27 - | None => (*execute the first tac in the Script, compare solve m*)
35.28 + | NONE => (*execute the first tac in the Script, compare solve m*)
35.29 let val (m', is', _) = next_tac (thy', srls) (pt, (p, Res)) sc is;
35.30 val d = e_rls (*FIXME: get simplifier from domID*);
35.31 in
35.32 @@ -163,9 +163,9 @@
35.33 in ("not-found-in-script",
35.34 ([(tac_2tac m, m, (pos, is))], ps, (pt,p))) end
35.35 (*just-before------------------------------------------------------
35.36 - ("ok",([(Apply_Method mI,Apply_Method'(mI,None,e_istate),
35.37 + ("ok",([(Apply_Method mI,Apply_Method'(mI,NONE,e_istate),
35.38 (pos, is))],
35.39 - [], (update_env pt (fst pos) (Some is),pos)))
35.40 + [], (update_env pt (fst pos) (SOME is),pos)))
35.41 -----------------------------------------------------------------*)
35.42 end
35.43 end
35.44 @@ -304,7 +304,7 @@
35.45 (* nxt_solv (Apply_Method' vvv FIXME: get args in applicable_in *)
35.46 fun nxt_solv (Apply_Method' (mI,_,_)) _ (pt:ptree, pos as (p,_)) =
35.47 (* val ((Apply_Method' (mI,_,_)), _, (pt:ptree, pos as (p,_))) =
35.48 - ((Apply_Method' (mI, None, e_istate)), e_istate, ptp);
35.49 + ((Apply_Method' (mI, NONE, e_istate)), e_istate, ptp);
35.50 *)
35.51 let val {srls,ppc,...} = get_met mI;
35.52 val PblObj{meth=itms,origin=(oris,_,_),probl,...} = get_obj I pt p;
35.53 @@ -316,19 +316,19 @@
35.54 val ini = init_form thy scr env;
35.55 in
35.56 case ini of
35.57 - Some t => (* val Some t = ini;
35.58 + SOME t => (* val SOME t = ini;
35.59 *)
35.60 let val pos = ((lev_on o lev_dn) p, Frm)
35.61 - val tac_ = Apply_Method' (mI, Some t, is);
35.62 + val tac_ = Apply_Method' (mI, SOME t, is);
35.63 val (pos,c,_,pt) = (*implicit Take*)
35.64 generate1 thy tac_ is pos pt
35.65 (*val _= ("### nxt_solv Apply_Method, pos= "^pos'2str (lev_on p,Frm));*)
35.66 in ([(Apply_Method mI, tac_, (pos, is))], c, (pt, pos)):calcstate' end
35.67 - | None =>
35.68 - let val pt = update_env pt (fst pos) (Some is)
35.69 + | NONE =>
35.70 + let val pt = update_env pt (fst pos) (SOME is)
35.71 val (tacis, c, ptp) = nxt_solve_ (pt, pos)
35.72 in (tacis @
35.73 - [(Apply_Method mI, Apply_Method' (mI, None, e_istate), (pos, is))],
35.74 + [(Apply_Method mI, Apply_Method' (mI, NONE, e_istate), (pos, is))],
35.75 c, ptp) end
35.76 end
35.77 (* val ("Check_Postcond",Check_Postcond' (pI,_)) = (mI,m);
35.78 @@ -489,7 +489,7 @@
35.79 val (ptp as (pt, (p,_))) = (pt, pos);
35.80 *)
35.81 let val (_,_,mI) = get_obj g_spec pt p;
35.82 - val (_, c', ptp) = nxt_solv (Apply_Method' (mI, None, e_istate))
35.83 + val (_, c', ptp) = nxt_solv (Apply_Method' (mI, NONE, e_istate))
35.84 e_istate ptp;
35.85 in complete_solve auto (c@c') ptp end;
35.86 (*@@@ vvv @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*)
35.87 @@ -514,7 +514,7 @@
35.88 | (_, c', ptp') => complete_solve auto (c@c') ptp'
35.89 and all_solve auto c (ptp as (pt, (p,_)): ptree * pos') =
35.90 let val (_,_,mI) = get_obj g_spec pt p
35.91 - val (_, c', ptp) = nxt_solv (Apply_Method' (mI, None, e_istate))
35.92 + val (_, c', ptp) = nxt_solv (Apply_Method' (mI, NONE, e_istate))
35.93 e_istate ptp
35.94 in complete_solve auto (c@c') ptp end;
35.95
35.96 @@ -548,7 +548,7 @@
35.97 (*TODO.WN060602 ScrState (["(t_, Problem (Isac,[equation,univar]))"]
35.98 is wrong for simpl, but working ?!? *)
35.99 val tac_ = Apply_Method' (e_metID(*WN0402: see generate1 !?!*),
35.100 - Some t, is)
35.101 + SOME t, is)
35.102 val pos' = ((lev_on o lev_dn) p, Frm)
35.103 val thy = assoc_thy "Isac.thy"
35.104 val (_,_,_,pt') = (*implicit Take*)generate1 thy tac_ is pos' pt
36.1 --- a/src/Tools/isac/RCODE-root.sml Wed Aug 18 13:53:15 2010 +0200
36.2 +++ b/src/Tools/isac/RCODE-root.sml Wed Aug 18 13:55:23 2010 +0200
36.3 @@ -18,9 +18,9 @@
36.4
36.5 (*.this function from Isabelle2002/src/Pure/library.ML is overwritten
36.6 by some Isabelle2002 theory file; thus reestablished for isac.*)
36.7 -fun find_first _ [] = None
36.8 +fun find_first _ [] = NONE
36.9 | find_first pred (x :: xs) =
36.10 - if pred x then Some x else find_first pred xs;
36.11 + if pred x then SOME x else find_first pred xs;
36.12 fun swap (x, y) = (y, x);
36.13 (*HACK.WN080107*) val sstr = str;
36.14
37.1 --- a/src/Tools/isac/ROOT.ML Wed Aug 18 13:53:15 2010 +0200
37.2 +++ b/src/Tools/isac/ROOT.ML Wed Aug 18 13:55:23 2010 +0200
37.3 @@ -27,9 +27,9 @@
37.4
37.5 (*.these functions from Isabelle2002/src/Pure/library.ML are overwritten
37.6 by some Isabelle2002 theory file; thus reestablished for isac.*)
37.7 -fun find_first _ [] = None
37.8 +fun find_first _ [] = NONE
37.9 | find_first pred (x :: xs) =
37.10 - if pred x then Some x else find_first pred xs;
37.11 + if pred x then SOME x else find_first pred xs;
37.12 fun swap (x, y) = (y, x);
37.13 (*HACK.WN080107*) val sstr = str;
37.14
38.1 --- a/src/Tools/isac/Scripts/Tools.sml Wed Aug 18 13:53:15 2010 +0200
38.2 +++ b/src/Tools/isac/Scripts/Tools.sml Wed Aug 18 13:55:23 2010 +0200
38.3 @@ -7,7 +7,7 @@
38.4 let
38.5 val t' = ((list2isalist HOLogic.realT) o vars) t;
38.6 val thmId = thmid^(Sign.string_of_term (sign_of thy) arg);
38.7 - in Some (thmId, Trueprop $ (mk_equality (t,t'))) end
38.8 + in SOME (thmId, Trueprop $ (mk_equality (t,t'))) end
38.9 | eval_var _ _ _ _ = raise GO_ON;
38.10 (*
38.11 > val t = (term_of o the o (parse thy)) "Var (A=a*(b::real))";
38.12 @@ -18,8 +18,8 @@
38.13 > eval_fn op0 t;
38.14
38.15 > val thmid = "#Var_";
38.16 -> val (Some(thmId,t')) = eval_var thmid op0 t;
38.17 -val it = Some ("#Var_(A::real) = (a::real) * (b::real)",Const # $ (# $ #))
38.18 +> val (SOME(thmId,t')) = eval_var thmid op0 t;
38.19 +val it = SOME ("#Var_(A::real) = (a::real) * (b::real)",Const # $ (# $ #))
38.20 : (string * term) option
38.21 > Sign.string_of_term (sign_of thy) t';
38.22 val it = "Var ((A::real) = (a::real) * (b::real)) = [A, a, b]" : string
38.23 @@ -29,13 +29,13 @@
38.24 let
38.25 val t' = ((term_of_num HOLogic.realT) o length o isalist2list) arg;
38.26 val thmId = thmid^(Sign.string_of_term (sign_of thy) arg);
38.27 - in Some (thmId, Trueprop $ (mk_equality (t,t'))) end
38.28 + in SOME (thmId, Trueprop $ (mk_equality (t,t'))) end
38.29 | eval_Length _ _ _ _ = raise GO_ON;
38.30 (*
38.31 > val thmid = "#Length_"; val op_ = "Length";
38.32 > val s = "Length [A = a * b, a // #2 = #2]";
38.33 > val (t as (Const(op0,t0) $ arg)) = (term_of o the o (parse thy)) s;
38.34 -> val (Some (id,t')) = eval_Length thmid op_ t;
38.35 +> val (SOME (id,t')) = eval_Length thmid op_ t;
38.36 val id = "#Length_[A = a * b, a // #2 = #2]" : string
38.37 val t' = Const ("Trueprop","bool => prop") $ (Const # $ (# $ #) $ Free (#,#))
38.38 val it = "Length [A = a * b, a // #2 = #2] = #2" : cterm
38.39 @@ -49,12 +49,12 @@
38.40 > cterm_of (sign_of thy) t';
38.41 > val t = (term_of o the o (parse thy)) s;
38.42 > val eval_fn = the (assoc (!eval_list, op_));
38.43 -> val (Some(_,t')) = get_pair op_ eval_fn t;
38.44 +> val (SOME(_,t')) = get_pair op_ eval_fn t;
38.45 val t' = Const ("Trueprop","bool => prop") $ (Const # $ (# $ #) $ Free (#,#))
38.46 val it = "Length [A = a * b, a // #2 = #2] = #2" : cterm
38.47
38.48 > val ct = (the o (parse thy)) s;
38.49 -> val (Some(_,thm)) = get_calculation thy (op_, eval_fn) ct;
38.50 +> val (SOME(_,thm)) = get_calculation thy (op_, eval_fn) ct;
38.51 val thm = "Length [A = a * b, a // #2 = #2] = #2" [[ Free ( #2, real) !!!]]
38.52 > rewrite_ thy tless_true e_rls false thm ct;
38.53 ("if #1 < #2
38.54 @@ -80,7 +80,7 @@
38.55 val thmId = thmid^(Sign.string_of_term (sign_of thy) t1)^
38.56 "_"^(Sign.string_of_term (sign_of thy) t2)^
38.57 " = "^(Sign.string_of_term (sign_of thy) t');
38.58 - in Some (thmId, Trueprop $ (mk_equality (t,t'))) end
38.59 + in SOME (thmId, Trueprop $ (mk_equality (t,t'))) end
38.60 else raise GO_ON
38.61 )
38.62 | eval_Nth _ _ _ _ = raise GO_ON;
38.63 @@ -91,7 +91,7 @@
38.64 > eval_Nth thmid op_ t;
38.65
38.66 > val eval_fn = the (assoc (!eval_list, op_));
38.67 -> val (Some(id,t')) = get_pair op_ eval_fn t;
38.68 +> val (SOME(id,t')) = get_pair op_ eval_fn t;
38.69 > cterm_of (sign_of thy) t';
38.70 val it = "Nth #2 [A = a * b, a // #2 = #2] = (a // #2 = #2)"
38.71 *)
39.1 --- a/src/Tools/isac/Scripts/term_G.sml Wed Aug 18 13:53:15 2010 +0200
39.2 +++ b/src/Tools/isac/Scripts/term_G.sml Wed Aug 18 13:55:23 2010 +0200
39.3 @@ -664,9 +664,9 @@
39.4 (*2002 fun(*app_num_tr'2 (Const("0",T)) = Free("0",T)
39.5 | app_num_tr'2 (Const("1",T)) = Free("1",T)
39.6 |*)app_num_tr'2 (t as Const("uminus",_) $ Free(s,T)) =
39.7 - (case int_of_str s of Some i =>
39.8 + (case int_of_str s of SOME i =>
39.9 if i > 0 then Free("-"^s,T) else Free(s,T)
39.10 - | None => t)
39.11 + | NONE => t)
39.12 (*| app_num_tr'2 (t as Const(s,T)) = t
39.13 | app_num_tr'2 (Const("Numeral.number_of",Type ("fun", [_, T])) $ t) =
39.14 Free(NumeralSyntax.dest_bin_str t, T)
40.1 --- a/src/Tools/isac/xmlsrc/pbl-met-hierarchy.sml Wed Aug 18 13:53:15 2010 +0200
40.2 +++ b/src/Tools/isac/xmlsrc/pbl-met-hierarchy.sml Wed Aug 18 13:55:23 2010 +0200
40.3 @@ -127,8 +127,8 @@
40.4 indt i ^ "<META> </META>\n" ^
40.5 (*--------------- begin display ------------------------------*)
40.6 indt i ^ "<HEADLINE>\n" ^
40.7 - (case cas of None => term2xml i (pbl2term thy id)
40.8 - | Some t => term2xml i t) ^ "\n" ^
40.9 + (case cas of NONE => term2xml i (pbl2term thy id)
40.10 + | SOME t => term2xml i t) ^ "\n" ^
40.11 indt i ^ "</HEADLINE>\n" ^
40.12 (*--------------- hline --------------------------------------*)
40.13 pattern2xml i ppc where_ ^
40.14 @@ -168,8 +168,8 @@
40.15 indt i ^ "<META> </META>\n" ^
40.16 (*--------------- begin display ------------------------------*)
40.17 indt i ^ "<HEADLINE>\n" ^
40.18 - (case cas of None => term2xml i (pbl2term thy id)
40.19 - | Some t => term2xml i t) ^ "\n" ^
40.20 + (case cas of NONE => term2xml i (pbl2term thy id)
40.21 + | SOME t => term2xml i t) ^ "\n" ^
40.22 indt i ^ "</HEADLINE>\n" ^
40.23 (*--------------- hline --------------------------------------*)
40.24 pattern2xml i ppc where_ ^
41.1 --- a/test/Tools/isac/FE-interface/interface.sml Wed Aug 18 13:53:15 2010 +0200
41.2 +++ b/test/Tools/isac/FE-interface/interface.sml Wed Aug 18 13:55:23 2010 +0200
41.3 @@ -105,7 +105,7 @@
41.4 autoCalculate 1 (Step 1);
41.5 refFormula 1 (get_pos 1 1) (*model contains descriptions for all items*);
41.6 autoCalculate 1 (Step 1);
41.7 -(*-----since Model_Problem + complete_mod_ in case cas of Some-----*
41.8 +(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
41.9 fetchProposedTactic 1;
41.10 setNextTactic 1 (Add_Given "equality (1 + -1 * 2 + x = 0)");
41.11 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1); (*equality added*);
41.12 @@ -121,7 +121,7 @@
41.13 fetchProposedTactic 1;
41.14 setNextTactic 1 (Specify_Theory "Test.thy");
41.15 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
41.16 -*-----since Model_Problem + complete_mod_ in case cas of Some-----*)
41.17 +*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
41.18
41.19 fetchProposedTactic 1;
41.20 setNextTactic 1 (Specify_Problem ["linear","univariate","equation","test"]);
41.21 @@ -586,14 +586,14 @@
41.22 fetchProposedTactic 1;
41.23 setNextTactic 1 (Model_Problem );
41.24 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.25 -(*-----since Model_Problem + complete_mod_ in case cas of Some-----*
41.26 +(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
41.27 setNextTactic 1 (Add_Given "equality (5 * x / (x - 2) - x / (x + 2) = 4)");
41.28 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.29 setNextTactic 1 (Add_Given "solveFor x");
41.30 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.31 setNextTactic 1 (Add_Find "solutions L");
41.32 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.33 -*-----since Model_Problem + complete_mod_ in case cas of Some-----*)
41.34 +*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
41.35 setNextTactic 1 (Specify_Theory "RatEq.thy");
41.36 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.37 setNextTactic 1 (Specify_Problem ["rational","univariate","equation"]);
41.38 @@ -614,7 +614,7 @@
41.39 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.40 setNextTactic 1 (Model_Problem );
41.41 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.42 -(*-----since Model_Problem + complete_mod_ in case cas of Some-----*
41.43 +(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
41.44 setNextTactic 1 (Add_Given
41.45 "equality (12 * x + 4 * x ^^^ 2 = 4 * (-4 + x ^^^ 2))");
41.46 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.47 @@ -622,7 +622,7 @@
41.48 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.49 setNextTactic 1 (Add_Find "solutions x_i");
41.50 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.51 -*-----since Model_Problem + complete_mod_ in case cas of Some-----*)
41.52 +*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
41.53 setNextTactic 1 (Specify_Theory "PolyEq.thy");
41.54 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.55 setNextTactic 1 (Specify_Problem ["normalize","polynomial",
41.56 @@ -642,7 +642,7 @@
41.57 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.58 setNextTactic 1 (Model_Problem );
41.59 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.60 -(*-----since Model_Problem + complete_mod_ in case cas of Some-----*
41.61 +(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
41.62 setNextTactic 1 (Add_Given
41.63 "equality (16 + 12 * x = 0)");
41.64 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.65 @@ -650,7 +650,7 @@
41.66 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.67 setNextTactic 1 (Add_Find "solutions x_i");
41.68 autoCalculate 1 (Step 1); fetchProposedTactic 1;
41.69 -*-----since Model_Problem + complete_mod_ in case cas of Some-----*)
41.70 +*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
41.71 setNextTactic 1 (Specify_Theory "PolyEq.thy");
41.72 (*------------- some trials in the problem-hierarchy ---------------*)
41.73 setNextTactic 1 (Specify_Problem ["linear","univariate","equation"]);
42.1 --- a/test/Tools/isac/IsacKnowledge/algein.sml Wed Aug 18 13:53:15 2010 +0200
42.2 +++ b/test/Tools/isac/IsacKnowledge/algein.sml Wed Aug 18 13:55:23 2010 +0200
42.3 @@ -134,7 +134,7 @@
42.4
42.5 val thm = assoc_thm' thy ("sym_real_mult_0_right","");
42.6 val t = str2term "0 = 0";
42.7 -val Some (t',_) = rewrite_ thy rew_ord erls false thm t;
42.8 +val SOME (t',_) = rewrite_ thy rew_ord erls false thm t;
42.9 term2str t';
42.10 (********"0 = ?z1 * 0"*)
42.11
42.12 @@ -150,7 +150,7 @@
42.13
42.14 val thm = assoc_thm' thy ("sym","");
42.15 (*----- GOON Widerspruch 3 = 777: sym contains "==>" instead of "=" !!!
42.16 -val Some (t''',_) = rewrite_ thy rew_ord erls false thm t'';
42.17 +val SOME (t''',_) = rewrite_ thy rew_ord erls false thm t'';
42.18 *)
42.19
42.20 (* use"../smltest/IsacKnowledge/algein.sml";
43.1 --- a/test/Tools/isac/IsacKnowledge/atools.sml Wed Aug 18 13:53:15 2010 +0200
43.2 +++ b/test/Tools/isac/IsacKnowledge/atools.sml Wed Aug 18 13:55:23 2010 +0200
43.3 @@ -29,7 +29,7 @@
43.4 if occurs_in t t then "OK" else raise error "atools.sml: occurs_in x x -> f";
43.5
43.6 val t = str2term "x occurs_in x";
43.7 -val Some (str, t') = eval_occurs_in 0 "Atools.occurs'_in" t 0;
43.8 +val SOME (str, t') = eval_occurs_in 0 "Atools.occurs'_in" t 0;
43.9 if (term2s t') = "x occurs_in x = True" then ()
43.10 else raise error "atools.sml: x occurs_in x = True ???";
43.11
43.12 @@ -37,14 +37,14 @@
43.13 some_occur_in [str2term"c",str2term"c_2"] (str2term"a + b + c");
43.14 val t = str2term "some_of [c, c_2, c_3, c_4] occur_in \
43.15 \-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
43.16 -val Some (str,t') = eval_some_occur_in 0 "Atools.some'_occur'_in" t 0;
43.17 +val SOME (str,t') = eval_some_occur_in 0 "Atools.some'_occur'_in" t 0;
43.18 if term2str t' =
43.19 "some_of [c, c_2, c_3, c_4] occur_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 =\nTrue" then ()
43.20 else raise error "atools.sml: some_occur_in true";
43.21
43.22 val t = str2term "some_of [c_3, c_4] occur_in \
43.23 \-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
43.24 -val Some (str,t') = eval_some_occur_in 0 "Atools.some'_occur'_in" t 0;
43.25 +val SOME (str,t') = eval_some_occur_in 0 "Atools.some'_occur'_in" t 0;
43.26 if term2str t' =
43.27 "some_of [c_3, c_4] occur_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = False" then ()
43.28 else raise error "atools.sml: some_occur_in false";
43.29 @@ -54,7 +54,7 @@
43.30 "----------- argument_of -----------------------------------------";
43.31 "----------- argument_of -----------------------------------------";
43.32 val t = str2term "argument_in (M_b x)";
43.33 -val Some (str, t') = eval_argument_in 0 "Atools.argument'_in" t 0;
43.34 +val SOME (str, t') = eval_argument_in 0 "Atools.argument'_in" t 0;
43.35 if term2s t' = "(argument_in M_b x) = x" then ()
43.36 else raise error "atools.sml:(argument_in M_b x) = x ???";
43.37
43.38 @@ -89,7 +89,7 @@
43.39 val (p as Const ("Atools.filter'_sameFunId",_) $ (fid $ _) $ fs) =
43.40 str2term "filter_sameFunId (y' L) \
43.41 \[M_b x = c + L*x, y' x = c + L*x, y x = c + L*x]";
43.42 -val Some (str, es) = eval_filter_sameFunId "" "Atools.filter'_sameFunId" p "";
43.43 +val SOME (str, es) = eval_filter_sameFunId "" "Atools.filter'_sameFunId" p "";
43.44 if term2str es = "(filter_sameFunId y' L [M_b x = c + L * x, y' x = c + L * x,\n y x = c + L * x]) =\n[y' x = c + L * x]" then ()
43.45 else raise error "atools.slm diff.behav. in filter_sameFunId";
43.46
43.47 @@ -112,7 +112,7 @@
43.48 _ $ _) = t;
43.49
43.50
43.51 -val Some (str, pred) = eval_boollist2sum "" "Atools.boollist2sum" t "";
43.52 +val SOME (str, pred) = eval_boollist2sum "" "Atools.boollist2sum" t "";
43.53 if term2str pred = "boollist2sum\n [b1 = k - 2 * q, b2 = k - 2 * q, b3 = k - 2 * q, b4 = k - 2 * q] =\nb1 + b2 + b3 + b4" then ()
43.54 else raise error "atools.sml diff.behav. in eval_boollist2sum";
43.55
43.56 @@ -121,7 +121,7 @@
43.57 [Calc ("Atools.boollist2sum", eval_boollist2sum "")];
43.58 val t = str2term
43.59 "boollist2sum [b1 = k - 2*q, b2 = k - 2*q, b3 = k - 2*q, b4 = k - 2*q]";
43.60 -case rewrite_set_ thy false srls_ t of Some _ => ()
43.61 +case rewrite_set_ thy false srls_ t of SOME _ => ()
43.62 | _ => raise error "atools.sml diff.rewrite boollist2sum";
43.63 trace_rewrite:=false;
43.64
44.1 --- a/test/Tools/isac/IsacKnowledge/biegelinie.sml Wed Aug 18 13:53:15 2010 +0200
44.2 +++ b/test/Tools/isac/IsacKnowledge/biegelinie.sml Wed Aug 18 13:55:23 2010 +0200
44.3 @@ -156,13 +156,13 @@
44.4 scr = EmptyScr};
44.5 val rm_ = str2term"[M_b 0 = 0, M_b L = 0]";
44.6 val M__ = str2term"M_b x = -1 * x ^^^ 2 / 2 + x * c + c_2";
44.7 -val Some (e1__,_) =
44.8 +val SOME (e1__,_) =
44.9 rewrite_set_ thy false srls
44.10 (str2term"(nth_::[real,bool list]=>bool) 1 " $ rm_);
44.11 if term2str e1__ = "M_b 0 = 0" then ()
44.12 else raise error "biegelinie.sml simplify nth_ 1 rm_";
44.13
44.14 -val Some (x1__,_) =
44.15 +val SOME (x1__,_) =
44.16 rewrite_set_ thy false srls
44.17 (str2term"argument_in (lhs (M_b 0 = 0))");
44.18 if term2str x1__ = "0" then ()
44.19 @@ -462,7 +462,7 @@
44.20
44.21 fetchProposedTactic 1 (*->"Apply_Method" IntegrierenUndKonstanteBestimmen*);
44.22 (*
44.23 -> val (_,Apply_Method' (_, None, ScrState is), _)::_ = tacis;
44.24 +> val (_,Apply_Method' (_, NONE, ScrState is), _)::_ = tacis;
44.25 > is = e_scrstate;
44.26 val it = true : bool
44.27 *)
44.28 @@ -722,7 +722,7 @@
44.29 "--- script expression 1";
44.30 val screxp1_ = str2term "Take (nth_ 1 (rb_::bool list))";
44.31 val screxp1 = subst_atomic [(rb_, rb)] screxp1_; term2str screxp1;
44.32 -val Some (b1,_) = rewrite_set_ Isac.thy false srls2 screxp1; term2str b1;
44.33 +val SOME (b1,_) = rewrite_set_ Isac.thy false srls2 screxp1; term2str b1;
44.34 if term2str b1 = "Take (y 0 = 0)" then ()
44.35 else raise error "biegelinie.sml: rew. Bieglie2 --1";
44.36 val b1 = str2term "(y 0 = 0)";
44.37 @@ -731,7 +731,7 @@
44.38 val screxp2_ = str2term "filter (sameFunId (lhs b1_)) funs_";
44.39 val b1_ = str2term "b1_::bool";
44.40 val screxp2 = subst_atomic [(b1_,b1),(funs_,funs)] screxp2_; term2str screxp2;
44.41 -val Some (fs,_) = rewrite_set_ Isac.thy false srls2 screxp2; term2str fs;
44.42 +val SOME (fs,_) = rewrite_set_ Isac.thy false srls2 screxp2; term2str fs;
44.43 if term2str fs = "[y x =\n c_4 + c_3 * x +\n 1 / (-1 * EI) *\n (c_2 / 2 * x ^^^ 2 + c / 6 * x ^^^ 3 + -1 * q_0 / 24 * x ^^^ 4)]" then ()
44.44 else raise error "biegelinie.sml: rew. Bieglie2 --2";
44.45
44.46 @@ -742,7 +742,7 @@
44.47 val fs_ = str2term "fs_::bool list";
44.48 val screxp3 = subst_atomic [(fs_,fs),(b1_,b1)] screxp3_;
44.49 writeln (term2str screxp3);
44.50 -val Some (equ,_) = rewrite_set_ Isac.thy false srls2 screxp3;
44.51 +val SOME (equ,_) = rewrite_set_ Isac.thy false srls2 screxp3;
44.52 if term2str equ = "SubProblem\n (Biegelinie_, [makeFunctionTo, equation], [Equation, fromFunction])\n [bool_\n (y x =\n c_4 + c_3 * x +\n 1 / (-1 * EI) *\n (c_2 / 2 * x ^^^ 2 + c / 6 * x ^^^ 3 + -1 * q_0 / 24 * x ^^^ 4)),\n bool_ (y 0 = 0)]" then ()
44.53 else raise error "biegelinie.sml: rew. Bieglie2 --3";
44.54 writeln (term2str equ);
44.55 @@ -1019,7 +1019,7 @@
44.56 ;
44.57 val t = str2term "last [1,2,3,4]";
44.58 trace_rewrite := true;
44.59 -val Some (e1__,_) = rewrite_set_ thy false srls t;
44.60 +val SOME (e1__,_) = rewrite_set_ thy false srls t;
44.61 trace_rewrite := false;
44.62 term2str e1__;
44.63
45.1 --- a/test/Tools/isac/IsacKnowledge/complex.sml Wed Aug 18 13:53:15 2010 +0200
45.2 +++ b/test/Tools/isac/IsacKnowledge/complex.sml Wed Aug 18 13:55:23 2010 +0200
45.3 @@ -27,7 +27,7 @@
45.4 (*--- (1.1 + 2.2 I) * (3.3 + 4.4 I) = - 6.05 + 12 I ---*)
45.5 val t = str2term "(Float ((11,-1),(0,0)) + Float ((22,-1),(0,0)) * I__) *\
45.6 \(Float ((33,-1),(0,0)) + Float ((44,-1),(0,0)) * I__)";
45.7 - val Some (t',_) =
45.8 + val SOME (t',_) =
45.9 rewrite_set_ thy false
45.10 (append_rls "simpl_complex" make_polynomial
45.11 [Thm ("square_I", num_str square_I)]) t;
46.1 --- a/test/Tools/isac/IsacKnowledge/diff.sml Wed Aug 18 13:53:15 2010 +0200
46.2 +++ b/test/Tools/isac/IsacKnowledge/diff.sml Wed Aug 18 13:55:23 2010 +0200
46.3 @@ -94,19 +94,19 @@
46.4
46.5 val thm = ("diff_const","");
46.6 val ct = "d_d x x";
46.7 -val None =
46.8 +val NONE =
46.9 (rewrite_inst thy' "tless_true" "erls" false [("bdv","x")] thm ct);
46.10 val ct = "d_d x 2";
46.11 -val Some (ctt,_) =
46.12 +val SOME (ctt,_) =
46.13 (rewrite_inst thy' "tless_true" "erls" false [("bdv","x")] thm ct);
46.14 "----- for 'd_d s a' we got 'a is_const' --> False --------vvv-----";
46.15 trace_rewrite := true;
46.16 val ct = "d_d s a";
46.17 (rewrite_inst thy' "tless_true" "erls" false [("bdv","s")] thm ct);
46.18 -(*got: None instead Some*)
46.19 +(*got: NONE instead SOME*)
46.20 eval_true Isac.thy [str2term "a is_const"] (assoc_rls"erls");
46.21 (*got: false instead true; ~~~~~~~~~~~ replaced by 'is_atom'*)
46.22 -val Some (ctt,_) =
46.23 +val SOME (ctt,_) =
46.24 (rewrite_inst thy' "tless_true" "erls" false [("bdv","s")] thm ct);
46.25 if ctt = "0" then () else raise error "diff.sml: thm 'diff_const' diff.behav.";
46.26 trace_rewrite := false;
46.27 @@ -114,13 +114,13 @@
46.28
46.29 val thm = ("diff_var","");
46.30 val ct = "d_d x x";
46.31 -val Some (ctt,_) =
46.32 +val SOME (ctt,_) =
46.33 (rewrite_inst thy' "tless_true" "erls" false [("bdv","x")] thm ct);
46.34 val ct = "d_d x a";
46.35 -val None =
46.36 +val NONE =
46.37 (rewrite_inst thy' "tless_true" "erls" false [("bdv","x")] thm ct);
46.38 val ct = "d_d x (x+x)";
46.39 -val None =
46.40 +val NONE =
46.41 (rewrite_inst thy' "tless_true" "erls" false [("bdv","x")] thm ct);
46.42
46.43
46.44 @@ -133,7 +133,7 @@
46.45
46.46 val ct = "d_d x ((x+1) / (x - 1))";
46.47 val thm = ("diff_quot","");
46.48 -val Some (ctt,_) =
46.49 +val SOME (ctt,_) =
46.50 (rewrite_inst thy' "tless_true" "erls" true [("bdv","x")] thm ct);
46.51
46.52
46.53 @@ -183,11 +183,11 @@
46.54
46.55 (*---
46.56 val t = str2term "x ^^^ (2 - 1)";
46.57 -val Some (t',_) = rewrite_set_ thy false Test_simplify t;
46.58 +val SOME (t',_) = rewrite_set_ thy false Test_simplify t;
46.59 term2str t';
46.60
46.61 val t = str2term "-1 * 1";
46.62 -val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times"))) t;
46.63 +val SOME (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times"))) t;
46.64 *)
46.65
46.66
46.67 @@ -258,16 +258,16 @@
46.68 trace_rewrite:=false;
46.69
46.70 val ct = "2 * x ^^^ (2 - 1) + 3 * 1 + 0";
46.71 - val Some (ct',_) = rewrite_set "Isac.thy" false "make_polynomial" ct;
46.72 + val SOME (ct',_) = rewrite_set "Isac.thy" false "make_polynomial" ct;
46.73
46.74 trace_rewrite:=true;
46.75 val t = str2term ct;
46.76 term2str t;
46.77 - val Some (t',_) = rewrite_set_ Isac.thy false make_polynomial t;
46.78 + val SOME (t',_) = rewrite_set_ Isac.thy false make_polynomial t;
46.79 term2str t';
46.80 trace_rewrite:=false;
46.81
46.82 - val Some (t'',_) = rewrite_set_ Isac.thy false make_polynomial t';
46.83 + val SOME (t'',_) = rewrite_set_ Isac.thy false make_polynomial t';
46.84 term2str t'';
46.85
46.86 val thm = num_str realpow_eq_oneI;
46.87 @@ -481,7 +481,7 @@
46.88 term2str screxp1;
46.89 atomty screxp1;
46.90
46.91 -val Some (f'_,_) = rewrite_set_ Isac.thy false srls_diff screxp1;
46.92 +val SOME (f'_,_) = rewrite_set_ Isac.thy false srls_diff screxp1;
46.93 if term2str f'_= "Take (A' = d_d s (s * (a - s)))" then ()
46.94 else raise error "diff.sml: diff.behav. in 'primed'";
46.95 atomty f'_;
46.96 @@ -524,15 +524,15 @@
46.97 val rls = diff_conv;
46.98
46.99 val t = str2term "2/x^^^2";
46.100 -val Some (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.101 +val SOME (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.102 if term2str t = "2 * x ^^^ -2" then () else raise error "diff.sml 1/x";
46.103
46.104 val t = str2term "sqrt (x^^^3)";
46.105 -val Some (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.106 +val SOME (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.107 if term2str t = "x ^^^ (3 / 2)" then () else raise error "diff.sml x^1/2";
46.108
46.109 val t = str2term "2 / sqrt x^^^3";
46.110 -val Some (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.111 +val SOME (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.112 if term2str t = "2 * x ^^^ (-3 / 2)" then () else raise error"diff.sml x^-1/2";
46.113 (* trace_rewrite := true;
46.114 trace_rewrite := false;
46.115 @@ -540,16 +540,16 @@
46.116 val rls = diff_sym_conv;
46.117
46.118 val t = str2term "2 * x ^^^ -2";
46.119 -val Some (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.120 +val SOME (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.121 if term2str t = "2 / x ^^^ 2" then () else raise error "diff.sml sym 1/x";
46.122
46.123
46.124 val t = str2term "x ^^^ (3 / 2)";
46.125 -val Some (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.126 +val SOME (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.127 if term2str t = "sqrt (x ^^^ 3)" then () else raise error"diff.sml sym x^1/x";
46.128
46.129 val t = str2term "2 * x ^^^ (-3 / 2)";
46.130 -val Some (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.131 +val SOME (t,_) = rewrite_set_inst_ thy false subs rls t; term2str t;
46.132 if term2str t ="2 / sqrt (x ^^^ 3)"then()else raise error"diff.sml sym x^-1/x";
46.133
46.134
47.1 --- a/test/Tools/isac/IsacKnowledge/diffapp.sml Wed Aug 18 13:53:15 2010 +0200
47.2 +++ b/test/Tools/isac/IsacKnowledge/diffapp.sml Wed Aug 18 13:55:23 2010 +0200
47.3 @@ -294,7 +294,7 @@
47.4 | _ => raise error "diffapp.sml: max-exp me, nxt = Apply_Method";
47.5 val (p,_,f,nxt,_,pt) = me nxt p c pt;
47.6
47.7 -(*since 0508 Apply_Method does the 1st step, if None init_form -------------
47.8 +(*since 0508 Apply_Method does the 1st step, if NONE init_form -------------
47.9 (*val nxt = ("Subproblem",Subproblem ("DiffApp.thy",["make","function"]))*)
47.10 val (p,_,f,nxt,_,pt) = (me nxt p c pt) handle e => print_exn_G e;
47.11 (*val nxt = ("Refine_Tacitly",Refine_Tacitly ["make","function"])*)
47.12 @@ -476,7 +476,7 @@
47.13 val s = subst_atomic env t;
47.14 term2str s;
47.15 "(hd o filterVar A) [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
47.16 -val Some (s',_) = rewrite_set_ thy false list_rls s;
47.17 +val SOME (s',_) = rewrite_set_ thy false list_rls s;
47.18 val s'' = term2str s';
47.19 if s''="A = a * b" then () else raise error "new behaviour with list_rls 1.1.";
47.20 val env = env @ [(str2term "e_::bool",str2term "A = a * b")];
47.21 @@ -486,7 +486,7 @@
47.22 val s = subst_atomic env t;
47.23 term2str s;
47.24 "1 < length_ [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
47.25 -val Some (s',_) = rewrite_set_ thy false list_rls s;
47.26 +val SOME (s',_) = rewrite_set_ thy false list_rls s;
47.27 val s'' = term2str s';
47.28 if s''="True" then () else raise error "new behaviour with list_rls 1.2.";
47.29
47.30 @@ -503,7 +503,7 @@
47.31 \ [real_ A, real_ b,\
47.32 \ bool_list_ [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]]\
47.33 \else hd [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
47.34 -val Some (s',_) = rewrite_set_ thy false list_rls s;
47.35 +val SOME (s',_) = rewrite_set_ thy false list_rls s;
47.36 val s'' = term2str s';
47.37 if s'' =
47.38 "SubProblem (Reals_, [make, function], [no_met])\n\
47.39 @@ -542,7 +542,7 @@
47.40 term2str s;
47.41 val t = str2term
47.42 "(hd o filterVar b) [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2]";
47.43 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.44 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.45 val s' = term2str t';
47.46 if s' = "A = a * b" then () else raise error "new behaviour with list_rls 2.1";
47.47 val env = env @ [(str2term "h_::bool", str2term s')];
47.48 @@ -556,7 +556,7 @@
47.49 \ [A = a * b, (a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2])";
47.50 mem_rls "dropWhile_Cons" list_rls;
47.51 mem_rls "Atools.ident" list_rls;
47.52 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.53 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.54 val s' = term2str t';
47.55 if s' = "(a / 2) ^^^ 2 + (b / 2) ^^^ 2 = r ^^^ 2" then ()
47.56 else raise error "new behaviour with list_rls 2.2";
47.57 @@ -567,7 +567,7 @@
47.58 val s = subst_atomic env t;
47.59 term2str s;
47.60 val t = str2term "dropWhile (ident A) (Vars (A = a * b))";
47.61 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.62 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.63 val s' = term2str t';
47.64 if s' = "[a, b]" then () else raise error "new behaviour with list_rls 2.3";
47.65 val env = env @ [(str2term "vs_::real list", str2term s')];
47.66 @@ -577,7 +577,7 @@
47.67 val s = subst_atomic env t;
47.68 term2str s;
47.69 val t = str2term "hd (dropWhile (ident b) [a, b])";
47.70 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.71 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.72 val s' = term2str t';
47.73 if s' = "a" then () else raise error "new behaviour with list_rls 2.4.";
47.74 val env = env @ [(str2term "v_1::real", str2term s')];
47.75 @@ -600,7 +600,7 @@
47.76 "Substitute [(a = (rhs o hd) [a = 2 * sqrt (r ^^^ 2 - (b / 2) ^^^ 2)])]\n\
47.77 \ (A = a * b)";
47.78 mem_rls "Tools.rhs" list_rls;
47.79 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.80 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.81 val s' = term2str t';
47.82 if s' = "Substitute [a = 2 * sqrt (r ^^^ 2 - (b / 2) ^^^ 2)] (A = a * b)"
47.83 then () else raise error "new behaviour with list_rls 2.6.";
47.84 @@ -639,7 +639,7 @@
47.85 val t = str2term
47.86 "(hd o filterVar A) [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
47.87 trace_rewrite:=true;
47.88 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.89 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.90 trace_rewrite:=false;
47.91 val s' = term2str t';
47.92 if s' = "A = a * b" then() else raise error "new behaviour with list_rls 3.1.";
47.93 @@ -652,7 +652,7 @@
47.94 val t = str2term
47.95 "dropWhile (ident (A = a * b))\
47.96 \ [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
47.97 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.98 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.99 val s' = term2str t';
47.100 if s' = "[a / 2 = r * sin alpha, b / 2 = r * cos alpha]"
47.101 then () else raise error "new behaviour with list_rls 3.2.";
47.102 @@ -663,7 +663,7 @@
47.103 val s = subst_atomic env t;
47.104 term2str s;
47.105 val t = str2term "dropWhile (ident A) (Vars (A = a * b))";
47.106 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.107 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.108 val s' = term2str t';
47.109 if s' = "[a, b]" then () else raise error "new behaviour with list_rls 3.3.";
47.110 val env = env @ [(str2term "vs_::real list", str2term s')];
47.111 @@ -673,7 +673,7 @@
47.112 val s = subst_atomic env t;
47.113 term2str s;
47.114 val t = str2term "nth_ 1 [a, b]";
47.115 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.116 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.117 val s' = term2str t';
47.118 if s' = "a" then () else raise error "new behaviour with list_rls 3.4.";
47.119 val env = env @ [(str2term "v_1", str2term s')];
47.120 @@ -683,7 +683,7 @@
47.121 val s = subst_atomic env t;
47.122 term2str s;
47.123 val t = str2term "nth_ 2 [a, b]";
47.124 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.125 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.126 val s' = term2str t';
47.127 if s' = "b" then () else raise error "new behaviour with list_rls 3.5.";
47.128 val env = env @ [(str2term "v_2", str2term s')];
47.129 @@ -694,7 +694,7 @@
47.130 term2str s;
47.131 val t = str2term
47.132 "(hd o filterVar a) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
47.133 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.134 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.135 val s' = term2str t';
47.136 if s' = "a / 2 = r * sin alpha" then ()
47.137 else raise error "new behaviour with list_rls 3.6.";
47.138 @@ -707,7 +707,7 @@
47.139 term2str s;
47.140 val t = str2term
47.141 "(hd o filterVar b) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
47.142 -val Some (t',_) = rewrite_set_ thy false list_rls t;
47.143 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
47.144 val s' = term2str t';
47.145 if s' = "b / 2 = r * cos alpha" then ()
47.146 else raise error "new behaviour with list_rls 3.7.";
47.147 @@ -740,7 +740,7 @@
47.148 term2str s;
47.149 "Substitute\n [(a = (rhs o hd) [a = 2 * r * sin alpha]),\
47.150 \ (b = (rhs o hd) [b = 2 * r * cos alpha])] (A = a * b)";
47.151 -val Some (s',_) = rewrite_set_ thy false list_rls s;
47.152 +val SOME (s',_) = rewrite_set_ thy false list_rls s;
47.153 val s'' = term2str s';
47.154 if s'' =
47.155 "Substitute [a = 2 * r * sin alpha, b = 2 * r * cos alpha] (A = a * b)"
48.1 --- a/test/Tools/isac/IsacKnowledge/eqsystem.sml Wed Aug 18 13:53:15 2010 +0200
48.2 +++ b/test/Tools/isac/IsacKnowledge/eqsystem.sml Wed Aug 18 13:55:23 2010 +0200
48.3 @@ -50,31 +50,31 @@
48.4
48.5 val t = str2term"[c,c_2] from_ [c,c_2,c_3] occur_exactly_in \
48.6 \-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
48.7 -val Some (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.8 +val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.9 if str = "[c, c_2] from_ [c, c_2,\n c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = True" then ()
48.10 else raise error "eval_occur_exactly_in [c, c_2]";
48.11
48.12 val t = str2term"[c,c_2,c_3] from_ [c,c_2,c_3] occur_exactly_in \
48.13 \-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
48.14 -val Some (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.15 +val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.16 if str = "[c, c_2,\n c_3] from_ [c, c_2,\n c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = False" then ()
48.17 else raise error "eval_occur_exactly_in [c, c_2, c_3]";
48.18
48.19 val t = str2term"[c_2] from_ [c,c_2,c_3] occur_exactly_in \
48.20 \-1 * q_0 * L ^^^ 2 / 2 + L * c + c_2";
48.21 -val Some (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.22 +val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.23 if str = "[c_2] from_ [c, c_2,\n c_3] occur_exactly_in -1 * q_0 * L ^^^ 2 / 2 + L * c + c_2 = False" then ()
48.24 else raise error "eval_occur_exactly_in [c, c_2, c_3]";
48.25
48.26 val t = str2term"[] from_ [c,c_2,c_3] occur_exactly_in 0";
48.27 -val Some (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.28 +val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.29 if str = "[] from_ [c, c_2, c_3] occur_exactly_in 0 = True" then ()
48.30 else raise error "eval_occur_exactly_in [c, c_2, c_3]";
48.31
48.32 val t =
48.33 str2term
48.34 "[] from_ [c, c_2, c_3, c_4] occur_exactly_in -1 * (q_0 * L ^^^ 2) /2";
48.35 -val Some (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.36 +val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur'_exactly'_in" t 0;
48.37 if str = "[] from_ [c, c_2, c_3, c_4] occur_exactly_in \
48.38 \-1 * (q_0 * L ^^^ 2) / 2 = True" then ()
48.39 else raise error "eval_occur_exactly_in [c, c_2, c_3, c_4]";
48.40 @@ -91,13 +91,13 @@
48.41 Calc ("op +", eval_binop "#add_"),
48.42 Calc ("op =",eval_equal "#equal_")
48.43 ];
48.44 -val Some (t',_) = rewrite_set_ thy false testrls t;
48.45 +val SOME (t',_) = rewrite_set_ thy false testrls t;
48.46 if term2str t' = "True" then ()
48.47 else raise error "eqsystem.sml: length_ [x+y=1,y=2] = 2";
48.48
48.49 -val Some t = parse EqSystem.thy "solution L";
48.50 +val SOME t = parse EqSystem.thy "solution L";
48.51 atomty (term_of t);
48.52 -val Some t = parse Biegelinie.thy "solution L";
48.53 +val SOME t = parse Biegelinie.thy "solution L";
48.54 atomty (term_of t);
48.55
48.56 val t = str2term
48.57 @@ -106,7 +106,7 @@
48.58 val t = str2term
48.59 "(tl (tl (tl [c,c_2,c_3,c_4]))) from_ [c,c_2,c_3,c_4] occur_exactly_in \
48.60 \(nth_ 1 [c_4 = 1, 2=2,3=3,4=4])";
48.61 -val Some (t,_) =
48.62 +val SOME (t,_) =
48.63 rewrite_set_ thy true
48.64 (append_rls "prls_" e_rls
48.65 [Thm ("nth_Cons_",num_str nth_Cons_),
48.66 @@ -159,19 +159,19 @@
48.67 \0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2]";
48.68 val bdvs = [(str2term"bdv_1",str2term"c"),
48.69 (str2term"bdv_2",str2term"c_2")];
48.70 -val Some(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.71 +val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.72 if term2str t = "[0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2), 0 = c_2]"
48.73 then () else raise error "eqsystem.sml rewrite in 2x2 simplify_System_par.1";
48.74
48.75 -val Some (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
48.76 +val SOME (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
48.77 if term2str t = "[L * c + c_2 = 0 + -1 * (-1 * q_0 * L ^^^ 2 / 2), c_2 = 0]"
48.78 then () else raise error "eqsystem.sml rewrite in 2x2 isolate_bdvs";
48.79
48.80 -val Some(t,_)= rewrite_set_inst_ thy true bdvs simplify_System t;
48.81 +val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System t;
48.82 if term2str t = "[L * c + c_2 = q_0 * L ^^^ 2 / 2, c_2 = 0]"
48.83 then () else raise error "eqsystem.sml rewrite in 2x2 simplify_System_par.2";
48.84
48.85 -val Some (t,_) = rewrite_set_ thy true order_system t;
48.86 +val SOME (t,_) = rewrite_set_ thy true order_system t;
48.87 if term2str t = "[c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]"
48.88 then () else raise error "eqsystem.sml rewrite in 2x2 simplify_System_par.3";
48.89
48.90 @@ -185,19 +185,19 @@
48.91 \ -1 * q_0 / 24 * 0 ^^^ 4),\
48.92 \ 0 = c_2 + c * L + 1 / EI * (L * q_0 / 12 * L ^^^ 3 + \
48.93 \ -1 * q_0 / 24 * L ^^^ 4)]";
48.94 -val Some (t,_) = rewrite_set_ thy true norm_Rational t;
48.95 +val SOME (t,_) = rewrite_set_ thy true norm_Rational t;
48.96 if term2str t="[0 = c_2, 0 = c_2 + L * c + L ^^^ 4 * q_0 / (EI * 24)]"
48.97 then () else raise error "eqsystem.sml rewrite in 2x2 simplify_System_par.0b";
48.98
48.99 -val Some(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.100 +val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.101 if term2str t = "[0 = c_2, 0 = q_0 * L ^^^ 4 / (24 * EI) + (L * c + c_2)]"
48.102 then () else raise error "eqsystem.sml rewrite in 2x2 simplify_System_par.1b";
48.103
48.104 -val Some (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
48.105 +val SOME (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
48.106 if term2str t = "[c_2 = 0, L * c + c_2 = 0 + -1 * (q_0 * L ^^^ 4 / (24 * EI))]"
48.107 then () else raise error "eqsystem.sml rewrite in 2x2 isolate_bdvs b";
48.108
48.109 -val Some(t,_)= rewrite_set_inst_ thy true bdvs simplify_System t;
48.110 +val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System t;
48.111 if term2str t = "[c_2 = 0, L * c + c_2 = -1 * q_0 * L ^^^ 4 / (24 * EI)]"
48.112 then () else raise error "eqsystem.sml rewrite in 2x2 simplify_System.2b";
48.113
48.114 @@ -213,21 +213,21 @@
48.115 val e2__ = str2term "L * c + c_2 = q_0 * L ^^^ 2 / 2";
48.116 val bdvs = [(str2term"bdv_1",str2term"c"),
48.117 (str2term"bdv_2",str2term"c_2")];
48.118 -val Some (e2__,_) = rewrite_terms_ thy dummy_ord Erls [e1__] e2__;
48.119 +val SOME (e2__,_) = rewrite_terms_ thy dummy_ord Erls [e1__] e2__;
48.120 if term2str e2__ = "L * c + 77 = q_0 * L ^^^ 2 / 2" then ()
48.121 else raise error "eqsystem.sml top_down_substitution,2x2] subst";
48.122
48.123 -val Some (e2__,_) =
48.124 +val SOME (e2__,_) =
48.125 rewrite_set_inst_ thy true bdvs simplify_System_parenthesized e2__;
48.126 if term2str e2__ = "77 + L * c = q_0 * L ^^^ 2 / 2" then ()
48.127 else raise error "eqsystem.sml top_down_substitution,2x2] simpl_par";
48.128
48.129 -val Some (e2__,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs e2__;
48.130 +val SOME (e2__,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs e2__;
48.131 if term2str e2__ = "c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L" then ()
48.132 else raise error "eqsystem.sml top_down_substitution,2x2] isolate";
48.133
48.134 val t = str2term "[c_2 = 77, c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L]";
48.135 -val Some (t,_) = rewrite_set_ thy true order_system t;
48.136 +val SOME (t,_) = rewrite_set_ thy true order_system t;
48.137 if term2str t = "[c = (q_0 * L ^^^ 2 / 2 + -1 * 77) / L, c_2 = 77]" then ()
48.138 else raise error "eqsystem.sml top_down_substitution,2x2] order_system";
48.139
48.140 @@ -253,26 +253,26 @@
48.141 (str2term"bdv_2",str2term"c_2"),
48.142 (str2term"bdv_3",str2term"c_3"),
48.143 (str2term"bdv_4",str2term"c_4")];
48.144 -val Some (t,_) =
48.145 +val SOME (t,_) =
48.146 rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.147 if term2str t = "[0 = c_4, 0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c_3 + c_4),\n\
48.148 \ c + (c_2 + (c_3 + c_4)) = 0, c_2 + (c_3 + c_4) = 0]"
48.149 then () else raise error "eqsystem.sml rewrite in 4x4 simplify_System_paren";
48.150
48.151 -val Some (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
48.152 +val SOME (t,_) = rewrite_set_inst_ thy true bdvs isolate_bdvs t;
48.153 if term2str t = "[c_4 = 0, \
48.154 \L * c_3 + c_4 = 0 + -1 * (-1 * q_0 * L ^^^ 2 / 2),\n \
48.155 \c + (c_2 + (c_3 + c_4)) = 0, c_2 + (c_3 + c_4) = 0]"
48.156 then () else raise error "eqsystem.sml rewrite in 4x4 isolate_bdvs";
48.157
48.158 -val Some(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.159 +val SOME(t,_)= rewrite_set_inst_ thy true bdvs simplify_System_parenthesized t;
48.160 if term2str t = "[c_4 = 0,\
48.161 \ L * c_3 + c_4 = q_0 * L ^^^ 2 / 2,\
48.162 \ c + (c_2 + (c_3 + c_4)) = 0,\n\
48.163 \ c_2 + (c_3 + c_4) = 0]"
48.164 then () else raise error "eqsystem.sml rewrite in 4x4 simplify_System_p..2";
48.165
48.166 -val Some (t,_) = rewrite_set_ thy true order_system t;
48.167 +val SOME (t,_) = rewrite_set_ thy true order_system t;
48.168 if term2str t = "[c_4 = 0,\
48.169 \ L * c_3 + c_4 = q_0 * L ^^^ 2 / 2,\
48.170 \ c_2 + (c_3 + c_4) = 0,\n\
48.171 @@ -715,7 +715,7 @@
48.172 val t = str2term"[c, c_2] from_ [c, c_2] occur_exactly_in nth_ 2\
48.173 \[c_2 = 0, L * c + c_2 = q_0 * L ^^^ 2 / 2]";
48.174 trace_rewrite:=true;
48.175 -val Some (t',_) = rewrite_set_ thy false prls_triangular t;
48.176 +val SOME (t',_) = rewrite_set_ thy false prls_triangular t;
48.177 (*found:...
48.178 ## try thm: nth_Cons_
48.179 ### eval asms: 1 < 2 + - 1
48.180 @@ -795,7 +795,7 @@
48.181 ("#Find" ,["solution ss___"](*___ is copy-named*))
48.182 ],
48.183 append_rls "e_rls" e_rls [(*for preds in where_*)],
48.184 - Some "solveSystem es_ vs_",
48.185 + SOME "solveSystem es_ vs_",
48.186 []));
48.187 *)
48.188 > val [("#Given", [equalities_es_, "solveForVars vs_"])] = gi;
48.189 @@ -1018,24 +1018,24 @@
48.190 \ 0 = c_4 + L * c_3 +(12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI), \
48.191 \ 0 = c_2, \
48.192 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2]";
48.193 -val Some (t',_) = rewrite_set_ thy false isolate_bdvs_4x4 t;
48.194 +val SOME (t',_) = rewrite_set_ thy false isolate_bdvs_4x4 t;
48.195 term2str t';
48.196 "[c_4 = 0,\n (12 * L ^^^ 2 * c_2 + 4 * L ^^^ 3 * c + -1 * L ^^^ 4 * q_0) / (-24 * EI) =\n 0 + -1 * (c_4 + L * c_3),\n c_2 = 0, (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2 = 0]";
48.197
48.198
48.199 "----- 7.27 go through the rewrites in met_eqsys_norm_4x4";
48.200 val t = str2term "0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2";
48.201 -val None = rewrite_set_ thy false norm_Rational t;
48.202 -val Some (t,_) =
48.203 +val NONE = rewrite_set_ thy false norm_Rational t;
48.204 +val SOME (t,_) =
48.205 rewrite_set_inst_ thy false subst simplify_System_parenthesized t;
48.206 term2str t = "0 = -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2)";
48.207 "--- isolate_bdvs_4x4";
48.208 (*
48.209 -val Some (t,_) = rewrite_set_inst_ thy false subst isolate_bdvs_4x4 t;
48.210 +val SOME (t,_) = rewrite_set_inst_ thy false subst isolate_bdvs_4x4 t;
48.211 term2str t;
48.212 -val Some (t,_) = rewrite_set_inst_ thy false subst simplify_System t;
48.213 +val SOME (t,_) = rewrite_set_inst_ thy false subst simplify_System t;
48.214 term2str t;
48.215 -val Some (t,_) = rewrite_set_ thy false order_system t;
48.216 +val SOME (t,_) = rewrite_set_ thy false order_system t;
48.217 term2str t;
48.218 *)
48.219
48.220 @@ -1093,26 +1093,26 @@
48.221 \ 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2,\
48.222 \ 0 = c_4, \
48.223 \ 0 = c_3]";
48.224 -val Some (t,_) =
48.225 +val SOME (t,_) =
48.226 rewrite_ thy e_rew_ord e_rls false (num_str commute_0_equality) t;
48.227 -val Some (t,_) =
48.228 +val SOME (t,_) =
48.229 rewrite_ thy e_rew_ord e_rls false (num_str commute_0_equality) t;
48.230 -val Some (t,_) =
48.231 +val SOME (t,_) =
48.232 rewrite_ thy e_rew_ord e_rls false (num_str commute_0_equality) t;
48.233 term2str t =
48.234 "[L * q_0 = c, (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2 = 0, c_4 = 0,\n c_3 = 0]";
48.235 -val Some (t,_) =
48.236 +val SOME (t,_) =
48.237 rewrite_set_inst_ thy false subst simplify_System_parenthesized t;
48.238 term2str t =
48.239 "[L * q_0 = c, -1 * q_0 * L ^^^ 2 / 2 + (L * c + c_2) = 0, c_4 = 0, c_3 = 0]";
48.240 -val Some (t,_) = rewrite_set_inst_ thy false subst isolate_bdvs_4x4 t;
48.241 +val SOME (t,_) = rewrite_set_inst_ thy false subst isolate_bdvs_4x4 t;
48.242 term2str t =
48.243 "[c = (-1 * (L * q_0) + 0) / -1,\n L * c + c_2 = -1 * (-1 * q_0 * L ^^^ 2 / 2) + 0, c_4 = 0, c_3 = 0]";
48.244 -val Some (t,_) =
48.245 +val SOME (t,_) =
48.246 rewrite_set_inst_ thy false subst simplify_System_parenthesized t;
48.247
48.248 term2str t ="[c = L * q_0, L * c + c_2 = q_0 * L ^^^ 2 / 2, c_4 = 0, c_3 = 0]";
48.249 -val Some (t,_) = rewrite_set_ thy false order_system t;
48.250 +val SOME (t,_) = rewrite_set_ thy false order_system t;
48.251 if term2str t ="[c = L * q_0, L * c + c_2 = q_0 * L ^^^ 2 / 2, c_3 = 0, c_4 = 0]" then ()
48.252 else raise error "eqsystem.sml: exp 7.70 normalize 4x4 by rewrite changed";
48.253
49.1 --- a/test/Tools/isac/IsacKnowledge/integrate.sml Wed Aug 18 13:53:15 2010 +0200
49.2 +++ b/test/Tools/isac/IsacKnowledge/integrate.sml Wed Aug 18 13:55:23 2010 +0200
49.3 @@ -94,46 +94,46 @@
49.4 val cc = new_c term;
49.5 if term2str cc = "c_3" then () else raise error "integrate.sml: new_c ???";
49.6
49.7 -val Some (id,t') = eval_add_new_c "" "Integrate.add'_new'_c" term thy;
49.8 +val SOME (id,t') = eval_add_new_c "" "Integrate.add'_new'_c" term thy;
49.9 if term2str t' = "x ^^^ 2 * c + c_2 = x ^^^ 2 * c + c_2 + c_3" then ()
49.10 else raise error "intergrate.sml: diff. eval_add_new_c";
49.11
49.12 val cc = ("Integrate.add'_new'_c", eval_add_new_c "add_new_c_");
49.13 -val Some (thmstr, thm) = get_calculation1_ thy cc term;
49.14 +val SOME (thmstr, thm) = get_calculation1_ thy cc term;
49.15
49.16 -val Some (t',_) = rewrite_set_ thy true add_new_c term;
49.17 +val SOME (t',_) = rewrite_set_ thy true add_new_c term;
49.18 if term2str t' = "x ^^^ 2 * c + c_2 + c_3" then ()
49.19 else raise error "intergrate.sml: diff. rewrite_set add_new_c 1";
49.20
49.21 val term = str2term "ff x = x^^^2*c + c_2";
49.22 -val Some (t',_) = rewrite_set_ thy true add_new_c term;
49.23 +val SOME (t',_) = rewrite_set_ thy true add_new_c term;
49.24 if term2str t' = "ff x = x ^^^ 2 * c + c_2 + c_3" then ()
49.25 else raise error "intergrate.sml: diff. rewrite_set add_new_c 2";
49.26
49.27
49.28 (*WN080222 replace call_new_c with add_new_c----------------------
49.29 val term = str2term "new_c (c * x^^^2 + c_2)";
49.30 -val Some (_,t') = eval_new_c 0 0 term 0;
49.31 +val SOME (_,t') = eval_new_c 0 0 term 0;
49.32 if term2s t' = "new_c c * x ^^^ 2 + c_2 = c_3" then ()
49.33 else raise error "integrate.sml: eval_new_c ???";
49.34
49.35 val t = str2term "matches (?u + new_c ?v) (x ^^^ 2 / 2)";
49.36 -val Some (_,t') = eval_matches "" "Tools.matches" t thy; term2s t';
49.37 +val SOME (_,t') = eval_matches "" "Tools.matches" t thy; term2s t';
49.38 if term2s t' = "matches (?u + new_c ?v) (x ^^^ 2 / 2) = False" then ()
49.39 else raise error "integrate.sml: matches new_c = False";
49.40
49.41 val t = str2term "matches (?u + new_c ?v) (x ^^^ 2 / 2 + new_c x ^^^ 2 / 2)";
49.42 -val Some (_,t') = eval_matches "" "Tools.matches" t thy; term2s t';
49.43 +val SOME (_,t') = eval_matches "" "Tools.matches" t thy; term2s t';
49.44 if term2s t'="matches (?u + new_c ?v) (x ^^^ 2 / 2 + new_c x ^^^ 2 / 2) = True"
49.45 then () else raise error "integrate.sml: matches new_c = True";
49.46
49.47 val t = str2term "ff x is_f_x";
49.48 -val Some (_,t') = eval_is_f_x "" "" t thy; term2s t';
49.49 +val SOME (_,t') = eval_is_f_x "" "" t thy; term2s t';
49.50 if term2s t' = "(ff x is_f_x) = True" then ()
49.51 else raise error "integrate.sml: eval_is_f_x --> true";
49.52
49.53 val t = str2term "q_0/2 * L * x is_f_x";
49.54 -val Some (_,t') = eval_is_f_x "" "" t thy; term2s t';
49.55 +val SOME (_,t') = eval_is_f_x "" "" t thy; term2s t';
49.56 if term2s t' = "(q_0 / 2 * L * x is_f_x) = False" then ()
49.57 else raise error "integrate.sml: eval_is_f_x --> false";
49.58
49.59 @@ -175,8 +175,8 @@
49.60 "----- stepwise from the rulesets in simplify_Integral and below-----";
49.61 (*###*)val rls = norm_Rational_noadd_fractions;
49.62 case rewrite_set_inst_ thy true subs rls t of
49.63 - Some _ => raise error "integrate.sml simplify by ruleset norm_Rational_.#2"
49.64 - | None => ();
49.65 + SOME _ => raise error "integrate.sml simplify by ruleset norm_Rational_.#2"
49.66 + | NONE => ();
49.67 (* WN051028 Rational.ML 'rat_mult_div_pow' with erls = e_rls
49.68 applies 'rat_mult_poly_r'="?c is_polyexp ==> ?a / ?b * ?c = ?a * ?c / ?b"
49.69 to "(L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2) / EI"
49.70 @@ -184,12 +184,12 @@
49.71 AFTER CORRECTION in Integrate.ML as above*)
49.72
49.73 (*###*)val rls = order_add_mult_in;
49.74 -val Some (t,[]) = rewrite_set_ thy true rls t;
49.75 +val SOME (t,[]) = rewrite_set_ thy true rls t;
49.76 if term2str t = "1 / EI * (L * (q_0 * x) / 2 + -1 * (q_0 * x ^^^ 2) / 2)"then()
49.77 else raise error "integrate.sml simplify by ruleset order_add_mult_in #2";
49.78
49.79 (*###*)val rls = discard_parentheses;
49.80 -val Some (t,[]) = rewrite_set_ thy true rls t;
49.81 +val SOME (t,[]) = rewrite_set_ thy true rls t;
49.82 if term2str t = "1 / EI * (L * q_0 * x / 2 + -1 * q_0 * x ^^^ 2 / 2)" then ()
49.83 else raise error "integrate.sml simplify by ruleset discard_parenth.. #3";
49.84
49.85 @@ -203,14 +203,14 @@
49.86 (*"?bdv / ?b = (1 / ?b) * ?bdv"*)
49.87 Thm ("separate_1_bdv_n", num_str separate_1_bdv_n)
49.88 ]);
49.89 -val Some (t,[]) = rewrite_set_inst_ thy true subs rls t;
49.90 +val SOME (t,[]) = rewrite_set_inst_ thy true subs rls t;
49.91 if term2str t = "1 / EI * (L * q_0 / 2 * x + -1 * q_0 / 2 * x ^^^ 2)" then ()
49.92 else raise error "integrate.sml simplify by ruleset separate_bdv.. #4";
49.93
49.94
49.95 val t = str2term "1/EI * (L * q_0 * x / 2 + -1 * q_0 * x^^^2 / 2)";
49.96 val rls = simplify_Integral;
49.97 -val Some (t,[]) = rewrite_set_inst_ thy true subs rls t;
49.98 +val SOME (t,[]) = rewrite_set_inst_ thy true subs rls t;
49.99 if term2str t = "1 / EI * (L * q_0 / 2 * x + -1 * q_0 / 2 * x ^^^ 2)" then ()
49.100 else raise error "integrate.sml, simplify_Integral #99";
49.101
49.102 @@ -221,13 +221,13 @@
49.103 "Integral 1 / EI * (L * q_0 / 2 * (x ^^^ 2 / 2) + \
49.104 \-1 * q_0 / 2 * (x ^^^ 3 / 3)) D x";
49.105 val rls = simplify_Integral;
49.106 -val Some (t,[]) = rewrite_set_inst_ thy true subs rls t;
49.107 +val SOME (t,[]) = rewrite_set_inst_ thy true subs rls t;
49.108 if term2str t =
49.109 "Integral 1 / EI * (L * q_0 / 4 * x ^^^ 2 + -1 * q_0 / 6 * x ^^^ 3) D x"
49.110 then () else raise error "integrate.sml, simplify_Integral #198";
49.111
49.112 val rls = integration_rules;
49.113 -val Some (t,[]) = rewrite_set_ thy true rls t;
49.114 +val SOME (t,[]) = rewrite_set_ thy true rls t;
49.115 if term2str t =
49.116 "1 / EI * (L * q_0 / 4 * (x ^^^ 3 / 3) + -1 * q_0 / 6 * (x ^^^ 4 / 4))"
49.117 then () else raise error "integrate.sml, simplify_Integral #199";
49.118 @@ -301,12 +301,12 @@
49.119 val bdv = [(str2term"bdv", str2term"x")];
49.120 val t = str2term
49.121 "Integral 1 / EI * ((L * q_0 * x + -1 * q_0 * x ^^^ 2) / 2) D x";
49.122 -val Some(t,_)= rewrite_set_inst_ thy true bdv simplify_Integral t;
49.123 +val SOME(t,_)= rewrite_set_inst_ thy true bdv simplify_Integral t;
49.124 if term2str t =
49.125 "Integral 1 / EI * (L * q_0 / 2 * x + -1 * q_0 / 2 * x ^^^ 2) D x" then ()
49.126 else raise error "integrate.sml 3rd integration in 7.27, simplify_Integral";
49.127
49.128 -val Some(t,_)= rewrite_set_inst_ thy true bdv integration t;
49.129 +val SOME(t,_)= rewrite_set_inst_ thy true bdv integration t;
49.130 if term2str t = "c + 1 / EI * (L * q_0 / 4 * x ^^^ 2 + -1 * q_0 / 6 * x ^^^ 3)"
49.131 then () else raise error "integrate.sml 3rd integration in 7.27, integration";
49.132
49.133 @@ -354,7 +354,7 @@
49.134
49.135 show_ptyps();
49.136 val pbl = get_pbt ["integrate","function"];
49.137 -case #cas pbl of Some (Const ("Integrate.Integrate",_) $ _) => ()
49.138 +case #cas pbl of SOME (Const ("Integrate.Integrate",_) $ _) => ()
49.139 | _ => raise error "integrate.sml: Integrate.Integrate ???";
49.140
49.141
50.1 --- a/test/Tools/isac/IsacKnowledge/poly.sml Wed Aug 18 13:53:15 2010 +0200
50.2 +++ b/test/Tools/isac/IsacKnowledge/poly.sml Wed Aug 18 13:55:23 2010 +0200
50.3 @@ -69,7 +69,7 @@
50.4 (*SPB Schalk I p.63 No.267b*)
50.5 val t = str2term
50.6 "(5*x^^^2 + 3) * (2*x^^^7 + 3) - (3*x^^^5 + 8) * (6*x^^^4 - 1)";
50.7 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.8 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.9 if (term2str t) =
50.10 "17 + 15 * x ^^^ 2 + -48 * x ^^^ 4 + 3 * x ^^^ 5 + 6 * x ^^^ 7 + -8 * x ^^^ 9"
50.11 then ()
50.12 @@ -78,7 +78,7 @@
50.13 (*SPB Schalk I p.63 No.275b*)
50.14 val t = str2term
50.15 "(3*x^^^2 - 2*x*y + y^^^2) * (x^^^2 - 2*y^^^2)";
50.16 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.17 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.18 term2str t;
50.19 if (term2str t) =
50.20 "3 * x ^^^ 4 + -2 * x ^^^ 3 * y + -5 * x ^^^ 2 * y ^^^ 2 + \
50.21 @@ -89,7 +89,7 @@
50.22 (*SPB Schalk I p.63 No.279b*)
50.23 val t = str2term
50.24 "(x-a)*(x-b)*(x-c)*(x-d)";
50.25 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.26 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.27 term2str t;
50.28 (* Richtig! *)
50.29 if (term2str t) =
50.30 @@ -100,7 +100,7 @@
50.31 (*SPB Schalk I p.63 No.291*)
50.32 val t = str2term
50.33 "(5+96*x^^^3+8*x*(-4+(7- 3*x)*4*x))*(5*(2- 3*x)- (-15*x*(-8*x- 5)))";
50.34 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.35 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.36 term2str t;
50.37 if (term2str t) =
50.38 "50 + -770 * x + 4520 * x ^^^ 2 + -16320 * x ^^^ 3 + -26880 * x ^^^ 4"
50.39 @@ -110,7 +110,7 @@
50.40 (*SPB Schalk I p.64 No.295c*)
50.41 val t = str2term
50.42 "(13*a^^^4*b^^^9*c - 12*a^^^3*b^^^6*c^^^9)^^^2";
50.43 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.44 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.45 term2str t;
50.46 if (term2str t) =
50.47 "169 * a ^^^ 8 * b ^^^ 18 * c ^^^ 2 + -312 * a ^^^ 7 * b ^^^ 15 * c ^^^ 10\
50.48 @@ -121,7 +121,7 @@
50.49 (*SPB Schalk I p.64 No.299a*)
50.50 val t = str2term
50.51 "(x - y)*(x + y)";
50.52 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.53 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.54 term2str t;
50.55 if (term2str t) =
50.56 "x ^^^ 2 + -1 * y ^^^ 2"
50.57 @@ -131,7 +131,7 @@
50.58 (*SPB Schalk I p.64 No.300c*)
50.59 val t = str2term
50.60 "(3*x^^^2*y - 1)*(3*x^^^2*y + 1)";
50.61 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.62 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.63 term2str t;
50.64 if (term2str t) =
50.65 "-1 + 9 * x ^^^ 4 * y ^^^ 2"
50.66 @@ -141,7 +141,7 @@
50.67 (*SPB Schalk I p.64 No.302*)
50.68 val t = str2term
50.69 "(13*x^^^2 + 5)*(13*x^^^2 - 5) - (5*x^^^2 + 3)*(5*x^^^2 - 3) - (12*x^^^2 + 4)*(12*x^^^2 - 4)";
50.70 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.71 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.72 if term2str t = "0" then ()
50.73 else raise error "poly.sml: diff.behav. in make_polynomial 8";
50.74 (* Bei Berechnung sollte 3 mal real_plus_minus_binom1_p aus expand_poly verwendet werden *)
50.75 @@ -149,7 +149,7 @@
50.76
50.77 (*SPB Schalk I p.64 No.306a*)
50.78 val t = str2term "((x^^^2 + 1)*(x^^^2 - 1))^^^2";
50.79 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.80 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.81 if (term2str t) = "1 + 2 * x ^^^ 4 + 2 * -2 * x ^^^ 4 + x ^^^ 8" then ()
50.82 else raise error "poly.sml: diff.behav. in make_polynomial: not confluent \
50.83 \2 * x ^^^ 4 + 2 * -2 * x ^^^ 4 = -2 * x ^^^ 4 works again";
50.84 @@ -158,38 +158,38 @@
50.85 (*WN071729 when reducing "rls reduce_012_" for Schaerding,
50.86 the above resulted in the term below ... but reduces from then correctly*)
50.87 val t = str2term "1 + 2 * x ^^^ 4 + 2 * -2 * x ^^^ 4 + x ^^^ 8";
50.88 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.89 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.90 if (term2str t) = "1 + -2 * x ^^^ 4 + x ^^^ 8" then ()
50.91 else raise error "poly.sml: diff.behav. in make_polynomial 9b";
50.92
50.93 (*SPB Schalk I p.64 No.296a*)
50.94 val t = str2term "(x - a)^^^3";
50.95 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.96 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.97 if (term2str t) = "-1 * a ^^^ 3 + 3 * a ^^^ 2 * x + -3 * a * x ^^^ 2 + x ^^^ 3"
50.98 then () else raise error "poly.sml: diff.behav. in make_polynomial 10";
50.99
50.100 (*SPB Schalk I p.64 No.296c*)
50.101 val t = str2term "(-3*x - 4*y)^^^3";
50.102 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.103 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.104 if (term2str t) =
50.105 "-27 * x ^^^ 3 + -108 * x ^^^ 2 * y + -144 * x * y ^^^ 2 + -64 * y ^^^ 3"
50.106 then () else raise error "poly.sml: diff.behav. in make_polynomial 11";
50.107
50.108 (*SPB Schalk I p.62 No.242c*)
50.109 val t = str2term "x^^^(-4)*(x^^^(-4)*y^^^(-2))^^^(-1)*y^^^(-2)";
50.110 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.111 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.112 if (term2str t) = "1" then ()
50.113 else raise error "poly.sml: diff.behav. in make_polynomial 12";
50.114
50.115 (*SPB Schalk I p.60 No.209a*)
50.116 val t = str2term "a^^^(7-x) * a^^^x";
50.117 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.118 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.119 if term2str t = "a ^^^ 7" then ()
50.120 else raise error "poly.sml: diff.behav. in make_polynomial 13";
50.121
50.122 (*SPB Schalk I p.60 No.209d*)
50.123 val t = str2term "d^^^x * d^^^(x+1) * d^^^(2 - 2*x)";
50.124 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.125 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.126 if term2str t = "d ^^^ 3" then ()
50.127 else raise error "poly.sml: diff.behav. in make_polynomial 14";
50.128
50.129 @@ -200,7 +200,7 @@
50.130
50.131 (*Schalk I p.64 No.303*)
50.132 val t = str2term "(a + 2*b)*(a^^^2 + 4*b^^^2)*(a - 2*b) - (a - 6*b)*(a^^^2 + 36*b^^^2)*(a + 6*b)";
50.133 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.134 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.135 if term2str t = "1280 * b ^^^ 4" then ()
50.136 else raise error "poly.sml: diff.behav. in make_polynomial 14b";
50.137 (* Richtig - aber Binomische Formel wurde nicht verwendet! *)
50.138 @@ -211,62 +211,62 @@
50.139 (*--------------------------------------------------------------------*)
50.140 (*SPO*)
50.141 val t = str2term "a^^^2*a^^^(-2)";
50.142 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.143 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.144 if term2str t = "1" then ()
50.145 else raise error "poly.sml: diff.behav. in make_polynomial 15";
50.146 (*SPO*)
50.147 val t = str2term "a + a + a";
50.148 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.149 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.150 if term2str t = "3 * a" then ()
50.151 else raise error "poly.sml: diff.behav. in make_polynomial 16";
50.152 (*SPO*)
50.153 val t = str2term "a + b + b + b";
50.154 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.155 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.156 if term2str t = "a + 3 * b" then ()
50.157 else raise error "poly.sml: diff.behav. in make_polynomial 17";
50.158 (*SPO*)
50.159 val t = str2term "a^^^2*b*b^^^(-1)";
50.160 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.161 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.162 if term2str t = "a ^^^ 2" then ()
50.163 else raise error "poly.sml: diff.behav. in make_polynomial 18";
50.164 (*SPO*)
50.165 val t = str2term "a^^^2*a^^^(-2)";
50.166 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.167 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.168 if (term2str t) = "1" then ()
50.169 else raise error "poly.sml: diff.behav. in make_polynomial 19";
50.170 (*SPO*)
50.171 val t = str2term "b + a - b";
50.172 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.173 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.174 if (term2str t) = "a" then ()
50.175 else raise error "poly.sml: diff.behav. in make_polynomial 20";
50.176 (*SPO*)
50.177 val t = str2term "b * a * a";
50.178 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.179 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.180 if term2str t = "a ^^^ 2 * b" then ()
50.181 else raise error "poly.sml: diff.behav. in make_polynomial 21";
50.182 (*SPO*)
50.183 val t = str2term "(a^^^2)^^^3";
50.184 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.185 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.186 if term2str t = "a ^^^ 6" then ()
50.187 else raise error "poly.sml: diff.behav. in make_polynomial 22";
50.188 (*SPO*)
50.189 val t = str2term "x^^^2 * y^^^2 + x * x^^^2 * y";
50.190 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.191 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.192 if term2str t = "x ^^^ 3 * y + x ^^^ 2 * y ^^^ 2" then ()
50.193 else raise error "poly.sml: diff.behav. in make_polynomial 23";
50.194 (*SPO*)
50.195 val t = (term_of o the o (parse thy)) "a^^^2 * (-a)^^^2";
50.196 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.197 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.198 if (term2str t) = "a ^^^ 4" then ()
50.199 else raise error "poly.sml: diff.behav. in make_polynomial 24";
50.200 (*SPO*)
50.201 val t = str2term "a * b * b^^^(-1) + a";
50.202 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.203 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.204 if (term2str t) = "2 * a" then ()
50.205 else raise error "poly.sml: diff.behav. in make_polynomial 25";
50.206 (*SPO*)
50.207 val t = str2term "a*c*b^^^(2*n) + 3*a + 5*b^^^(2*n)*c*b";
50.208 -val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.209 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
50.210 if (term2str t) = "3 * a + 5 * b ^^^ (1 + 2 * n) * c + a * b ^^^ (2 * n) * c"
50.211 then () else raise error "poly.sml: diff.behav. in make_polynomial 26";
50.212
50.213 @@ -274,12 +274,12 @@
50.214 (*MG.27.6.03 -------------vvv-: Verschachtelte Terme -----------*)
50.215 (*SPO*)
50.216 val t = str2term "(1 + (x*y*a) + x)^^^(1 + (x*y*a) + x)";
50.217 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.218 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.219 term2str t;
50.220 if term2str t = "(1 + x + a * x * y) ^^^ (1 + x + a * x * y)"
50.221 then () else raise error "poly.sml: diff.behav. in make_polynomial 27";(*SPO*)
50.222 val t = str2term "(1 + x*(y*z)*zz)^^^(1 + x*(y*z)*zz)";
50.223 - val Some (t,_) = rewrite_set_ thy false make_polynomial t;
50.224 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
50.225 term2str t;
50.226 if term2str t = "(1 + x * y * z * zz) ^^^ (1 + x * y * z * zz)"
50.227 then () else raise error "poly.sml: diff.behav. in make_polynomial 28";
50.228 @@ -327,7 +327,7 @@
50.229 val t = str2term "((5*x^^^2 + 3) * (2*x^^^7 + 3) \
50.230 \- (3*x^^^5 + 8) * (6*x^^^4 - 1)) is_polyexp";
50.231 trace_rewrite:=true;
50.232 -val Some (t',_) = rewrite_set_ thy false prls t;
50.233 +val SOME (t',_) = rewrite_set_ thy false prls t;
50.234 trace_rewrite:=false;
50.235 if t' = HOLogic.true_const then ()
50.236 else raise error "poly.sml: diff.behav. in check pbl 'polynomial..";
50.237 @@ -397,7 +397,7 @@
50.238 "-------- norm_Poly NOT COMPLETE ---------------------------------";
50.239 "-------- norm_Poly NOT COMPLETE ---------------------------------";
50.240 trace_rewrite:=true;
50.241 -val Some (f',_) = rewrite_set_ thy false norm_Poly
50.242 +val SOME (f',_) = rewrite_set_ thy false norm_Poly
50.243 (str2term "L = k - 2 * q + (k - 2 * q) + (k - 2 * q) + (k - 2 * q) + senkrecht + oben")(*see poly.sml: -- norm_Poly NOT COMPLETE -- TODO MG*);
50.244 trace_rewrite:=false;
50.245 term2str f';
50.246 @@ -413,7 +413,7 @@
50.247
50.248 (*WN071202: ^^^ why then is there no rewriting ...*)
50.249 val term = str2term "2*b + (3*a + 3*b)";
50.250 -val None = rewrite_set_ Isac.thy false order_add_mult term;
50.251 +val NONE = rewrite_set_ Isac.thy false order_add_mult term;
50.252
50.253 (*or why is there no rewriting this way...*)
50.254 val t1 = str2term "2 * b + (3 * a + 3 * b)";
51.1 --- a/test/Tools/isac/IsacKnowledge/polyeq.sml Wed Aug 18 13:53:15 2010 +0200
51.2 +++ b/test/Tools/isac/IsacKnowledge/polyeq.sml Wed Aug 18 13:55:23 2010 +0200
51.3 @@ -39,60 +39,60 @@
51.4 trace_rewrite:=false;
51.5 *)
51.6 val t1 = (term_of o the o (parse thy)) "lhs (-8 - 2*x + x^^^2 = 0)";
51.7 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t1;
51.8 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t1;
51.9 if ((term2str t) = "-8 - 2 * x + x ^^^ 2") then ()
51.10 else raise error "polyeq.sml: diff.behav. in lhs";
51.11
51.12
51.13 val t2 = (term_of o the o (parse thy)) "(-8 - 2*x + x^^^2) is_expanded_in x";
51.14 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t2;
51.15 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t2;
51.16 if (term2str t) = "True" then ()
51.17 else raise error "polyeq.sml: diff.behav. 1 in is_expended_in";
51.18
51.19 val t0 = (term_of o the o (parse thy)) "(sqrt(x)) is_poly_in x";
51.20 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t0;
51.21 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t0;
51.22 if (term2str t) = "False" then ()
51.23 else raise error "polyeq.sml: diff.behav. 2 in is_poly_in";
51.24
51.25
51.26 val t3 = (term_of o the o (parse thy)) "(-8 + (-1)*2*x + x^^^2) is_poly_in x";
51.27 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t3;
51.28 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t3;
51.29 if (term2str t) = "True" then ()
51.30 else raise error "polyeq.sml: diff.behav. 3 in is_poly_in";
51.31
51.32
51.33 val t4 = (term_of o the o (parse thy)) "(lhs (-8 + (-1)*2*x + x^^^2 = 0)) is_expanded_in x";
51.34 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t4;
51.35 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t4;
51.36 if (term2str t) = "True" then ()
51.37 else raise error "polyeq.sml: diff.behav. 4 in is_expended_in";
51.38
51.39
51.40 val t6 = (term_of o the o (parse thy)) "(lhs (-8 - 2*x + x^^^2 = 0)) is_expanded_in x";
51.41 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t6;
51.42 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t6;
51.43 if (term2str t) = "True" then ()
51.44 else raise error "polyeq.sml: diff.behav. 5 in is_expended_in";
51.45
51.46 val t3 = (term_of o the o (parse thy))"((-8 - 2*x + x^^^2) has_degree_in x) = 2";
51.47 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t3;
51.48 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t3;
51.49 if (term2str t) = "True" then ()
51.50 else raise error "polyeq.sml: diff.behav. in has_degree_in_in";
51.51
51.52
51.53 val t3 = (term_of o the o (parse thy)) "((sqrt(x)) has_degree_in x) = 2";
51.54 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t3;
51.55 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t3;
51.56 if (term2str t) = "False" then ()
51.57 else raise error "polyeq.sml: diff.behav. 6 in has_degree_in_in";
51.58
51.59 val t4 = (term_of o the o (parse thy))
51.60 "((-8 - 2*x + x^^^2) has_degree_in x) = 1";
51.61 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t4;
51.62 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t4;
51.63 if (term2str t) = "False" then ()
51.64 else raise error "polyeq.sml: diff.behav. 7 in has_degree_in_in";
51.65
51.66
51.67 val t5 = (term_of o the o (parse thy))
51.68 "((-8 - 2*x + x^^^2) has_degree_in x) = 2";
51.69 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t5;
51.70 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_prls t5;
51.71 if (term2str t) = "True" then ()
51.72 else raise error "polyeq.sml: diff.behav. 8 in has_degree_in_in";
51.73
51.74 @@ -846,7 +846,7 @@
51.75 "-------------------- (3 - 10*x + 3*x^^^2 = 0), ----------------------";
51.76 "---- test the erls ----";
51.77 val t1 = (term_of o the o (parse thy)) "0 <= (10/3/2)^^^2 - 1";
51.78 - val Some (t,_) = rewrite_set_ PolyEq.thy false PolyEq_erls t1;
51.79 + val SOME (t,_) = rewrite_set_ PolyEq.thy false PolyEq_erls t1;
51.80 val t' = term2str t;
51.81 (*if t'= "True" then ()
51.82 else raise error "polyeq.sml: diff.behav. in 'rewrite_set_.. PolyEq_erls";*)
51.83 @@ -1129,31 +1129,31 @@
51.84 (*WN.19.3.03 ---v-*)
51.85 (*3(b)*)val (bdv,v) = (str2term "bdv", str2term "R1");
51.86 val t = str2term "-1 * (R * R2) + R2 * R1 + -1 * (R * R1) = 0";
51.87 -val Some (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.88 +val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.89 term2str t';
51.90 "-1 * R * R2 + (R2 + -1 * R) * R1 = 0";
51.91 (*WN.19.3.03 ---^-*)
51.92
51.93 (*3(c)*)val (bdv,v) = (str2term "bdv", str2term "p");
51.94 val t = str2term "y ^^^ 2 + -2 * (x * p) = 0";
51.95 -val Some (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.96 +val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.97 term2str t';
51.98 "y ^^^ 2 + -2 * x * p = 0";
51.99
51.100 (*3(d)*)val (bdv,v) = (str2term "bdv", str2term "x2");
51.101 val t = str2term
51.102 "A + x1 * (y3 * (1 / 2)) + x3 * (y2 * (1 / 2)) + -1 * (x1 * (y2 * (1 / 2))) + -1 * (x3 * (y1 * (1 / 2 ))) + y1 * (1 / 2 * x2) + -1 * (y3 * (1 / 2 * x2)) = 0";
51.103 -val Some (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.104 +val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.105 term2str t';
51.106 "A + x1 * y3 * (1 / 2) + x3 * y2 * (1 / 2) + - x1 * y2 * (1 / 2) + - x3 * y1 * (1 / 2) + (y1 * (1 / 2) + - y3 * (1 / 2)) * x2 = 0";
51.107 -val Some (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_ratpoly_in t;
51.108 +val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,v)] make_ratpoly_in t;
51.109 term2str t';
51.110 "A + x1 * y3 * (1 / 2) + x3 * y2 * (1 / 2) + -1 * x1 * y2 * (1 / 2) + -1 * x3 * y1 * (1 / 2) + (y1 * (1 / 2) + -1 * y3 * (1 / 2)) * x2 = 0";
51.111
51.112 (*3(e)*)val (bdv,v) = (str2term "bdv", str2term "a");
51.113 val t = str2term
51.114 "A ^^^ 2 + c ^^^ 2 * (c / d) ^^^ 2 + (-4 * (c / d) ^^^ 2) * a ^^^ 2 = 0";
51.115 -val None = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.116 +val NONE = rewrite_set_inst_ thy false [(bdv,v)] make_polynomial_in t;
51.117 (*die _unsichtbare_ Klammern sind genau wie gew"unscht*)
51.118
51.119
52.1 --- a/test/Tools/isac/IsacKnowledge/polyminus.sml Wed Aug 18 13:53:15 2010 +0200
52.2 +++ b/test/Tools/isac/IsacKnowledge/polyminus.sml Wed Aug 18 13:55:23 2010 +0200
52.3 @@ -35,31 +35,31 @@
52.4 "----------- fun eval_ist_monom ----------------------------------";
52.5 ist_monom (str2term "12");
52.6 case eval_ist_monom 0 0 (str2term "12 ist_monom") 0 of
52.7 - Some ("12 ist_monom = True", _) => ()
52.8 + SOME ("12 ist_monom = True", _) => ()
52.9 | _ => raise error "polyminus.sml: 12 ist_monom = True";
52.10
52.11 case eval_ist_monom 0 0 (str2term "a ist_monom") 0 of
52.12 - Some ("a ist_monom = True", _) => ()
52.13 + SOME ("a ist_monom = True", _) => ()
52.14 | _ => raise error "polyminus.sml: a ist_monom = True";
52.15
52.16 case eval_ist_monom 0 0 (str2term "(3*a) ist_monom") 0 of
52.17 - Some ("3 * a ist_monom = True", _) => ()
52.18 + SOME ("3 * a ist_monom = True", _) => ()
52.19 | _ => raise error "polyminus.sml: 3 * a ist_monom = True";
52.20
52.21 case eval_ist_monom 0 0 (str2term "(a^^^2) ist_monom") 0 of
52.22 - Some ("a ^^^ 2 ist_monom = True", _) => ()
52.23 + SOME ("a ^^^ 2 ist_monom = True", _) => ()
52.24 | _ => raise error "polyminus.sml: a^^^2 ist_monom = True";
52.25
52.26 case eval_ist_monom 0 0 (str2term "(3*a^^^2) ist_monom") 0 of
52.27 - Some ("3 * a ^^^ 2 ist_monom = True", _) => ()
52.28 + SOME ("3 * a ^^^ 2 ist_monom = True", _) => ()
52.29 | _ => raise error "polyminus.sml: 3*a^^^2 ist_monom = True";
52.30
52.31 case eval_ist_monom 0 0 (str2term "(a*b) ist_monom") 0 of
52.32 - Some ("a * b ist_monom = True", _) => ()
52.33 + SOME ("a * b ist_monom = True", _) => ()
52.34 | _ => raise error "polyminus.sml: a*b ist_monom = True";
52.35
52.36 case eval_ist_monom 0 0 (str2term "(3*a*b) ist_monom") 0 of
52.37 - Some ("3 * a * b ist_monom = True", _) => ()
52.38 + SOME ("3 * a * b ist_monom = True", _) => ()
52.39 | _ => raise error "polyminus.sml: 3*a*b ist_monom = True";
52.40
52.41
52.42 @@ -70,7 +70,7 @@
52.43 trace_rewrite:=true;
52.44 trace_rewrite:=false;
52.45 val t = str2term "((a + d) + c) + b";
52.46 -val Some (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
52.47 +val SOME (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
52.48 if term2str t = "a + (b + (c + d))" then ()
52.49 else raise error "polyminus.sml 1 watch order_add_mult";
52.50 trace_rewrite:=false;
52.51 @@ -79,13 +79,13 @@
52.52 val od = ord_make_polynomial true Poly.thy;
52.53 val t = str2term "((a + d) + c) + b";
52.54 "((a + d) + c) + b";
52.55 -val Some (t,_) = rewrite_ thy od e_rls true real_add_commute t; term2str t;
52.56 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_commute t; term2str t;
52.57 "b + ((a + d) + c)";
52.58 -val Some (t,_) = rewrite_ thy od e_rls true real_add_commute t; term2str t;
52.59 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_commute t; term2str t;
52.60 "b + (c + (a + d))";
52.61 -val Some (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.62 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.63 "b + (a + (c + d))";
52.64 -val Some (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.65 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.66 "a + (b + (c + d))";
52.67 if term2str t = "a + (b + (c + d))" then ()
52.68 else raise error "polyminus.sml 2 watch order_add_mult";
52.69 @@ -93,25 +93,25 @@
52.70 "----- if parentheses are right, left_commute is (almost) sufficient...";
52.71 val t = str2term "a + (d + (c + b))";
52.72 "a + (d + (c + b))";
52.73 -val Some (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.74 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.75 "a + (c + (d + b))";
52.76 -val Some (t,_) = rewrite_ thy od e_rls true real_add_commute t;term2str t;
52.77 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_commute t;term2str t;
52.78 "a + (c + (b + d))";
52.79 -val Some (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.80 +val SOME (t,_) = rewrite_ thy od e_rls true real_add_left_commute t;term2str t;
52.81 "a + (b + (c + d))";
52.82
52.83 "----- but we do not want the parentheses at right; thus: cond.rew.";
52.84 "WN0712707 complicated monomials do not yet work ...";
52.85 val t = str2term "((5*a + 4*d) + 3*c) + 2*b";
52.86 -val Some (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
52.87 +val SOME (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
52.88 if term2str t = "2 * b + (3 * c + (4 * d + 5 * a))" then ()
52.89 else raise error "polyminus.sml: order_add_mult changed";
52.90
52.91 "----- here we see rew_sub going into subterm with ord.rew....";
52.92 val od = ord_make_polynomial false Poly.thy;
52.93 val t = str2term "b + a + c + d";
52.94 -val Some (t,_) = rewrite_ thy od e_rls false real_add_commute t; term2str t;
52.95 -val Some (t,_) = rewrite_ thy od e_rls false real_add_commute t; term2str t;
52.96 +val SOME (t,_) = rewrite_ thy od e_rls false real_add_commute t; term2str t;
52.97 +val SOME (t,_) = rewrite_ thy od e_rls false real_add_commute t; term2str t;
52.98 (*@@@ rew_sub gosub: t = d + (b + a + c)
52.99 @@@ rew_sub begin: t = b + a + c*)
52.100
52.101 @@ -129,31 +129,31 @@
52.102 str2term "222 * aaa";
52.103 (*
52.104 case eval_kleiner 0 0 (str2term "123 kleiner 32") 0 of
52.105 - Some ("12 kleiner 9 = False", _) => ()
52.106 + SOME ("12 kleiner 9 = False", _) => ()
52.107 | _ => raise error "polyminus.sml: 12 kleiner 9 = False";
52.108 *)
52.109 case eval_kleiner 0 0 (str2term "a kleiner b") 0 of
52.110 - Some ("a kleiner b = True", _) => ()
52.111 + SOME ("a kleiner b = True", _) => ()
52.112 | _ => raise error "polyminus.sml: a kleiner b = True";
52.113
52.114 case eval_kleiner 0 0 (str2term "(10*g) kleiner f") 0 of
52.115 - Some ("10 * g kleiner f = False", _) => ()
52.116 + SOME ("10 * g kleiner f = False", _) => ()
52.117 | _ => raise error "polyminus.sml: 10 * g kleiner f = False";
52.118
52.119 case eval_kleiner 0 0 (str2term "(a^^^2) kleiner b") 0 of
52.120 - Some ("a ^^^ 2 kleiner b = True", _) => ()
52.121 + SOME ("a ^^^ 2 kleiner b = True", _) => ()
52.122 | _ => raise error "polyminus.sml: a ^^^ 2 kleiner b = True";
52.123
52.124 case eval_kleiner 0 0 (str2term "(3*a^^^2) kleiner b") 0 of
52.125 - Some ("3 * a ^^^ 2 kleiner b = True", _) => ()
52.126 + SOME ("3 * a ^^^ 2 kleiner b = True", _) => ()
52.127 | _ => raise error "polyminus.sml: 3 * a ^^^ 2 kleiner b = True";
52.128
52.129 case eval_kleiner 0 0 (str2term "(a*b) kleiner c") 0 of
52.130 - Some ("a * b kleiner c = True", _) => ()
52.131 + SOME ("a * b kleiner c = True", _) => ()
52.132 | _ => raise error "polyminus.sml: a * b kleiner b = True";
52.133
52.134 case eval_kleiner 0 0 (str2term "(3*a*b) kleiner c") 0 of
52.135 - Some ("3 * a * b kleiner c = True", _) => ()
52.136 + SOME ("3 * a * b kleiner c = True", _) => ()
52.137 | _ => raise error "polyminus.sml: 3 * a * b kleiner b = True";
52.138
52.139
52.140 @@ -163,53 +163,53 @@
52.141
52.142 val erls = erls_ordne_alphabetisch;
52.143 val t = str2term "b + a";
52.144 -val Some (t,_) = rewrite_ thy od erls false tausche_plus t; term2str t;
52.145 +val SOME (t,_) = rewrite_ thy od erls false tausche_plus t; term2str t;
52.146 if term2str t = "a + b" then ()
52.147 else raise error "polyminus.sml: ordne_alphabetisch1 b + a";
52.148
52.149 val erls = Atools_erls;
52.150 val t = str2term "2*a + 3*a";
52.151 -val Some (t,_) = rewrite_ thy od erls false real_num_collect t; term2str t;
52.152 +val SOME (t,_) = rewrite_ thy od erls false real_num_collect t; term2str t;
52.153
52.154 "----- test rewrite_, rewrite_set_";
52.155 trace_rewrite:=true;
52.156 val erls = erls_ordne_alphabetisch;
52.157 val t = str2term "b + a";
52.158 -val Some (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.159 +val SOME (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.160 if term2str t = "a + b" then ()
52.161 else raise error "polyminus.sml: ordne_alphabetisch a + b";
52.162
52.163 val t = str2term "2*b + a";
52.164 -val Some (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.165 +val SOME (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.166 if term2str t = "a + 2 * b" then ()
52.167 else raise error "polyminus.sml: ordne_alphabetisch a + 2 * b";
52.168
52.169 val t = str2term "a + c + b";
52.170 -val Some (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.171 +val SOME (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.172 if term2str t = "a + b + c" then ()
52.173 else raise error "polyminus.sml: ordne_alphabetisch a + b + c";
52.174
52.175 "----- rewrite goes into subterms";
52.176 val t = str2term "a + c + b + d";
52.177 -val Some (t,_) = rewrite_ thy od erls false tausche_plus_plus t; term2str t;
52.178 +val SOME (t,_) = rewrite_ thy od erls false tausche_plus_plus t; term2str t;
52.179 if term2str t = "a + b + c + d" then ()
52.180 else raise error "polyminus.sml: ordne_alphabetisch1 a + b + c + d";
52.181
52.182 val t = str2term "a + c + d + b";
52.183 -val Some (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.184 +val SOME (t,_) = rewrite_set_ thy false ordne_alphabetisch t; term2str t;
52.185 if term2str t = "a + b + c + d" then ()
52.186 else raise error "polyminus.sml: ordne_alphabetisch2 a + b + c + d";
52.187
52.188 "----- here we see rew_sub going into subterm with cond.rew....";
52.189 val t = str2term "b + a + c + d";
52.190 -val Some (t,_) = rewrite_ thy od erls false tausche_plus t; term2str t;
52.191 +val SOME (t,_) = rewrite_ thy od erls false tausche_plus t; term2str t;
52.192 if term2str t = "a + b + c + d" then ()
52.193 else raise error "polyminus.sml: ordne_alphabetisch3 a + b + c + d";
52.194
52.195 "----- compile rls for the most complicated terms";
52.196 val t = str2term "5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12";
52.197 "5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * g + 12";
52.198 -val Some (t,_) = rewrite_set_ thy false ordne_alphabetisch t;
52.199 +val SOME (t,_) = rewrite_set_ thy false ordne_alphabetisch t;
52.200 if term2str t = "- 9 + 12 + 5 * e - 7 * e + 6 * f - 4 * f - 8 * g + 10 * g"
52.201 then () else raise error "polyminus.sml: ordne_alphabetisch finished";
52.202
52.203 @@ -218,7 +218,7 @@
52.204 "----------- build fasse_zusammen --------------------------------";
52.205 "----------- build fasse_zusammen --------------------------------";
52.206 val t = str2term "- 9 + 12 + 5 * e - 7 * e + 6 * f - 4 * f - 8 * g + 10 * g";
52.207 -val Some (t,_) = rewrite_set_ thy false fasse_zusammen t;
52.208 +val SOME (t,_) = rewrite_set_ thy false fasse_zusammen t;
52.209 if term2str t = "3 + -2 * e + 2 * f + 2 * g" then ()
52.210 else raise error "polyminus.sml: fasse_zusammen finished";
52.211
52.212 @@ -226,7 +226,7 @@
52.213 "----------- build verschoenere ----------------------------------";
52.214 "----------- build verschoenere ----------------------------------";
52.215 val t = str2term "3 + -2 * e + 2 * f + 2 * g";
52.216 -val Some (t,_) = rewrite_set_ thy false verschoenere t;
52.217 +val SOME (t,_) = rewrite_set_ thy false verschoenere t;
52.218 if term2str t = "3 - 2 * e + 2 * f + 2 * g" then ()
52.219 else raise error "polyminus.sml: verschoenere 3 + -2 * e ...";
52.220
52.221 @@ -406,16 +406,16 @@
52.222 trace_rewrite := true;
52.223 val erls = erls_ordne_alphabetisch;
52.224 val t = str2term "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
52.225 -val Some (t',_) =
52.226 +val SOME (t',_) =
52.227 rewrite_ Isac.thy e_rew_ord erls false tausche_minus t;
52.228 term2str t'; "- 9 + 12 + 5 * e - 7 * e + (- 4 + 6) * f - 8 * g + 10 * g";
52.229
52.230 val t = str2term "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
52.231 -val None =
52.232 +val NONE =
52.233 rewrite_ Isac.thy e_rew_ord erls false tausche_minus_plus t;
52.234
52.235 val t = str2term "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
52.236 -val Some (t',_) =
52.237 +val SOME (t',_) =
52.238 rewrite_set_ Isac.thy false ordne_alphabetisch t;
52.239 term2str t'; "- 9 + 12 + 5 * e - 7 * e - 8 * g + 10 * g + (- 4 + 6) * f";
52.240 trace_rewrite := false;
52.241 @@ -476,31 +476,31 @@
52.242 "----------- pbl binom polynom vereinfachen p.39 -----------------";
52.243 val rls = klammern_ausmultiplizieren;
52.244 val t = str2term "(3 * a + 2) * (4 * a - 1)";
52.245 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.246 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.247 "3 * a * (4 * a) - 3 * a * 1 + (2 * (4 * a) - 2 * 1)";
52.248 val rls = discard_parentheses;
52.249 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.250 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.251 "3 * a * 4 * a - 3 * a * 1 + (2 * 4 * a - 2 * 1)";
52.252 val rls = ordne_monome;
52.253 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.254 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.255 "3 * 4 * a * a - 1 * 3 * a + (2 * 4 * a - 1 * 2)";
52.256 (*
52.257 val t = str2term "3 * a * 4 * a";
52.258 val rls = ordne_monome;
52.259 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.260 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.261 *)
52.262 val rls = klammern_aufloesen;
52.263 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.264 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.265 "3 * 4 * a * a - 1 * 3 * a + 2 * 4 * a - 1 * 2";
52.266 val rls = ordne_alphabetisch;
52.267 (*TODO: make is_monom more general, a*a=a^2, ...*)
52.268 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.269 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.270 "3 * 4 * a * a - 1 * 2 - 1 * 3 * a + 2 * 4 * a";
52.271 (*GOON.WN080104
52.272 val rls = fasse_zusammen;
52.273 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.274 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.275 val rls = verschoenere;
52.276 -val Some (t,_) = rewrite_set_ thy false rls t; term2str t;
52.277 +val SOME (t,_) = rewrite_set_ thy false rls t; term2str t;
52.278 *)
52.279
52.280
52.281 @@ -553,7 +553,7 @@
52.282 \3 * (a - 2 * q))";
52.283 val ma = eval_matchsub "" "Tools.matchsub" t thy;
52.284 case ma of
52.285 - Some ("matchsub (?a * (?b - ?c)) (8 * (a - q) + \
52.286 + SOME ("matchsub (?a * (?b - ?c)) (8 * (a - q) + \
52.287 \a - 2 * q + 3 * (a - 2 * q)) = True", _) => ()
52.288 | _ => raise error "polyminus.sml matchsub (?a * (?b - ?c)...A";
52.289
52.290 @@ -570,7 +570,7 @@
52.291 Thm ("not_false",num_str not_false)
52.292 (*"(~ False) = True"*)];
52.293 trace_rewrite := true;
52.294 -val Some (t', _) = rewrite_set_ thy false prls t;
52.295 +val SOME (t', _) = rewrite_set_ thy false prls t;
52.296 trace_rewrite := false;
52.297
52.298 "--- does the respective prls rewrite the whole predicate ?";
52.299 @@ -580,7 +580,7 @@
52.300 \ matchsub ((?b + ?c) * ?a) (8 * (a - q) + a - 2 * q) | \
52.301 \ matchsub ((?b - ?c) * ?a) (8 * (a - q) + a - 2 * q) )";
52.302 trace_rewrite := true;
52.303 -val Some (t', _) = rewrite_set_ thy false prls t;
52.304 +val SOME (t', _) = rewrite_set_ thy false prls t;
52.305 trace_rewrite := false;
52.306 if term2str t' = "False" then ()
52.307 else raise error "polyminus.sml Not (matchsub (?a * (?b + ?c)) (8 ...";
53.1 --- a/test/Tools/isac/IsacKnowledge/rateq.sml Wed Aug 18 13:53:15 2010 +0200
53.2 +++ b/test/Tools/isac/IsacKnowledge/rateq.sml Wed Aug 18 13:55:23 2010 +0200
53.3 @@ -12,22 +12,22 @@
53.4 "--------- S.68, Bsp.: 40, ((x)/(x - 8) + (x - 8)/(x) = 26/5)---------------------";
53.5
53.6 val t = (term_of o the o (parse RatEq.thy)) "(1/b+1/x=1) is_ratequation_in x";
53.7 -val Some(t_, _) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.8 +val SOME(t_, _) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.9 val result = term2str t_;
53.10 if result <> "True" then raise error "rateq.sml: new behaviour 1:" else ();
53.11
53.12 val t = (term_of o the o (parse RatEq.thy)) "(sqrt(x)=1) is_ratequation_in x";
53.13 -val Some(t_, _) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.14 +val SOME(t_, _) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.15 val result = term2str t_;
53.16 if result <> "False" then raise error "rateq.sml: new behaviour 2:" else ();
53.17
53.18 val t = (term_of o the o (parse RatEq.thy)) "(x=-1) is_ratequation_in x";
53.19 -val Some(t_,_) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.20 +val SOME(t_,_) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.21 val result = term2str t_;
53.22 if result <> "False" then raise error "rateq.sml: new behaviour 3:" else ();
53.23
53.24 val t = (term_of o the o (parse RatEq.thy)) "(3 + x^^^2 + 1/(x^^^2+3)=1) is_ratequation_in x";
53.25 -val Some(t_,_) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.26 +val SOME(t_,_) = rewrite_set_ RatEq.thy false RatEq_prls t;
53.27 val result = term2str t_;
53.28 if result <> "True" then raise error "rateq.sml: new behaviour 4:" else ();
53.29
54.1 --- a/test/Tools/isac/IsacKnowledge/rational-old.sml Wed Aug 18 13:53:15 2010 +0200
54.2 +++ b/test/Tools/isac/IsacKnowledge/rational-old.sml Wed Aug 18 13:55:23 2010 +0200
54.3 @@ -309,7 +309,7 @@
54.4 print("a)\n");
54.5 val e188a'="(8 * x + -8) / (9 * x + -9 )";
54.6 val e188a = the (rewrite_set thy' "rational_erls" false rls' e188a');
54.7 -val Some (t,_) = rewrite_set thy' "rational_erls" false mp "(8*((-1) + x))/(9*((-1) + x))";
54.8 +val SOME (t,_) = rewrite_set thy' "rational_erls" false mp "(8*((-1) + x))/(9*((-1) + x))";
54.9 if t="((-8) + 8 * x) / ((-9) + 9 * x)"then()
54.10 else raise error "rationals.sml: e188a new behaviour";
54.11 print("b)\n");
54.12 @@ -318,7 +318,7 @@
54.13 print("c)\n");
54.14 val e188c'="( a + -1 * b ) / ( b + -1 * a )";
54.15 val e188c = the (rewrite_set thy' "rational_erls" false rls' e188c');
54.16 -val Some (t,_) = rewrite_set thy' "rational_erls" false mp "((-1)*(b + (-1) * a))/(1*(b + (-1) * a))";
54.17 +val SOME (t,_) = rewrite_set thy' "rational_erls" false mp "((-1)*(b + (-1) * a))/(1*(b + (-1) * a))";
54.18 if t="(a + -1 * b) / (b + -1 * a)"then()
54.19 else raise error "rationals.sml: e188c new behaviour";
54.20
54.21 @@ -326,7 +326,7 @@
54.22 print("c)\n");
54.23 val e190c'="( 27 * a^^^3 + 9 * a^^^2 + 3 * a + 1 ) / ( 27 * a^^^3 + 18 * a^^^2 + 3 * a )";
54.24 val e190c = the (rewrite_set thy' "rational_erls" false rls' e190c');
54.25 -val Some (t,_) = rewrite_set thy' "rational_erls" false mp "((1 + 9 * a ^^^ 2)*(1 + 3 * a))/((3 * a + 9 * a ^^^ 2)*(1 + 3 * a))";
54.26 +val SOME (t,_) = rewrite_set thy' "rational_erls" false mp "((1 + 9 * a ^^^ 2)*(1 + 3 * a))/((3 * a + 9 * a ^^^ 2)*(1 + 3 * a))";
54.27 if t="(1 + (3 * a + (27 * a ^^^ 3 + 9 * a ^^^ 2))) /\n(3 * a + (18 * a ^^^ 2 + 27 * a ^^^ 3))"then()
54.28 (*TERMORDER ~~~~~~~ ~~~~~~~*)
54.29 else raise error "rationals.sml: e190c new behaviour";
54.30 @@ -335,13 +335,13 @@
54.31 print("a)\n");
54.32 val e191a'="( x^^^2 + -1 * y^^^2 ) / ( x + y )";
54.33 val e191a = the (rewrite_set thy' "rational_erls" false rls' e191a');
54.34 -val Some (t,_) = rewrite_set thy' "rational_erls" false mp "((x + (-1) * y)*(x + y))/((1)*(x + y))";
54.35 +val SOME (t,_) = rewrite_set thy' "rational_erls" false mp "((x + (-1) * y)*(x + y))/((1)*(x + y))";
54.36 if t="(x ^^^ 2 + -1 * y ^^^ 2) / (x + y)"then()
54.37 else raise error "rationals.sml: e191a new behaviour";
54.38 print("c)\n");
54.39 val e191c'="( 9 * x^^^2 + -30 * x + 25 ) / ( 9 * x^^^2 + -25 )";
54.40 val e191c = the (rewrite_set thy' "rational_erls" false rls' e191c');
54.41 -val Some (t,_) = rewrite_set thy' "rational_erls" false mp "(((-5) + 3 * x)*((-5) + 3 * x))/((5 + 3 * x)*((-5) + 3 * x))";
54.42 +val SOME (t,_) = rewrite_set thy' "rational_erls" false mp "(((-5) + 3 * x)*((-5) + 3 * x))/((5 + 3 * x)*((-5) + 3 * x))";
54.43 if t="(25 + ((-30) * x + 9 * x ^^^ 2)) / ((-25) + 9 * x ^^^ 2)"then()
54.44 else raise error "rationals.sml: 'e191c' new behaviour";
54.45
54.46 @@ -349,7 +349,7 @@
54.47 print("b)\n");
54.48 val e192b'="( 7 * x^^^3 + -1 * x^^^2 * y ) / ( 7 * x * y^^^2 + -1 * y^^^3 )";
54.49 val e192b = the (rewrite_set thy' "rational_erls" false rls' e192b');
54.50 -val Some (t,_) = rewrite_set thy' "rational_erls" false mp "((x ^^^ 2)*(7 * x + (-1) * y))/((y ^^^ 2)*(7 * x + (-1) * y))";
54.51 +val SOME (t,_) = rewrite_set thy' "rational_erls" false mp "((x ^^^ 2)*(7 * x + (-1) * y))/((y ^^^ 2)*(7 * x + (-1) * y))";
54.52 if t="(7 * x ^^^ 3 + -1 * (y * x ^^^ 2)) / (-1 * y ^^^ 3 + 7 * (x * y ^^^ 2))"then()
54.53 (*TERMORDER ~~~~~*)
54.54 else raise error "rationals.sml: 'e192b' new behaviour";
54.55 @@ -363,7 +363,7 @@
54.56 val e193b = the (rewrite_set thy' "rational_erls" false rls' e193b');
54.57 print("c)\n");
54.58 val e193c'="( 2 * x + -50 * x^^^3 ) / ( 25 * x^^^2 + -10 * x + 1 )";
54.59 -val Some(t,_) = rewrite_set thy' "rational_erls" false rls' e193c';
54.60 +val SOME(t,_) = rewrite_set thy' "rational_erls" false rls' e193c';
54.61 --------------------------------15.10.02---*)
54.62
54.63
54.64 @@ -602,7 +602,7 @@
54.65 (*
54.66 val t = (term_of o the o (parse thy))
54.67 "(9 - x ^^^ 2) / (9 - 6 * x + x ^^^ 2)";
54.68 - val Some (t',_) = factor_expanded_ thy t;
54.69 + val SOME (t',_) = factor_expanded_ thy t;
54.70 term2str t';
54.71
54.72 "((-3) - x) * ((-3) + x) / (((-3) + x) * ((-3) + x))"
54.73 @@ -622,14 +622,14 @@
54.74 next_rule=nex,normal_form=nor,...},...} = cancel;
54.75
54.76 (*normal_form produces the result in ONE step*)
54.77 - val Some (t',_) = nor t;
54.78 + val SOME (t',_) = nor t;
54.79 term2str t';
54.80
54.81 (*initialize the interpreter state used by the 'me'*)
54.82 val (t,_,revsets,_) = ini t;
54.83
54.84 (*find the rule 'r' to apply to term 't'*)
54.85 - val Some r = nex revsets t;
54.86 + val SOME r = nex revsets t;
54.87 (*val r = Thm ("sym_#mult_2_3","6 = 2 * 3") : rule*)
54.88
54.89 (*check, if the rule 'r' applied by the user to 't' belongs to the ruleset;
54.90 @@ -641,7 +641,7 @@
54.91 "(9 - x ^^^ 2) / (3 ^^^ 2 + 6 * x + x ^^^ 2)";
54.92
54.93 (*find the next rule to apply*)
54.94 - val Some r = nex revsets t;
54.95 + val SOME r = nex revsets t;
54.96 (*val r = Thm ("sym_#power_3_2","9 = 3 ^^^ 2") : rule*)
54.97
54.98 (*check the next rule*)
54.99 @@ -650,22 +650,22 @@
54.100 "(3 ^^^ 2 - x ^^^ 2) / (3 ^^^ 2 + 6 * x + x ^^^ 2)";
54.101
54.102 (*find and check the next rules, rewrite*)
54.103 - val Some r = nex revsets t;
54.104 + val SOME r = nex revsets t;
54.105 val (r,(t,asm))::_ = loc revsets t r;
54.106 term2str t;
54.107 "(3 ^^^ 2 - x ^^^ 2) / (3 ^^^ 2 + 2 * 3 * x + x ^^^ 2)";
54.108
54.109 - val Some r = nex revsets t;
54.110 + val SOME r = nex revsets t;
54.111 val (r,(t,asm))::_ = loc revsets t r;
54.112 term2str t;
54.113 "(3 - x) * (3 + x) / (3 ^^^ 2 + 2 * 3 * x + x ^^^ 2)";
54.114
54.115 - val Some r = nex revsets t;
54.116 + val SOME r = nex revsets t;
54.117 val (r,(t,asm))::_ = loc revsets t r;
54.118 term2str t;
54.119 "(3 - x) * (3 + x) / ((3 + x) * (3 + x))";
54.120
54.121 - val Some r = nex revsets t;
54.122 + val SOME r = nex revsets t;
54.123 val (r,(t,asm))::_ = loc revsets t r;
54.124 val ss = term2str t;
54.125 if ss = "(3 - x) / (3 + x)" then ()
54.126 @@ -682,7 +682,7 @@
54.127 val Rrls {scr=Rfuns {init_state=ini,locate_rule=loc,
54.128 next_rule=nex,normal_form=nor,...},...} = cancel;
54.129 (*normal_form produces the result in ONE step*)
54.130 - val Some (t',_) = nor t;
54.131 + val SOME (t',_) = nor t;
54.132 term2str t';
54.133 (*initialize the interpreter state used by the 'me'*)
54.134 val (t,_,revsets,_) = ini t;
54.135 @@ -693,11 +693,11 @@
54.136 "sym_real_mult_1"]) rs;
54.137
54.138 10.10.02: dieser Fall terminiert nicht (make_poly enth"alt zu viele rules)
54.139 - val Some r = nex revsets t;
54.140 + val SOME r = nex revsets t;
54.141 val (r,(t,asm))::_ = loc revsets t r;
54.142 term2str t;
54.143
54.144 - val Some r = nex revsets t;
54.145 + val SOME r = nex revsets t;
54.146 val (r,(t,asm))::_ = loc revsets t r;
54.147 term2str t;
54.148
54.149 @@ -736,7 +736,7 @@
54.150 "(9 + (-1)*x^^^2) / (9 + ((-6)*x + x^^^2))";
54.151 val thm = (mk_thm thy "(-6) * x = 2 * ((-3) * x)")
54.152 handle e => print_exn e;
54.153 - val Some (t',_) = rewrite_ thy e_rew_ord e_rls false thm t;
54.154 + val SOME (t',_) = rewrite_ thy e_rew_ord e_rls false thm t;
54.155 term2str t';
54.156 ----------------------------------------------------------------------*)
54.157
54.158 @@ -745,45 +745,45 @@
54.159 (* SK: Testbeispiele --- WN kopiert Rational.ML -> rational.sml-----
54.160
54.161 val t1 = (term_of o the o (parse thy)) "((3 * x^^^2 + 6 *x + 3) / (2*x + 2))";
54.162 -val Some (t1',rest)= cancel_ thy t1;
54.163 -val Some (t1'',_)= factor_out_gcd_ thy t1;
54.164 +val SOME (t1',rest)= cancel_ thy t1;
54.165 +val SOME (t1'',_)= factor_out_gcd_ thy t1;
54.166 print(term2str t1'^" + Einschr\"ankung: "^term2str (hd(rest)));
54.167 term2str t1'';
54.168
54.169 val t1 = (term_of o the o (parse thy)) "((-3 * x^^^2 + 6 *x - 3) / (2*x - 2))";
54.170 -val Some (t1',_)= cancel_ thy t1;
54.171 -val Some (t1'',_)= factor_expanded_ thy t1;
54.172 +val SOME (t1',_)= cancel_ thy t1;
54.173 +val SOME (t1'',_)= factor_expanded_ thy t1;
54.174 term2str t1';
54.175 term2str t1'';
54.176
54.177 val t2 = (term_of o the o (parse thy)) "((x+ (-1)) / (x + 1)) + ((x + 1) / (x + (-1)))";
54.178 -val Some (t2',_) = add_fractions_ thy t2;
54.179 -val Some (t2'',_) = common_nominators_ thy t2;
54.180 +val SOME (t2',_) = add_fractions_ thy t2;
54.181 +val SOME (t2'',_) = common_nominators_ thy t2;
54.182 term2str t2';
54.183 term2str t2'';
54.184
54.185 val t2 = (term_of o the o (parse thy)) "((x - 1) / (x + 1)) + ((x + 1) / (x - 1))";
54.186 -val Some (t2',_) = add_expanded_frac_ thy t2;
54.187 -val Some (t2'',_) = common_expanded_nom_ thy t2;
54.188 +val SOME (t2',_) = add_expanded_frac_ thy t2;
54.189 +val SOME (t2'',_) = common_expanded_nom_ thy t2;
54.190 term2str t2';
54.191 term2str t2'';
54.192
54.193
54.194 val t3 = (term_of o the o (parse thy)) "((1) / (2*x + 2)) + ((1) / (2*x + (-2))) + ((1) / ( x^^^2 + (-1)))+((1) / (x^^^2 + (-2)*x + 1))";
54.195 -val Some (t3',_) = common_nominators_ thy t3;
54.196 -val Some (t3'',_) = add_fractions_ thy t3;
54.197 +val SOME (t3',_) = common_nominators_ thy t3;
54.198 +val SOME (t3'',_) = add_fractions_ thy t3;
54.199 (term2str t3');
54.200 (term2str t3'');
54.201
54.202 val t3 = (term_of o the o (parse thy)) "((1) / (2*x + 2)) + ((1) / (2*x - 2)) + ((1) / ( x^^^2 - 1))+((1) / (x^^^2 - 2 * x + 1))";
54.203 -val Some (t3',_) = common_expanded_nom_ thy t3;
54.204 -val Some (t3'',_) = add_expanded_frac_ thy t3;
54.205 +val SOME (t3',_) = common_expanded_nom_ thy t3;
54.206 +val SOME (t3'',_) = add_expanded_frac_ thy t3;
54.207 (term2str t3');
54.208 (term2str t3'');
54.209 -------------------------------*)
54.210
54.211 (*
54.212 -val Some(t4,t5) = norm_rational_ thy t3;
54.213 +val SOME(t4,t5) = norm_rational_ thy t3;
54.214 term2str t4;
54.215 term2str (hd(t5));*)
54.216
54.217 @@ -799,8 +799,8 @@
54.218 (* WN kopiert 16.10.02 Rational.ML -> rational.sml-----vvv---*)
54.219
54.220 val t=(term_of o the o (parse thy)) "(9 - x^^^2)/(9 - 6*x + x^^^2)";
54.221 - val Some (t',_) = factout_ thy t;
54.222 - val Some (t'',_) = cancel_ thy t;
54.223 + val SOME (t',_) = factout_ thy t;
54.224 + val SOME (t'',_) = cancel_ thy t;
54.225 term2str t';
54.226 term2str t'';
54.227 "(3 + x) * (3 - x) / ((3 - x) * (3 - x))";
54.228 @@ -808,8 +808,8 @@
54.229
54.230 val t=(term_of o the o(parse thy))
54.231 "(9 - x^^^2) / (9 - 6*x + x^^^2) + 1 / (3 - x)";
54.232 - val Some (t',_) = common_nominator_ thy t;
54.233 - val Some (t'',_) = add_fraction_ thy t;
54.234 + val SOME (t',_) = common_nominator_ thy t;
54.235 + val SOME (t'',_) = add_fraction_ thy t;
54.236 term2str t';
54.237 term2str t'';
54.238 "(9 - x ^^^ 2) / ((3 - x) * (3 - x)) + 1 * (3 - x) / ((3 - x) * (3 - x))";
54.239 @@ -818,8 +818,8 @@
54.240 (*WN.16.10.02 hinzugef"ugt -----vv---*)
54.241 val t=(term_of o the o(parse thy))
54.242 "(9 - x^^^2) / (9 - 6*x + x^^^2) + 1";
54.243 - val Some (t',_) = common_nominator_ thy t;
54.244 - val Some (t'',_) = add_fraction_ thy t;
54.245 + val SOME (t',_) = common_nominator_ thy t;
54.246 + val SOME (t'',_) = add_fraction_ thy t;
54.247 term2str t';
54.248 term2str t'';
54.249 "(9 - x ^^^ 2) / (9 - 6 * x + x ^^^ 2) +\
54.250 @@ -828,8 +828,8 @@
54.251
54.252 val t=(term_of o the o(parse thy))
54.253 "1 + (9 - x^^^2) / (9 - 6*x + x^^^2)";
54.254 - val Some (t',_) = common_nominator_ thy t;
54.255 - val Some (t'',_) = add_fraction_ thy t;
54.256 + val SOME (t',_) = common_nominator_ thy t;
54.257 + val SOME (t'',_) = add_fraction_ thy t;
54.258 term2str t';
54.259 term2str t'';
54.260 "1 * (9 - 6 * x + x ^^^ 2) / (9 - 6 * x + x ^^^ 2) +\
54.261 @@ -839,8 +839,8 @@
54.262
54.263 val t=(term_of o the o (parse thy))
54.264 "(y^^^2 - x^^^2)/(y^^^2 - 2*y*x + x^^^2)";
54.265 - val Some (t',_) = factout_ thy t;
54.266 - val Some (t'',_) = cancel_ thy t;
54.267 + val SOME (t',_) = factout_ thy t;
54.268 + val SOME (t'',_) = cancel_ thy t;
54.269 term2str t';
54.270 term2str t'';
54.271 "(y + x) * (y - x) / ((y - x) * (y - x))";
54.272 @@ -848,8 +848,8 @@
54.273
54.274 val t=(term_of o the o (parse thy))
54.275 "(y^^^2 - x^^^2)/(y^^^2 - 2*y*x + x^^^2) + 1 / (y - x)";
54.276 - val Some (t',_) = common_nominator_ thy t;
54.277 - val Some (t'',_) = add_fraction_ thy t;
54.278 + val SOME (t',_) = common_nominator_ thy t;
54.279 + val SOME (t'',_) = add_fraction_ thy t;
54.280 term2str t';
54.281 term2str t'';
54.282 "((-1) * x ^^^ 2 + y ^^^ 2) / (((-1) * x + y) * ((-1) * x + y)) +\
54.283 @@ -859,8 +859,8 @@
54.284
54.285 val t=(term_of o the o (parse thy))
54.286 "(x^^^2 - y^^^2)/(x^^^2 - 2*x*y + y^^^2) + 1 / (x - y)";
54.287 - val Some (t',_) = common_nominator_ thy t;
54.288 - val Some (t'',_) = add_fraction_ thy t;
54.289 + val SOME (t',_) = common_nominator_ thy t;
54.290 + val SOME (t'',_) = add_fraction_ thy t;
54.291 term2str t';
54.292 term2str t'';
54.293 "((-1) * y ^^^ 2 + x ^^^ 2) / (((-1) * y + x) * ((-1) * y + x)) +\
54.294 @@ -870,28 +870,28 @@
54.295
54.296 val t=(term_of o the o (parse thy))
54.297 "(y^^^2 - x^^^2)/(y^^^2 - 2*y*x + x^^^2)";
54.298 - val Some (t',_) = norm_expanded_rat_ thy t;
54.299 + val SOME (t',_) = norm_expanded_rat_ thy t;
54.300 term2str t';
54.301 "(y + x) / (y - x)";
54.302 -(*val Some (t'',_) = norm_rational_ thy t;
54.303 +(*val SOME (t'',_) = norm_rational_ thy t;
54.304 term2str t'';
54.305 *** RATIONALS_TERM2POLY_EXCEPTION: Invalid Polynomial
54.306 WN.16.10.02 ?!*)
54.307
54.308 val t=(term_of o the o (parse thy))
54.309 "(9 - x^^^2)/(9 - 6*x + x^^^2) + (1)/(3 + x)";
54.310 - val Some (t',_) = norm_expanded_rat_ thy t;
54.311 + val SOME (t',_) = norm_expanded_rat_ thy t;
54.312 term2str t';
54.313 "(12 + 5 * x + x ^^^ 2) / (9 - x ^^^ 2)";
54.314 -(*val Some (t'',_) = norm_rational_ thy t;
54.315 +(*val SOME (t'',_) = norm_rational_ thy t;
54.316 term2str t'';
54.317 *** RATIONALS_TERM2POLY_EXCEPTION: Invalid Polynomial
54.318 WN.16.10.02 ?!*)
54.319
54.320 val t=(term_of o the o (parse thy))
54.321 "(9 + (-1)* x^^^2)/(9 + (-1)* 6*x + x^^^2) + (1)/(3 + x)";
54.322 - val Some (t',_) = norm_expanded_rat_ thy t;
54.323 - val Some (t'',_) = norm_rational_ thy t;
54.324 + val SOME (t',_) = norm_expanded_rat_ thy t;
54.325 + val SOME (t'',_) = norm_rational_ thy t;
54.326 term2str t';
54.327 term2str t'';
54.328 "(12 + 5 * x + x ^^^ 2) / (9 - x ^^^ 2)";
55.1 --- a/test/Tools/isac/IsacKnowledge/rational.sml Wed Aug 18 13:53:15 2010 +0200
55.2 +++ b/test/Tools/isac/IsacKnowledge/rational.sml Wed Aug 18 13:55:23 2010 +0200
55.3 @@ -272,7 +272,7 @@
55.4 (*-----versuche 13.3.03-----
55.5 val t = str2term "1 - x^^^2 - 5 * x^^^5";
55.6 val vs=(((map free2str) o vars) t);
55.7 - val Some ml = expanded2poly t vs;
55.8 + val SOME ml = expanded2poly t vs;
55.9 poly2term (ml, vs);
55.10 poly2term'(rev(sort (mv_geq LEX_) (ml)),vs);
55.11 poly2term'([(~5,[5]),(~1,[2]),(1,[0])], vs);
55.12 @@ -289,16 +289,16 @@
55.13 -------versuche 13.3.03-----*)
55.14
55.15 val t = str2term "1 - x^^^2 - 5 * x^^^5";
55.16 - val Some t' = expanded2polynomial t; term2str t';
55.17 + val SOME t' = expanded2polynomial t; term2str t';
55.18 "1 + - 1 * x ^^^ 2 + - 5 * x ^^^ 5";
55.19 val t = str2term "1 - x";
55.20 - val Some t' = expanded2polynomial t; term2str t';
55.21 + val SOME t' = expanded2polynomial t; term2str t';
55.22 "1 + - 1 * x";
55.23 val t = str2term "1 + (-1) * x";
55.24 - val Some t' = expanded2polynomial t; term2str t';
55.25 + val SOME t' = expanded2polynomial t; term2str t';
55.26 "1 + - 1 * x";
55.27 val t = (term_of o the o (parse thy)) "1 + (-1) * x ^^^ 2 + (-5) * x ^^^5";
55.28 - val Some t' = polynomial2expanded t; term2str t';
55.29 + val SOME t' = polynomial2expanded t; term2str t';
55.30 "1 - x ^^^ 2 - 5 * x ^^^ 5";
55.31
55.32
55.33 @@ -307,74 +307,74 @@
55.34 " external calculating functions test ";
55.35
55.36 val t1 = (term_of o the o (parse thy)) "((3 * x^^^2 + 6 *x + 3) / (2*x + 2))";
55.37 -val Some (t1',asm)= factout_p_ thy t1;
55.38 +val SOME (t1',asm)= factout_p_ thy t1;
55.39 term2str t1'; terms2str asm;
55.40 "(3 + 3 * x) * (1 + 1 * x) / (2 * (1 + 1 * x))";
55.41 "[]";
55.42 -val Some (t1',asm)= cancel_p_ thy t1;
55.43 +val SOME (t1',asm)= cancel_p_ thy t1;
55.44 term2str t1'; terms2str asm;
55.45 "(3 + 3 * x) / 2";
55.46 "[\"1 + 1 * x ~= 0\"]";
55.47
55.48 val t = (term_of o the o (parse thy)) "((-3 * x^^^2 + 6 *x - 3) / (2*x - 2))";
55.49 -val Some (t',asm)= cancel_ thy t;
55.50 +val SOME (t',asm)= cancel_ thy t;
55.51 term2str t'; terms2str asm;
55.52 "(3 - 3 * x) / 2";
55.53 "[\"-1 + x ~= 0\"]";
55.54 -val Some (t',asm)= factout_ thy t;
55.55 +val SOME (t',asm)= factout_ thy t;
55.56 term2str t'; terms2str asm;
55.57 "(3 - 3 * x) * (-1 + x) / (2 * (-1 + x))";
55.58 "[]";
55.59
55.60 val t = str2term "((x+ (-1)) / (x + 1)) + ((x + 1) / (x + (-1)))";
55.61 -val Some (t',asm) = add_fraction_p_ thy t;
55.62 +val SOME (t',asm) = add_fraction_p_ thy t;
55.63 term2str t'; terms2str asm;
55.64 "(2 + 2 * x ^^^ 2) / (-1 + 1 * x ^^^ 2)";
55.65 "[]";
55.66 -val Some (t',asm) = common_nominator_p_ thy t;
55.67 +val SOME (t',asm) = common_nominator_p_ thy t;
55.68 term2str t'; terms2str asm;
55.69 "(-1 + 1 * x) * (-1 + 1 * x) / ((1 + 1 * x) * (-1 + 1 * x)) +\n(1 + 1 * x) * (1 + 1 * x) / ((1 + 1 * x) * (-1 + 1 * x))";
55.70 "[]";
55.71
55.72 val t = str2term "((x - 1) / (x + 1)) + ((x + 1) / (x - 1))";
55.73 -val Some (t',asm) = add_fraction_ thy t;
55.74 +val SOME (t',asm) = add_fraction_ thy t;
55.75 term2str t'; terms2str asm;
55.76 "(2 + 2 * x ^^^ 2) / (-1 + x ^^^ 2)";
55.77 "[]";
55.78 -val Some (t',asm) = common_nominator_ thy t;
55.79 +val SOME (t',asm) = common_nominator_ thy t;
55.80 term2str t'; terms2str asm;
55.81 "(-1 + x) * (-1 + x) / ((1 + x) * (-1 + x)) +\n(1 + x) * (1 + x) / ((1 + x) * (-1 + x))";
55.82 "[]";
55.83
55.84 val t = str2term "((1) / (2*x + 2)) + ((1) / (2*x + (-2))) + ((1) / ( x^^^2 + (-1)))+((1) / (x^^^2 + (-2)*x + 1))";
55.85 -val Some (t',asm) = common_nominator_p_ thy t;
55.86 +val SOME (t',asm) = common_nominator_p_ thy t;
55.87 term2str t'; terms2str asm;
55.88 "1 * (1 + -2 * x + 1 * x ^^^ 2) /\n((-1 + 1 * x) * (2 * ((-1 + 1 * x) * (1 + 1 * x)))) +\n(1 * (-1 + 1 * x ^^^ 2) /\n ((-1 + 1 * x) * (2 * ((-1 + 1 * x) * (1 + 1 * x)))) +\n (1 * (-2 + 2 * x) / ((-1 + 1 * x) * (2 * ((-1 + 1 * x) * (1 + 1 * x)))) +\n 1 * (#";
55.89 "[]";
55.90 -val Some (t',asm) = add_fraction_p_ thy t;
55.91 +val SOME (t',asm) = add_fraction_p_ thy t;
55.92 term2str t'; terms2str asm;
55.93 "1 * x / (1 + -2 * x + 1 * x ^^^ 2)";
55.94 "[\"1 + 1 * x ~= 0\"]";
55.95 -val Some(t',asm) = norm_rational_ thy t;
55.96 +val SOME(t',asm) = norm_rational_ thy t;
55.97 term2str t'; terms2str asm;
55.98 "1 * x / (1 + -2 * x + 1 * x ^^^ 2)";
55.99 "[\"1 + 1 * x ~= 0\"]";
55.100
55.101 val t3 = (term_of o the o (parse thy)) "((1) / (2*x + 2)) + ((1) / (2*x - 2)) + ((1) / ( x^^^2 - 1))+((1) / (x^^^2 - 2 * x + 1))";
55.102 -val Some (t3',_) = common_nominator_ thy t3;
55.103 -val Some (t3'',_) = add_fraction_ thy t3;
55.104 +val SOME (t3',_) = common_nominator_ thy t3;
55.105 +val SOME (t3'',_) = add_fraction_ thy t3;
55.106 (term2str t3');
55.107 (term2str t3'');
55.108
55.109 -val Some(t4,t5) = norm_expanded_rat_ thy t3;
55.110 +val SOME(t4,t5) = norm_expanded_rat_ thy t3;
55.111 term2str t4;
55.112 term2str (hd(t5));
55.113
55.114
55.115
55.116 val t=(term_of o the o (parse thy)) "(9 - x^^^2)/(9 - 6*x + x^^^2)";
55.117 - val Some (t',_) = factout_ thy t;
55.118 - val Some (t'',_) = cancel_ thy t;
55.119 + val SOME (t',_) = factout_ thy t;
55.120 + val SOME (t'',_) = cancel_ thy t;
55.121 term2str t';
55.122 term2str t'';
55.123 "(3 + x) * (3 - x) / ((3 - x) * (3 - x))";
55.124 @@ -382,8 +382,8 @@
55.125
55.126 val t=(term_of o the o (parse thy))
55.127 "(9 - x^^^2) / (9 - 6*x + x^^^2) + 1 / (3 - x)";
55.128 - val Some (t',_) = common_nominator_ thy t;
55.129 - val Some (t'',_) = add_fraction_ thy t;
55.130 + val SOME (t',_) = common_nominator_ thy t;
55.131 + val SOME (t'',_) = add_fraction_ thy t;
55.132 term2str t';
55.133 term2str t'';
55.134 "(9 - x ^^^ 2) / ((3 - x) * (3 - x)) + 1 * (3 - x) / ((3 - x) * (3 - x))";
55.135 @@ -391,42 +391,42 @@
55.136
55.137 (*WN021016 added -----vv---*)
55.138 val t = str2term "(9 - x^^^2) / (9 - 6*x + x^^^2) + 1";
55.139 -val Some (t',_) = common_nominator_ thy t;
55.140 -val Some (t'',_) = add_fraction_ thy t;
55.141 +val SOME (t',_) = common_nominator_ thy t;
55.142 +val SOME (t'',_) = add_fraction_ thy t;
55.143 term2str t' = "(9 - x ^^^ 2) / (9 - 6 * x + x ^^^ 2) +\n1\
55.144 \ * (9 - 6 * x + x ^^^ 2) / (9 - 6 * x + x ^^^ 2)" (*true*);
55.145 term2str t'' = "6 / (3 - x)" (*true*);
55.146
55.147 val t = str2term "1 + (9 - x^^^2) / (9 - 6*x + x^^^2)";
55.148 -val Some (t',_) = common_nominator_ thy t;
55.149 -val Some (t'',_) = add_fraction_ thy t;
55.150 +val SOME (t',_) = common_nominator_ thy t;
55.151 +val SOME (t'',_) = add_fraction_ thy t;
55.152 term2str t' = "1 * (9 - 6 * x + x ^^^ 2) / (9 - 6 * x + x ^^^ 2) +\n\
55.153 \(9 - x ^^^ 2) / (9 - 6 * x + x ^^^ 2)" (*true*);
55.154 term2str t'' = "6 / (3 - x)" (*true*);
55.155 (*WN021016 added -----^^---*)
55.156 -(*WN030602 added -----vv--- no rewrite -> None !*)
55.157 +(*WN030602 added -----vv--- no rewrite -> NONE !*)
55.158 val t = str2term "1 / a";
55.159 -val None = cancel_p_ thy t;
55.160 -val None = rewrite_set_ thy false cancel_p t;
55.161 +val NONE = cancel_p_ thy t;
55.162 +val NONE = rewrite_set_ thy false cancel_p t;
55.163 (*WN.2.6.03 added -------^^---*)
55.164
55.165 val t = str2term "(y^^^2 - x^^^2)/(y^^^2 - 2*y*x + x^^^2)";
55.166 -val Some (t',_) = factout_ thy t;
55.167 -val Some (t'',_) = cancel_ thy t;
55.168 +val SOME (t',_) = factout_ thy t;
55.169 +val SOME (t'',_) = cancel_ thy t;
55.170 term2str t' = "(y + x) * (y - x) / ((y - x) * (y - x))"(*true*);
55.171 term2str t'' = "(y + x) / (y - x)";
55.172
55.173 val t = str2term "(y^^^2 - x^^^2)/(y^^^2 - 2*y*x + x^^^2) + 1 / (y - x)";
55.174 -val Some (t',_) = common_nominator_ thy t;
55.175 -val Some (t'',_) = add_fraction_ thy t;
55.176 +val SOME (t',_) = common_nominator_ thy t;
55.177 +val SOME (t'',_) = add_fraction_ thy t;
55.178 term2str t' =
55.179 "(-1 * x ^^^ 2 + y ^^^ 2) / ((-1 * x + y) * (-1 * x + y)) +\n1\
55.180 \ * (-1 * x + y) / ((-1 * x + y) * (-1 * x + y))" (*true*);
55.181 term2str t'' = "(-1 - x - y) / (x - y)" (*true*);
55.182
55.183 val t = str2term "(x^^^2 - y^^^2)/(x^^^2 - 2*x*y + y^^^2) + 1 / (x - y)";
55.184 -val Some (t',_) = common_nominator_ thy t;
55.185 -val Some (t'',_) = add_fraction_ thy t;
55.186 +val SOME (t',_) = common_nominator_ thy t;
55.187 +val SOME (t'',_) = add_fraction_ thy t;
55.188 if term2str t' = "(-1 * y ^^^ 2 + x ^^^ 2) / ((-1 * y + x) * (-1 * y + x))\
55.189 \ +\n1 * (-1 * y + x) / ((-1 * y + x) * (-1 * y + x))" then ()
55.190 else raise error "rational.sml lex-ord 1";
55.191 @@ -436,27 +436,27 @@
55.192
55.193
55.194 val t = str2term "(x^^^2 - y^^^2)/(x^^^2 - 2*x*y + y^^^2)";
55.195 -val Some (t',_) = norm_expanded_rat_ thy t;
55.196 +val SOME (t',_) = norm_expanded_rat_ thy t;
55.197 if term2str t' = "(x + y) / (x - y)" then ()
55.198 else raise error "rational.sml term2poly: invalid x ^^^ 2 - y ^^^ 2 1";
55.199 -(*val Some (t'',_) = norm_rational_ thy t;
55.200 +(*val SOME (t'',_) = norm_rational_ thy t;
55.201 *** RATIONALS_TERM2POLY_EXCEPTION: Invalid Polynomial
55.202 WN.16.10.02 ?! + WN060831???SK4
55.203 WN070905 *** term2poly: invalid = x ^^^ 2 - y ^^^ 2*)
55.204
55.205
55.206 val t = str2term "(9 - x^^^2)/(9 - 6*x + x^^^2) + (1)/(3 + x)";
55.207 -val Some (t',_) = norm_expanded_rat_ thy t;
55.208 +val SOME (t',_) = norm_expanded_rat_ thy t;
55.209 if term2str t' = "(12 + 5 * x + x ^^^ 2) / (9 - x ^^^ 2)" then ()
55.210 else raise error "rational.sml (9 - x^^^2)/(9 - 6*x + x^^^2) +...";
55.211 -(*val Some (t'',_) = norm_rational_ thy t;
55.212 +(*val SOME (t'',_) = norm_rational_ thy t;
55.213 *** RATIONALS_TERM2POLY_EXCEPTION: Invalid Polynomial WN.16.10.02 ?!
55.214 WN070906 *** term2poly: invalid = 9 - x ^^^ 2 SK.term2poly*)
55.215
55.216 val t=(term_of o the o (parse thy))
55.217 "(9 + (-1)* x^^^2)/(9 + (-1)* 6*x + x^^^2) + (1)/(3 + x)";
55.218 - val Some (t',_) = norm_expanded_rat_ thy t;
55.219 - val Some (t'',_) = norm_rational_ thy t;
55.220 + val SOME (t',_) = norm_expanded_rat_ thy t;
55.221 + val SOME (t'',_) = norm_rational_ thy t;
55.222 term2str t';
55.223 term2str t'';
55.224 "(12 + 5 * x + x ^^^ 2) / (9 - x ^^^ 2)";
55.225 @@ -510,18 +510,18 @@
55.226 (* e188a = ("8 / 9",["not ((-1) + x = 0)"]) then () 13.3.03*)
55.227 if e188a = ("8 / 9",["-1 + x ~= 0"]) then ()
55.228 else raise error "rational.sml: e188a new behaviour";
55.229 -val Some (t,_) = rewrite_set thy' false mp
55.230 +val SOME (t,_) = rewrite_set thy' false mp
55.231 "(8*((-1) + x))/(9*((-1) + x))";
55.232 print("b)\n");
55.233 val e188b'="(-15 + 5 * x) / (-18 + 6 * x)";(*SRC*)
55.234 -val Some (t,_) = rewrite_set thy' false "cancel" e188b';
55.235 +val SOME (t,_) = rewrite_set thy' false "cancel" e188b';
55.236 t = "5 / 6" (*true*);
55.237 print("c)\n");
55.238
55.239 val e188c'="( a + -1 * b ) / ( b + -1 * a )";
55.240 val e188c = the (rewrite_set thy' false "cancel_p" e188c');
55.241 (*is_expanded (parse_rat "a + -1 * b");*)
55.242 -val Some (t,_) =
55.243 +val SOME (t,_) =
55.244 rewrite_set thy' false mp "((-1)*(b + (-1) * a))/(1*(b + (-1) * a))";
55.245 if t= "(a + -1 * b) / (-1 * a + b)" then()
55.246 else raise error "rational.sml: e188c new behaviour";
55.247 @@ -530,7 +530,7 @@
55.248 print("c)\n");
55.249 val e190c'="( 27 * a^^^3 + 9 * a^^^2 + 3 * a + 1 ) / ( 27 * a^^^3 + 18 * a^^^2 + 3 * a )";
55.250 val e190c = the (rewrite_set thy' false "cancel" e190c');
55.251 -val Some (t,_) = rewrite_set thy' false mp "((1 + 9 * a ^^^ 2)*(1 + 3 * a))/((3 * a + 9 * a ^^^ 2)*(1 + 3 * a))";
55.252 +val SOME (t,_) = rewrite_set thy' false mp "((1 + 9 * a ^^^ 2)*(1 + 3 * a))/((3 * a + 9 * a ^^^ 2)*(1 + 3 * a))";
55.253 if t = "(1 + 3 * a + 9 * a ^^^ 2 + 27 * a ^^^ 3) /\n(3 * a + 18 * a ^^^ 2 + 27 * a ^^^ 3)" then ()
55.254 else raise error "rational.sml: e190c new behaviour";
55.255
55.256 @@ -543,7 +543,7 @@
55.257 false;
55.258 is_expanded (parse_rat "x + y");
55.259 true; -----------*)
55.260 -val Some (t,_) = rewrite_set thy' false mp "((x + (-1) * y)*(x + y))/((1)*(x + y))";
55.261 +val SOME (t,_) = rewrite_set thy' false mp "((x + (-1) * y)*(x + y))/((1)*(x + y))";
55.262 (* t="(x ^^^ 2 + -1 * y ^^^ 2) / (x + y)" then() WN.13.3.03*)
55.263 if t="(x ^^^ 2 + -1 * y ^^^ 2) / (x + y)" then()
55.264 else raise error "rational.sml: e191a new behaviour";
55.265 @@ -558,7 +558,7 @@
55.266 false;
55.267 is_expanded (parse_rat "-25 + 9*x^^^2");
55.268 true;------------*)
55.269 -val Some (t,_) = rewrite_set thy' false mp "(((-5) + 3 * x)*((-5) + 3 * x))/((5 + 3 * x)*((-5) + 3 * x))";
55.270 +val SOME (t,_) = rewrite_set thy' false mp "(((-5) + 3 * x)*((-5) + 3 * x))/((5 + 3 * x)*((-5) + 3 * x))";
55.271 (* t="(25 + ((-30) * x + 9 * x ^^^ 2)) / ((-25) + 9 * x ^^^ 2)"then() 13.3.03*)
55.272 if t= "(25 + -30 * x + 9 * x ^^^ 2) / (-25 + 9 * x ^^^ 2)" then()
55.273 else raise error "rational.sml: 'e191c' new behaviour";
55.274 @@ -570,13 +570,13 @@
55.275 (*WN.23.10.02-------
55.276 val e192b = the (rewrite_set thy' false "cancel" e192b');
55.277 -------------------*)
55.278 -val Some (t',_) = rewrite_set thy' false mp "((x ^^^ 2)*(7 * x + (-1) * y))/((y ^^^ 2)*(7 * x + (-1) * y))";
55.279 +val SOME (t',_) = rewrite_set thy' false mp "((x ^^^ 2)*(7 * x + (-1) * y))/((y ^^^ 2)*(7 * x + (-1) * y))";
55.280 if t' = "(7 * x ^^^ 3 + -1 * x ^^^ 2 * y) / (7 * x * y ^^^ 2 + -1 * y ^^^ 3)"
55.281 (*"(-1 * y * x ^^^ 2 + 7 * x ^^^ 3) / (-1 * y ^^^ 3 + 7 * x * y ^^^ 2)"WN050929*)
55.282 then () else raise error "rational.sml: 'e192b' new behaviour";
55.283 (*^^^ works with MG's simplifier vvv*)
55.284 val t =str2term"((x ^^^ 2)*(7 * x + (-1) * y))/((y ^^^ 2)*(7 * x + (-1) * y))";
55.285 -val Some (t',_) = rewrite_set_ Isac.thy false make_polynomial t;
55.286 +val SOME (t',_) = rewrite_set_ Isac.thy false make_polynomial t;
55.287 if term2str t' = "(7 * x ^^^ 3 + -1 * x ^^^ 2 * y) / (7 * x * y ^^^ 2 + -1 * y ^^^ 3)" then () else raise error "rational.sml: 'e192b'MG new behaviour";
55.288
55.289
55.290 @@ -592,11 +592,11 @@
55.291 val e193b = the (rewrite_set thy' false "cancel" e193b');
55.292 print("c)\n");
55.293 val e193c'="( 2 * x + -50 * x^^^3 ) / ( 25 * x^^^2 + -10 * x + 1 )";
55.294 -val Some(t,_) = rewrite_set thy' false "cancel" e193c';
55.295 +val SOME(t,_) = rewrite_set thy' false "cancel" e193c';
55.296 -------------------*)
55.297
55.298 val wn01 = "(-25 + 9*x^^^2)/(5 + 3*x)";
55.299 -val Some (t,_) = rewrite_set thy' false "cancel" wn01;
55.300 +val SOME (t,_) = rewrite_set thy' false "cancel" wn01;
55.301 (* t = "((-5) + 3 * x) / 1" then () WN.13.3.03*)
55.302 if t = "(-5 + 3 * x) / 1" then ()
55.303 else raise error "rational.sml: new behav. in cancel wn01";
55.304 @@ -841,7 +841,7 @@
55.305
55.306 val t = (term_of o the o (parse thy))
55.307 "(9 - x ^^^ 2) / (9 - 6 * x + x ^^^ 2)";
55.308 -val Some (t',_) = factout_ thy t;
55.309 +val SOME (t',_) = factout_ thy t;
55.310 term2str t';
55.311 "(3 + x) * (3 - x) / ((3 - x) * (3 - x))";
55.312
55.313 @@ -861,14 +861,14 @@
55.314 next_rule=nex,normal_form=nor,...},...} = cancel;
55.315
55.316 (*normal_form produces the result in ONE step*)
55.317 - val Some (t',_) = nor t;
55.318 + val SOME (t',_) = nor t;
55.319 term2str t';
55.320
55.321 (*initialize the interpreter state used by the 'me'*)
55.322 val (t,_,revsets,_) = ini t;
55.323
55.324 (*find the rule 'r' to apply to term 't'*)
55.325 - val Some r = nex revsets t;
55.326 + val SOME r = nex revsets t;
55.327 (*val r = Thm ("sym_#mult_2_3","6 = 2 * 3") : rule*)
55.328
55.329 (*check, if the rule 'r' applied by the user to 't' belongs to the ruleset;
55.330 @@ -880,7 +880,7 @@
55.331 "(9 - x ^^^ 2) / (3 ^^^ 2 + 6 * x + x ^^^ 2)";
55.332
55.333 (*find the next rule to apply*)
55.334 - val Some r = nex revsets t;
55.335 + val SOME r = nex revsets t;
55.336 (*val r = Thm ("sym_#power_3_2","9 = 3 ^^^ 2") : rule*)
55.337
55.338 (*check the next rule*)
55.339 @@ -889,22 +889,22 @@
55.340 "(3 ^^^ 2 - x ^^^ 2) / (3 ^^^ 2 + 6 * x + x ^^^ 2)";
55.341
55.342 (*find and check the next rules, rewrite*)
55.343 - val Some r = nex revsets t;
55.344 + val SOME r = nex revsets t;
55.345 val (r,(t,asm))::_ = loc revsets t r;
55.346 term2str t;
55.347 "(3 ^^^ 2 - x ^^^ 2) / (3 ^^^ 2 + 2 * 3 * x + x ^^^ 2)";
55.348
55.349 - val Some r = nex revsets t;
55.350 + val SOME r = nex revsets t;
55.351 val (r,(t,asm))::_ = loc revsets t r;
55.352 term2str t;
55.353 "(3 - x) * (3 + x) / (3 ^^^ 2 + 2 * 3 * x + x ^^^ 2)";
55.354
55.355 - val Some r = nex revsets t;
55.356 + val SOME r = nex revsets t;
55.357 val (r,(t,asm))::_ = loc revsets t r;
55.358 term2str t;
55.359 "(3 - x) * (3 + x) / ((3 + x) * (3 + x))";
55.360
55.361 - val Some r = nex revsets t;
55.362 + val SOME r = nex revsets t;
55.363 val (r,(t,asm))::_ = loc revsets t r;
55.364 val ss = term2str t;
55.365 if ss = "(3 - x) / (3 + x)" then ()
55.366 @@ -923,11 +923,11 @@
55.367 next_rule=nex,normal_form=nor,...},...} = cancel_p;
55.368
55.369 (*normal_form produces the result in ONE step*)
55.370 -val Some (t',_) = nor t;
55.371 +val SOME (t',_) = nor t;
55.372 term2str t' = "(3 + 1 * x) / (3 + -1 * x)";
55.373
55.374 (*initialize the interpreter state used by the 'me'*)
55.375 -val Some (t', asm) = cancel_p_ thy t;
55.376 +val SOME (t', asm) = cancel_p_ thy t;
55.377 term2str t' = "(3 + x) / (3 + -1 * x)" (*true*);
55.378 terms2str asm = "[\"3 + -1 * x ~= 0\"]" (*true*);
55.379 val (t,_,revsets,_) = ini t;
55.380 @@ -939,7 +939,7 @@
55.381 WN060831 cycling "sym_order_mult_rls_" "sym_real_mult_assoc"
55.382 as was with make_polynomial before ?!?*)
55.383
55.384 -val Some r = nex revsets t;
55.385 +val SOME r = nex revsets t;
55.386 eq_Thm (r, Thm ("sym_#power_Float ((3,0), (0,0)) __ ((2,0), (0,0))",
55.387 mk_thm Rational.thy "9 = 3 ^^^ 2"));
55.388 (*WN060831 *** id_of_thm
55.389 @@ -947,7 +947,7 @@
55.390 val (r,(t,asm))::_ = loc revsets t r;
55.391 term2str t;
55.392
55.393 - val Some r = nex revsets t;
55.394 + val SOME r = nex revsets t;
55.395 val (r,(t,asm))::_ = loc revsets t r;
55.396 term2str t;
55.397 *)
55.398 @@ -961,64 +961,64 @@
55.399 "-------- norm_Rational ------------------------------------------";
55.400 "-------- norm_Rational ------------------------------------------";
55.401 val t = str2term "(3*x+5)/18 - x/2 - -(3*x - 2)/9 = 0";
55.402 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.403 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.404 if term2str t' = "1 / 18 = 0" then () else raise error "rational.sml 1";
55.405
55.406 val t = str2term "(17*x - 51)/9 - (-(13*x - 3)/6) + 11 - (9*x - 7)/4 = 0";
55.407 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.408 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.409 if term2str t' = "(237 + 65 * x) / 36 = 0" then ()
55.410 else raise error "rational.sml 2";
55.411
55.412 val t = str2term "(1/2 + (5*x)/2)^^^2 - ((13*x)/2 - 5/2)^^^2 - (6*x)^^^2 + 29";
55.413 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.414 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.415 (*before 040209:if term2str t' = "(23 + (35 * x + -72 * x ^^^ 2)) / 1"then()*)
55.416 if term2str t' = "23 + 35 * x + -72 * x ^^^ 2" then ()
55.417 else raise error "rational.sml 3";
55.418 (*trace_rewrite:=true;*)
55.419 val t = str2term "Not (6*x is_atom)";
55.420 -val Some (t',_) = rewrite_set_ thy false powers_erls t; term2str t';
55.421 +val SOME (t',_) = rewrite_set_ thy false powers_erls t; term2str t';
55.422 "True";
55.423 val t = str2term "1 < 2";
55.424 -val Some (t',_) = rewrite_set_ thy false powers_erls t; term2str t';
55.425 +val SOME (t',_) = rewrite_set_ thy false powers_erls t; term2str t';
55.426 "True";
55.427 val t = str2term "(6*x)^^^2";
55.428 -val Some (t',_) = rewrite_ thy dummy_ord powers_erls false
55.429 +val SOME (t',_) = rewrite_ thy dummy_ord powers_erls false
55.430 (num_str realpow_def_atom) t;
55.431 term2str t';
55.432 trace_rewrite:=false;
55.433
55.434 val t = str2term "-1 * (-2 * (5 / 2 * (13 * x / 2)))";
55.435 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.436 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.437 if term2str t' = "65 * x / 2" then () else raise error "rational.sml 4";
55.438
55.439 val t = str2term "1 - ((13*x)/2 - 5/2)^^^2";
55.440 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.441 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.442 (*bef.040209: if term2str t' = "(-21 + (130 * x + -169 * x ^^^ 2)) / 4"then()*)
55.443 if term2str t' = "(-21 + 130 * x + -169 * x ^^^ 2) / 4" then ()
55.444 else raise error "rational.sml 5";
55.445
55.446 (*SRAM Schalk I, p.92 Nr. 609a*)
55.447 val t = str2term "2*(3 - x/5)/3 - 4*(1 - x/3) - x/3 - 2*(x/2 - 1/4)/27 +5/54";
55.448 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.449 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.450 if term2str t' = "(-255 + 112 * x) / 135" then ()
55.451 else raise error "rational.sml 6";
55.452
55.453 (*SRAM Schalk I, p.92 Nr. 610c*)
55.454 val t = str2term "((x- 1)/(x+1) + 1) / ((x- 1)/(x+1) - (x+1)/(x- 1)) - 2";
55.455 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.456 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.457 if term2str t' = "(-3 + -1 * x) / 2" then () else raise error "rational.sml 7";
55.458
55.459 (*SRAM Schalk I, p.92 Nr. 476a*)
55.460 val t = str2term "(x^^^2/(1 - x^^^2) + 1)/(x/(1 - x) + 1) *\
55.461 \ (1 + x)";(*. a/b : c/d translated to a/b * d/c .*)
55.462 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.463 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.464 (*if term2str t' = "1 / 1" then () else raise error "rational.sml 8";3.6.03*)
55.465 if term2str t' = "1" then () else raise error "rational.sml 8";
55.466
55.467 (*............................vvv---TODO: sollte gehen mit poly_order *)
55.468 (*Schalk I, p.92 Nr. 472a*)
55.469 val t = str2term "((8*x^^^2 - 32*y^^^2)/(2*x + 4*y))/((4*x - 8*y)/(x + y))";
55.470 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.471 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.472 if term2str t' = "x + y" then () else raise error "rational.sml p.92 Nr. 472a";
55.473
55.474 (*Schalk I, p.70 Nr. 480b; a/b : c/d translated to a/b * d/c*)
55.475 @@ -1029,12 +1029,12 @@
55.476 (*... nicht simpl, zerlegt ...*)
55.477 val t = str2term "((12*x*y/(9*x^^^2 - y^^^2))/\
55.478 \(1/(3*x - y)^^^2 - 1/(3*x + y)^^^2))";
55.479 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.480 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.481 "(-12 * (x * y ^^^ 3) + 108 * (x * (y * x ^^^ 2))) / (12 * (x * y))";
55.482 (* ~~~~~~~~~~ poly_order notwendig!*)
55.483 val t = str2term "(1/(x - 5*y)^^^2 - 1/(x + 5*y)^^^2)/\
55.484 \(20*x*y/(x^^^2 - 25*y^^^2))";
55.485 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.486 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.487 "(-500 * (x * y ^^^ 3) /\n (x ^^^ 4 + (625 * y ^^^ 4 + -50 * (x ^^^ 2 * y ^^^ 2))) +\n 20 * (x * (y * x ^^^ 2)) /\n (x ^^^ 4 + (625 * y ^^^ 4 + -50 * (x ^^^ 2 * y ^^^ 2)))) /\n(20 * (x * y))";
55.488 trace_rewrite:=true;
55.489 trace_rewrite:=false;
55.490 @@ -1042,11 +1042,11 @@
55.491 "nonterm.SK6 ----- SK060904-2a non-termination of add_fraction_p_";
55.492 (*WN.2.6.03 from rlang.sml 56a
55.493 val t = str2term "(a + b * x) / (a + -1 * (b * x)) + (-1 * a + b * x) / (a + b * x) = 4 * (a * b) / (a ^^^ 2 + -1 * b ^^^ 2)";
55.494 -val None = rewrite_set_ thy false common_nominator_p t;
55.495 +val NONE = rewrite_set_ thy false common_nominator_p t;
55.496
55.497 WN060831 nonterm.SK7
55.498 val t = str2term "(a + b * x) / (a + -1 * (b * x)) + (-1 * a + b * x) / (a + b * x)";
55.499 -val None = add_fraction_p_ thy t;
55.500 +val NONE = add_fraction_p_ thy t;
55.501 *)
55.502
55.503
55.504 @@ -1063,14 +1063,14 @@
55.505
55.506 (*SRA Schalk I, p.40 Nr. 164b *)
55.507 val t = str2term "(47/6 - 76/9 + 13/4)/(35/12)";
55.508 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.509 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.510 term2str t;
55.511 if (term2str t) = "19 / 21" then ()
55.512 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 1";
55.513
55.514 (*SRA Schalk I, p.40 Nr. 166a *)
55.515 val t = str2term "((5/4)/(4+22/7) + 37/20)*(110/3 - 110/9 * 23/11)";
55.516 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.517 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.518 term2str t;
55.519 if (term2str t) = "45 / 2" then ()
55.520 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 2";
55.521 @@ -1083,7 +1083,7 @@
55.522 (* e190c Stefan K.*)
55.523 val t = str2term
55.524 "((1 + 9 * a ^^^ 2)*(1 + 3 * a))/((3 * a + 9 * a ^^^ 2)*(1 + 3 * a))";
55.525 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.526 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.527 term2str t;
55.528 if (term2str t) =
55.529 "(1 + 9 * a ^^^ 2) / (3 * a + 9 * a ^^^ 2)"
55.530 @@ -1093,7 +1093,7 @@
55.531 (* e192b Stefan K.*)
55.532 val t = str2term
55.533 "((x ^^^ 2)*(7 * x + (-1) * y))/((y ^^^ 2)*(7 * x + (-1) * y))";
55.534 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.535 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.536 term2str t;
55.537 if (term2str t) =
55.538 "x ^^^ 2 / y ^^^ 2"
55.539 @@ -1103,7 +1103,7 @@
55.540 (*SRC Schalk I, p.66 Nr. 379c *)
55.541 val t = str2term
55.542 "(a - b)/(b - a)";
55.543 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.544 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.545 term2str t;
55.546 if (term2str t) =
55.547 "-1"
55.548 @@ -1113,7 +1113,7 @@
55.549 (*SRC Schalk I, p.66 Nr. 380b *)
55.550 val t = str2term
55.551 "15*(3*x+3)*(4*x+9)/(12*(2*x+7)*(5*x+5))";
55.552 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.553 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.554 term2str t;
55.555 if (term2str t) =
55.556 "(27 + 12 * x) / (28 + 8 * x)"
55.557 @@ -1124,7 +1124,7 @@
55.558 (* Falsches Ergebnis: rechnet lange und cancel_p kann nicht weiter krzen!!!*)
55.559 (* WN060831????MG1
55.560 val t = str2term "(a+b)^^^4*(x - y)/((x - y)^^^3*(a+b)^^^2)";
55.561 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.562 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.563 term2str t;
55.564 if (term2str t) =
55.565 "(a ^^^ 4 * x + -1 * a ^^^ 4 * y + 4 * a ^^^ 3 * b * x + -4 * a ^^^ 3 * b * y + 6 * a ^^^ 2 * b ^^^ 2 * x + -6 * a ^^^ 2 * b ^^^ 2 * y + 4 * a * b ^^^ 3 * x + -4 * a * b ^^^ 3 * y + b ^^^ 4 * x + -1 * b ^^^ 4 * y) /(a ^^^ 2 * x ^^^ 3 + -3 * a ^^^ 2 * x ^^^ 2 * y + 3 * a ^^^ 2 * x * y ^^^ 2 + -1 * a ^^^ 2 * y ^^^ 3 + 2 * a * b * x ^^^ 3 + -6 * a * b * x ^^^ 2 * y + 6 * a * b * x * y ^^^ 2 + -2 * a * b * y ^^^ 3 + b ^^^ 2 * x ^^^ 3 + -3 * b ^^^ 2 * x ^^^ 2 * y + 3 * b ^^^ 2 * x * y ^^^ 2 + -1 * b ^^^ 2 * y ^^^ 3)"
55.566 @@ -1133,7 +1133,7 @@
55.567 *)
55.568 (*val t = str2term
55.569 "(a ^^^ 4 * x + -1 * a ^^^ 4 * y + 4 * a ^^^ 3 * b * x + -4 * a ^^^ 3 * b * y + 6 * a ^^^ 2 * b ^^^ 2 * x + -6 * a ^^^ 2 * b ^^^ 2 * y + 4 * a * b ^^^ 3 * x + -4 * a * b ^^^ 3 * y + b ^^^ 4 * x + -1 * b ^^^ 4 * y) /(a ^^^ 2 * x ^^^ 3 + -3 * a ^^^ 2 * x ^^^ 2 * y + 3 * a ^^^ 2 * x * y ^^^ 2 + -1 * a ^^^ 2 * y ^^^ 3 + 2 * a * b * x ^^^ 3 + -6 * a * b * x ^^^ 2 * y + 6 * a * b * x * y ^^^ 2 + -2 * a * b * y ^^^ 3 + b ^^^ 2 * x ^^^ 3 + -3 * b ^^^ 2 * x ^^^ 2 * y + 3 * b ^^^ 2 * x * y ^^^ 2 + -1 * b ^^^ 2 * y ^^^ 3)"
55.570 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.571 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.572 term2str t;*)
55.573 (* uncaught exception nonexhaustive binding failure
55.574 raised at: stdIn:93.1-93.51 *)
55.575 @@ -1142,7 +1142,7 @@
55.576 (* ACHTUNG: rechnet ca. 2 Minuten !!! *)
55.577 (* WN060831???MG2
55.578 val t = str2term "18*(a+b)^^^3*(a - b)^^^2/(72*(a - b)^^^3*(a+b)^^^2)";
55.579 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.580 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.581 term2str t;
55.582 if (term2str t) =
55.583 "(a + b) / (4 * a + -4 * b)"
55.584 @@ -1152,7 +1152,7 @@
55.585 (*SRC Schalk I, p.66 Nr. 381b *)
55.586 val t = str2term
55.587 "(4*x^^^2 - 20*x + 25)/(2*x - 5)^^^3";
55.588 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.589 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.590 term2str t;
55.591 if (term2str t) =
55.592 "-1 / (5 + -2 * x)"
55.593 @@ -1162,7 +1162,7 @@
55.594 (*SRC Schalk I, p.66 Nr. 381c *)
55.595 val t = str2term
55.596 "(27*a^^^3+9*a^^^2+3*a+1)/(27*a^^^3+18*a^^^2+3*a)";
55.597 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.598 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.599 term2str t;
55.600 if (term2str t) =
55.601 "(1 + 9 * a ^^^ 2) / (3 * a + 9 * a ^^^ 2)"
55.602 @@ -1172,7 +1172,7 @@
55.603 (*SRC Schalk I, p.66 Nr. 383a *)
55.604 val t = str2term
55.605 "(5*a^^^2 - 5*a*b)/(a - b)^^^2";
55.606 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.607 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.608 term2str t;
55.609 if (term2str t) =
55.610 "5 * a / (a + -1 * b)"
55.611 @@ -1186,7 +1186,7 @@
55.612 (*SRA Schalk I, p.67 Nr. 403a *)
55.613 val t = str2term
55.614 "4/x - 3/y - 1";
55.615 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.616 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.617 term2str t;
55.618 if (term2str t) =
55.619 "(-3 * x + 4 * y + -1 * x * y) / (x * y)"
55.620 @@ -1196,7 +1196,7 @@
55.621 (*SRA Schalk I, p.67 Nr. 407b *)
55.622 val t = str2term
55.623 "(2*a+3*b)/(b*c) + (3*c+a)/(a*c) - (2*a^^^2+3*b*c)/(a*b*c)";
55.624 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.625 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.626 term2str t;
55.627 if (term2str t) =
55.628 "4 / c"
55.629 @@ -1206,7 +1206,7 @@
55.630 (*SRA Schalk I, p.67 Nr. 410b *)
55.631 val t = str2term
55.632 "1/(x+1) + 1/(x+2) - 2/(x+3)";
55.633 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.634 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.635 term2str t;
55.636 if (term2str t) =
55.637 "(5 + 3 * x) / (6 + 11 * x + 6 * x ^^^ 2 + x ^^^ 3)"
55.638 @@ -1216,7 +1216,7 @@
55.639 (*SRA Schalk I, p.67 Nr. 413b *)
55.640 val t = str2term
55.641 "(1+x)/(1 - x) - (1 - x)/(1+x) + 2*x/(1 - x^^^2)";
55.642 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.643 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.644 term2str t;
55.645 if (term2str t) =
55.646 "6 * x / (1 + -1 * x ^^^ 2)"
55.647 @@ -1226,7 +1226,7 @@
55.648 (*SRA Schalk I, p.68 Nr. 414a *)
55.649 val t = str2term
55.650 "(x + 2)/(x - 1) + (x - 3)/(x - 2) - (x + 1)/((x - 1)*(x - 2))";
55.651 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.652 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.653 term2str t;
55.654 if (term2str t) =
55.655 "(-2 + -5 * x + 2 * x ^^^ 2) / (2 + -3 * x + x ^^^ 2)"
55.656 @@ -1236,7 +1236,7 @@
55.657 (*SRA Schalk I, p.68 Nr. 423a *)
55.658 val t = str2term
55.659 "(2*x+3*y)/x + (4*x^^^3 - x*y^^^2 - 3*y^^^3)/(x^^^3 - 2*x^^^2*y+x*y^^^2) - (5*x+6*y)/(x - y)";
55.660 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.661 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.662 term2str t;
55.663 if (term2str t) =
55.664 "1"
55.665 @@ -1246,7 +1246,7 @@
55.666 (*SRA Schalk I, p.68 Nr. 428b *)
55.667 val t = str2term
55.668 "1/(a - b)^^^2 + 1/(a+b)^^^2 - 2/(a^^^2 - b^^^2) - 4*(b^^^2 - 1)/(a^^^2 - b^^^2)^^^2";
55.669 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.670 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.671 term2str t;
55.672 if (term2str t) =
55.673 "4 / (a ^^^ 4 + -2 * a ^^^ 2 * b ^^^ 2 + b ^^^ 4)"
55.674 @@ -1256,7 +1256,7 @@
55.675 (*SRA Schalk I, p.68 Nr. 430b *)
55.676 val t = str2term
55.677 "a^^^2/(a - 3*b) - 108*a*b^^^3/((a+3*b)*(a^^^2 - 9*b^^^2)) - 9*b^^^2*(a - 3*b)/(a+3*b)^^^2";
55.678 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.679 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.680 term2str t;
55.681 if (term2str t) =
55.682 "a + 3 * b"
55.683 @@ -1267,7 +1267,7 @@
55.684 (*SRA Schalk I, p.68 Nr. 432 *)
55.685 val t = str2term
55.686 "(a^^^2+a*b)/(a^^^2 - b^^^2) - (b^^^2 - a*b)/(b^^^2 - a^^^2) + a^^^2*(a - b)/(a^^^3 - a^^^2*b) - 2*a*(a^^^2 - b^^^2)/(a^^^3 - a*b^^^2) - 2*b^^^2/(a^^^2 - b^^^2)";
55.687 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.688 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.689 term2str t;
55.690 if (term2str t) =
55.691 "0"
55.692 @@ -1277,7 +1277,7 @@
55.693 (*Eigenes*)
55.694 val t = str2term
55.695 "3*a/(a*b) + x/y";
55.696 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.697 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.698 term2str t;
55.699 if (term2str t) =
55.700 "(3 * y + b * x) / (b * y)"
55.701 @@ -1292,7 +1292,7 @@
55.702 (*SRM Schalk I, p.68 Nr. 436a *)
55.703 val t = str2term
55.704 "3*(x+y)/(15*(x - y)) * 25*(x - y)^^^2/(18*(x+y)^^^2)";
55.705 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.706 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.707 term2str t;
55.708 if (term2str t) =
55.709 "(5 * x + -5 * y) / (18 * x + 18 * y)"
55.710 @@ -1303,7 +1303,7 @@
55.711 (*WN060420???MG3 crashes with method 'simplify' in
55.712 IsacCore > Simplification > Rational Terms > Multiplication > No.2*)
55.713 val t = str2term "5*a*(a - b)^^^2*(a + b)^^^3/(7*b*(a - b)^^^3) * 7*b/(a + b)^^^3";
55.714 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.715 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.716 term2str t;
55.717 if (term2str t) =
55.718 "5 * a / (a + -1 * b)"
55.719 @@ -1312,20 +1312,20 @@
55.720
55.721 (*Schalk I, p.68 Nr. 437a *)
55.722 val t = str2term "(3*a - 4*b)/(4*c+3*e) * (3*a+4*b)/(9*a^^^2 - 16*b^^^2)";
55.723 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.724 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.725 if (term2str t) = "1 / (4 * c + 3 * e)" then ()
55.726 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 24";
55.727
55.728 "----- S.K. corrected non-termination 060904";
55.729 val t = str2term "(3*a - 4*b) * (3*a+4*b)/((4*c+3*e)*(9*a^^^2 - 16*b^^^2))";
55.730 -val Some (t',_) = rewrite_set_ thy false make_polynomial t;
55.731 +val SOME (t',_) = rewrite_set_ thy false make_polynomial t;
55.732 if term2str t' = "(9 * a ^^^ 2 + -16 * b ^^^ 2) /\n(36 * a ^^^ 2 * c + 27 * a ^^^ 2 * e + -64 * b ^^^ 2 * c +\n -48 * b ^^^ 2 * e)" then ()
55.733 else raise error "rational.sml.sml: S.K.8..corrected 060904-6";
55.734
55.735 "----- S.K. corrected non-termination of cancel_p_";
55.736 val t'' = str2term "(9 * a ^^^ 2 + -16 * b ^^^ 2) /\
55.737 \(36 * a^^^2 * c + (27 * a^^^2 * e + (-64 * b^^^2 * c + -48 * b^^^2 * e)))";
55.738 -val Some (t',_) = rewrite_set_ thy false cancel_p t'';
55.739 +val SOME (t',_) = rewrite_set_ thy false cancel_p t'';
55.740 if term2str t' = "1 / (4 * c + 3 * e)" then ()
55.741 else raise error "rational.sml.sml: diff.behav. in cancel_p S.K.8";
55.742
55.743 @@ -1334,21 +1334,21 @@
55.744 (*Schalk I, p.68 Nr. 437b *)
55.745 (* nonterm.SK9 loops: cancel_p kann nicht weiter kuerzen!!! *)
55.746 val t'' = str2term "(a + b)/(x^^^2 - y^^^2) * ((x - y)^^^2/(a^^^2 - b^^^2))";
55.747 -(* val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t'';
55.748 +(* val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t'';
55.749 *)
55.750
55.751 (*a casual output from above*)
55.752 val t = str2term
55.753 "(a * x ^^^ 2 + -2 * a * x * y + a * y ^^^ 2 + b * x ^^^ 2 + -2 * b * x * y + b * y ^^^ 2) /(a ^^^ 2 * x ^^^ 2 + -1 * a ^^^ 2 * y ^^^ 2 + -1 * b ^^^ 2 * x ^^^ 2 + b ^^^ 2 * y ^^^ 2)";
55.754 (* WN060831 nonterm.SK10
55.755 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.756 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.757 term2str t;
55.758 *)
55.759
55.760 (*SRM Schalk I, p.68 Nr. 438a *)
55.761 val t = str2term
55.762 "x*y/(x*y - y^^^2)*(x^^^2 - x*y)";
55.763 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.764 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.765 term2str t;
55.766 if (term2str t) =
55.767 "x ^^^ 2"
55.768 @@ -1358,7 +1358,7 @@
55.769 (*SRM Schalk I, p.68 Nr. 439b *)
55.770 val t = str2term
55.771 "(4*x^^^2+4*x+1)*((x^^^2 - 2*x^^^3)/(4*x^^^2+2*x))";
55.772 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.773 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.774 term2str t;
55.775 if (term2str t) =
55.776 "(x + -4 * x ^^^ 3) / 2"
55.777 @@ -1368,7 +1368,7 @@
55.778 (*SRM Schalk I, p.68 Nr. 440a *)
55.779 val t = str2term
55.780 "(x^^^2 - 2*x)/(x^^^2 - 3*x) * (x - 3)^^^2/(x^^^2 - 4)";
55.781 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.782 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.783 term2str t;
55.784 if (term2str t) =
55.785 "(-3 + x) / (2 + x)"
55.786 @@ -1378,13 +1378,13 @@
55.787 "----- Schalk I, p.68 Nr. 440b SK11 works since 0707xx";
55.788 val t = str2term
55.789 "(a^^^3 - 9*a)/(a^^^3*b - a*b^^^3)*(a^^^2*b+a*b^^^2)/(a+3)";
55.790 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
55.791 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
55.792 if term2str t = "(-3 * a + a ^^^ 2) / (a + -1 * b)" then ()
55.793 else raise error "rational.sml.sml: diff.behav. in norm_Rational 27";
55.794
55.795 "----- SK12 works since 0707xx";
55.796 val t = str2term "(a^^^3 - 9*a)*(a^^^2*b+a*b^^^2)/((a^^^3*b - a*b^^^3)*(a+3))";
55.797 -val Some (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.798 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t; term2str t';
55.799 if term2str t' = "(-3 * a + a ^^^ 2) / (a + -1 * b)" then ()
55.800 else raise error "rational.sml.sml: diff.behav. in norm_Rational 28";
55.801
55.802 @@ -1400,7 +1400,7 @@
55.803
55.804 (*SRAM Schalk I, p.69 Nr. 441b *)
55.805 val t = str2term "(4*a/3 + 3*b^^^2/a^^^3 + b/(4*a))*(4*b/(3*a))";
55.806 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.807 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.808 term2str t;
55.809 if (term2str t) =
55.810 "(36 * b ^^^ 3 + 3 * a ^^^ 2 * b ^^^ 2 + 16 * a ^^^ 4 * b) / (9 * a ^^^ 4)"
55.811 @@ -1409,7 +1409,7 @@
55.812
55.813 (*SRAM Schalk I, p.69 Nr. 442b *)
55.814 val t = str2term "(15*a^^^2/x^^^3 - 5*b^^^4/x^^^2 + 25*c^^^2/x)*(x^^^3/(5*a*b^^^3*c^^^3)) + 1/c^^^3 * (b*x/a - 3*a/b^^^3)";
55.815 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.816 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.817 term2str t;
55.818 if (term2str t) =
55.819 "5 * x ^^^ 2 / (a * b ^^^ 3 * c)"
55.820 @@ -1418,7 +1418,7 @@
55.821
55.822 (*SRAM Schalk I, p.69 Nr. 443b *)
55.823 val t = str2term "(a/2 + b/3)*(b/3 - a/2)";
55.824 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.825 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.826 term2str t;
55.827 if (term2str t) =
55.828 "(-9 * a ^^^ 2 + 4 * b ^^^ 2) / 36"
55.829 @@ -1427,7 +1427,7 @@
55.830
55.831 (*SRAM Schalk I, p.69 Nr. 445b *)
55.832 val t = str2term "(a^^^2/9 + 2*a/(3*b) + 4/b^^^2)*(a/3 - 2/b) + 8/b^^^3";
55.833 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.834 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.835 term2str t;
55.836 if (term2str t) =
55.837 "a ^^^ 3 / 27"
55.838 @@ -1436,7 +1436,7 @@
55.839
55.840 (*SRAM Schalk I, p.69 Nr. 446b *)
55.841 val t = str2term "(x/(5*x + 4*y) - y/(5*x - 4*y) + 1)*(25*x^^^2 - 16*y^^^2)";
55.842 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.843 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.844 term2str t;
55.845 if (term2str t) =
55.846 "30 * x ^^^ 2 + -9 * x * y + -20 * y ^^^ 2"
55.847 @@ -1446,7 +1446,7 @@
55.848 (*SRAM Schalk I, p.69 Nr. 449a *)(*Achtung: rechnet ca 8 Sekunden*)
55.849 val t = str2term
55.850 "(2*x^^^2/(3*y)+x/y^^^2)*(4*x^^^4/(9*y^^^2)+x^^^2/y^^^4)*(2*x^^^2/(3*y) - x/y^^^2)";
55.851 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.852 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.853 term2str t;
55.854 if (term2str t) =
55.855 "(-81 * x ^^^ 4 + 16 * x ^^^ 8 * y ^^^ 4) / (81 * y ^^^ 8)"
55.856 @@ -1456,7 +1456,7 @@
55.857 (*SRAM Schalk I, p.69 Nr. 450a *)
55.858 val t = str2term
55.859 "(4*x/(3*y)+2*y/(3*x))^^^2 - (2*y/(3*x) - 2*x/y)*(2*y/(3*x)+2*x/y)";
55.860 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.861 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.862 term2str t;
55.863 if (term2str t) =
55.864 "(52 * x ^^^ 2 + 16 * y ^^^ 2) / (9 * y ^^^ 2)"
55.865 @@ -1470,7 +1470,7 @@
55.866 (*SRD Schalk I, p.69 Nr. 454b *)
55.867 val t = str2term
55.868 "((2 - x)/(2*a)) / (2*a/(x - 2))";
55.869 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.870 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.871 term2str t;
55.872 if (term2str t) =
55.873 "(-4 + 4 * x + -1 * x ^^^ 2) / (4 * a ^^^ 2)"
55.874 @@ -1480,7 +1480,7 @@
55.875 (*SRD Schalk I, p.69 Nr. 455a *)
55.876 val t = str2term
55.877 "(a^^^2 + 1)/(a^^^2 - 1) / ((a+1)/(a - 1))";
55.878 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.879 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.880 term2str t;
55.881 if (term2str t) =
55.882 "(1 + a ^^^ 2) / (1 + 2 * a + a ^^^ 2)" then ()
55.883 @@ -1489,26 +1489,26 @@
55.884
55.885 "----- Schalk I, p.69 Nr. 455b";
55.886 val t = str2term "(x^^^2 - 4)/(y^^^2 - 9)/((2+x)/(3 - y))";
55.887 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.888 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.889 if term2str t = "(2 + -1 * x) / (3 + y)" then ()
55.890 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 37";
55.891
55.892 "----- SK060904-1a non-termination of cancel_p_ ?: worked before 0707xx";
55.893 val t = str2term "(x^^^2 - 4)*(3 - y)/((y^^^2 - 9)*(2+x))";
55.894 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
55.895 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
55.896 if term2str t = "(2 + -1 * x) / (3 + y)" then ()
55.897 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 37b";
55.898
55.899 "----- ?: worked before 0707xx";
55.900 val t = str2term "(3 + -1 * y) / (-9 + y ^^^ 2)";
55.901 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
55.902 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
55.903 if term2str t = "-1 / (3 + y)" then ()
55.904 else raise error "rational.sml: -1 / (3 + y) norm_Rational";
55.905
55.906 (*SRD Schalk I, p.69 Nr. 456b *)
55.907 val t = str2term
55.908 "(b^^^3 - b^^^2)/(b^^^2+b)/(b^^^2 - 1)";
55.909 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.910 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.911 term2str t;
55.912 if (term2str t) = "b / (1 + 2 * b + b ^^^ 2)" then ()
55.913 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 38";
55.914 @@ -1516,7 +1516,7 @@
55.915 (*SRD Schalk I, p.69 Nr. 457b *)
55.916 val t = str2term
55.917 "(16*a^^^2 - 9*b^^^2)/(2*a+3*a*b) / ((4*a+3*b)/(4*a^^^2 - 9*a^^^2*b^^^2))";
55.918 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.919 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.920 term2str t;
55.921 if (term2str t) =
55.922 "8 * a ^^^ 2 + -6 * a * b + -12 * a ^^^ 2 * b + 9 * a * b ^^^ 2"
55.923 @@ -1526,13 +1526,13 @@
55.924 "----- Schalk I, p.69 Nr. 458b works since 0707";
55.925 val t = str2term
55.926 "(2*a^^^2*x - a^^^2)/(a*x - b*x) / (b^^^2*(2*x - 1)/(x*(a - b)))";
55.927 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
55.928 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
55.929 if term2str t = "a ^^^ 2 / b ^^^ 2" then ()
55.930 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 39b";
55.931
55.932 (*SRD Schalk I, p.69 Nr. 459b *)
55.933 val t = str2term "(a^^^2 - b^^^2)/(a*b) / (4*(a+b)^^^2/a)";
55.934 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
55.935 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
55.936 if term2str t = "(a + -1 * b) / (4 * a * b + 4 * b ^^^ 2)" then ()
55.937 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 41";
55.938
55.939 @@ -1540,24 +1540,24 @@
55.940 (*Schalk I, p.69 Nr. 460b nonterm.SK
55.941 val t = str2term
55.942 "(9*(x^^^2 - 8*x+16)/(4*(y^^^2 - 2*y+1)))/((3*x - 12)/(16*y - 16))";
55.943 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.944 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.945 if term2str t =
55.946 then ()
55.947 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 42";
55.948
55.949 val t = str2term
55.950 "9*(x^^^2 - 8*x+16)*(16*y - 16)/(4*(y^^^2 - 2*y+1)*(3*x - 12))";
55.951 -val Some (t',_) = rewrite_set_ thy false norm_Rational t;
55.952 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t;
55.953 ... non terminating.
55.954 -val Some (t',_) = rewrite_set_ thy false make_polynomial t;
55.955 +val SOME (t',_) = rewrite_set_ thy false make_polynomial t;
55.956 "(-2304 + 1152 * x + 2304 * y + -144 * x ^^^ 2 + -1152 * x * y + 144 * x ^^^ 2 * y) /(-48 + 12 * x + 96 * y + -24 * x * y + -48 * y ^^^ 2 + 12 * x * y ^^^ 2)";
55.957 -val Some (t,_) = rewrite_set_ thy false cancel_p t';
55.958 +val SOME (t,_) = rewrite_set_ thy false cancel_p t';
55.959 ... non terminating.*)
55.960
55.961 (*SRD Schalk I, p.70 Nr. 472a *)
55.962 val t = str2term "((8*x^^^2 - 32*y^^^2)/(2*x + 4*y))/\
55.963 \((4*x - 8*y)/(x + y))";
55.964 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.965 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.966 term2str t;
55.967 if (term2str t) =
55.968 "x + y"
55.969 @@ -1572,7 +1572,7 @@
55.970 (*SRD Schalk I, p.69 Nr. 461a *)
55.971 val t = str2term
55.972 "(2/(x+3) + 2/(x - 3)) / (8*x/(x^^^2 - 9))";
55.973 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.974 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.975 term2str t;
55.976 if (term2str t) =
55.977 "1 / 2"
55.978 @@ -1582,7 +1582,7 @@
55.979 (*SRD Schalk I, p.69 Nr. 464b *)
55.980 val t = str2term
55.981 "(a - a/(a - 2)) / (a + a/(a - 2))";
55.982 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.983 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.984 term2str t;
55.985 if (term2str t) =
55.986 "(3 + -1 * a) / (1 + -1 * a)"
55.987 @@ -1592,7 +1592,7 @@
55.988 (*SRD Schalk I, p.69 Nr. 465b *)
55.989 val t = str2term
55.990 "((x+3*y)/9 + (4*y^^^2 - 9*z^^^2)/(16*x)) /(x/9+y/6+z/4)";
55.991 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.992 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.993 term2str t;
55.994 if (term2str t) =
55.995 "(4 * x + 6 * y + -9 * z) / (4 * x)"
55.996 @@ -1602,7 +1602,7 @@
55.997 (*SRD Schalk I, p.69 Nr. 466b *)
55.998 val t = str2term
55.999 "((1 - 7*(x - 2)/(x^^^2 - 4)) / (6/(x+2))) / (3/(x+5)+30/(x^^^2 - 25))";
55.1000 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1001 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1002 term2str t;
55.1003 if (term2str t) =
55.1004 "(25 + -10 * x + x ^^^ 2) / 18"
55.1005 @@ -1612,7 +1612,7 @@
55.1006 (*SRD Schalk I, p.70 Nr. 469 *)
55.1007 val t = str2term
55.1008 "3*b^^^2/(4*a^^^2 - 8*a*b + 4*b^^^2)/(a/(a^^^2*b - b^^^3) + (a - b)/(4*a*b^^^2+4*b^^^3) - 1/(4*b^^^2))";
55.1009 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1010 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1011 term2str t;
55.1012 if (term2str t) =
55.1013 "3 * b ^^^ 3 / (2 * a + -2 * b)"
55.1014 @@ -1627,7 +1627,7 @@
55.1015 (*WN060419 crashes with method 'simplify' ????SK*)
55.1016 val t = str2term
55.1017 "((a^^^2 - b^^^2)/(2*a*b)+2*a*b/(a^^^2 - b^^^2))/((a^^^2+b^^^2)/(2*a*b)+1) / ((a^^^2+b^^^2)^^^2/(a+b)^^^2)";
55.1018 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
55.1019 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
55.1020 if term2str t = "1 / (a ^^^ 2 + -1 * b ^^^ 2)" then ()
55.1021 else raise error "rational.sml.sml: diff.behav. in norm_Rational_mg 49";
55.1022
55.1023 @@ -1636,19 +1636,19 @@
55.1024 L???ung sollte (ziemlich grosser) Faktorisierter Ausdruck sein
55.1025 val t = str2term "b*y/(b - 2*y)/((b^^^2 - y^^^2)/(b+2*y)) /\
55.1026 \(b^^^2*y+b*y^^^2)*(a+x)^^^2/((b^^^2 - 4*y^^^2)*(a+2*x)^^^2)";
55.1027 -val Some (t',_) = rewrite_set_ thy false norm_Rational t;
55.1028 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t;
55.1029
55.1030
55.1031 val t = str2term "b*y*(b+2*y)*(b^^^2 - 4*y^^^2)*(a+2*x)^^^2 / \
55.1032 \((b - 2*y)*(b^^^2 - y^^^2)*(b^^^2*y+b*y^^^2)*(a+x)^^^2)";
55.1033 -val Some (t,_) = rewrite_set_ thy false make_polynomial t;
55.1034 +val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
55.1035 ????SK ???MG*)
55.1036
55.1037
55.1038 "----- Schalk I, p.70 Nr. 478b ----- Rechenzeit: 5 sec";
55.1039 val t = str2term "(a - (a*b+b^^^2)/(a+b))/(b+(a - b)/(1+(a+b)/(a - b))) / \
55.1040 \((a - a^^^2/(a+b))/(a+(a*b)/(a - b)))";
55.1041 -val Some (t',_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1042 +val SOME (t',_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1043 if term2str t' =
55.1044 "(2 * a ^^^ 3 + 2 * a ^^^ 2 * b) / (a ^^^ 2 * b + b ^^^ 3)"
55.1045 then ()
55.1046 @@ -1665,7 +1665,7 @@
55.1047 (* Achtung: rechnet ewig; cancel_p kann nicht krzen: WN060831 nonterm.SK00
55.1048 val t = str2term
55.1049 "(1/x+1/y+1/z)/(1/x - 1/y - 1/z) / (2*x^^^2/(x^^^2 - z^^^2)/(x/(x+z)+x/(x - z)))";
55.1050 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1051 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1052 term2str t;
55.1053 if (term2str t) =
55.1054
55.1055 @@ -1675,13 +1675,13 @@
55.1056 (*MG Berechne Zwischenergebnisse: WN060831 nonterm.SK00*)
55.1057 val t = str2term
55.1058 "(1/x+1/y+1/z)/(1/x - 1/y - 1/z)";
55.1059 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1060 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1061 term2str t;
55.1062 "(x ^^^ 2 * y ^^^ 2 * z + x ^^^ 2 * y * z ^^^ 2 + x * y ^^^ 2 * z ^^^ 2) /
55.1063 (-1 * x ^^^ 2 * y ^^^ 2 * z + -1 * x ^^^ 2 * y * z ^^^ 2 + x * y ^^^ 2 * z ^^^ 2)";
55.1064 val t = str2term
55.1065 "2*x^^^2/(x^^^2 - z^^^2)/(x/(x+z)+x/(x - z))";
55.1066 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1067 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1068 term2str t;
55.1069 "1"
55.1070
55.1071 @@ -1694,14 +1694,14 @@
55.1072
55.1073 val t = str2term
55.1074 "(x^^^2 * (y^^^2 * z) + x^^^2 * (y * z^^^2) + x * (y^^^2 * z^^^2)) / (-1 * (x^^^2 * (y^^^2 * z)) + -1 * (x^^^2 * (y * z^^^2)) + x * (y^^^2 * z^^^2))";
55.1075 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.1076 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.1077 term2str t;
55.1078 (*uncaught exception nonexhaustive binding failure*)
55.1079
55.1080 (* Das kann er aber krzen !!????: *)
55.1081 val t = str2term
55.1082 "(x^^^2 * (y^^^2 * z) + x * (y^^^2 * z^^^2)) / (-1 * (x^^^2 * (y * z^^^2)) + x * (y^^^2 * z^^^2))";
55.1083 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.1084 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.1085 term2str t;
55.1086 "(-1 * (y * x) + -1 * (z * y)) / (1 * (z * x) + -1 * (z * y))";
55.1087 *)
55.1088 @@ -1718,18 +1718,18 @@
55.1089 (*Schalk I, p.60 Nr. 215d *)
55.1090 (* Achtung: rechnet ewig ...
55.1091 val t = str2term "(a-b)^^^3 * (x+y)^^^4 / ((x+y)^^^2 * (a-b)^^^5)";
55.1092 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1093 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1094 term2str t; noterm.SK
55.1095 *)
55.1096
55.1097 (* Kein Wunder, denn Z???ler und Nenner extra als Polynom dargestellt ergibt:*)
55.1098 (*
55.1099 val t = str2term "(a-b)^^^3 * (x+y)^^^4";
55.1100 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1101 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1102 term2str t;
55.1103 "a^^^3 * x^^^4 + 4 * a^^^3 * x^^^3 * y +\n6 * a^^^3 * x^^^2 * y^^^2 +\n4 * a^^^3 * x * y^^^3 +\na^^^3 * y^^^4 +\n-3 * a^^^2 * b * x^^^4 +\n-12 * a^^^2 * b * x^^^3 * y +\n-18 * a^^^2 * b * x^^^2 * y^^^2 +\n-12 * a^^^2 * b * x * y^^^3 +\n-3 * a^^^2 * b * y^^^4 +\n3 * a * b^^^2 * x^^^4 +\n12 * a * b^^^2 * x^^^3 * y +\n18 * a * b^^^2 * x^^^2 * y^^^2 +\n12 * a * b^^^2 * x * y^^^3 +\n3 * a * b^^^2 * y^^^4 +\n-1 * b^^^3 * x^^^4 +\n-4 * b^^^3 * x^^^3 * y +\n-6 * b^^^3 * x^^^2 * y^^^2 +\n-4 * b^^^3 * x * y^^^3 +\n-1 * b^^^3 * y^^^4";
55.1104 val t = str2term "((x+y)^^^2 * (a-b)^^^5)";
55.1105 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1106 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1107 term2str t;
55.1108 "a^^^5 * x^^^2 + 2 * a^^^5 * x * y + a^^^5 * y^^^2 +\n-5 * a^^^4 * b * x^^^2 +\n-10 * a^^^4 * b * x * y +\n-5 * a^^^4 * b * y^^^2 +\n10 * a^^^3 * b^^^2 * x^^^2 +\n20 * a^^^3 * b^^^2 * x * y +\n10 * a^^^3 * b^^^2 * y^^^2 +\n-10 * a^^^2 * b^^^3 * x^^^2 +\n-20 * a^^^2 * b^^^3 * x * y +\n-10 * a^^^2 * b^^^3 * y^^^2 +\n5 * a * b^^^4 * x^^^2 +\n10 * a * b^^^4 * x * y +\n5 * a * b^^^4 * y^^^2 +\n-1 * b^^^5 * x^^^2 +\n-2 * b^^^5 * x * y +\n-1 * b^^^5 * y^^^2";
55.1109 *)
55.1110 @@ -1741,14 +1741,14 @@
55.1111 \(1/(3*x - y)^^^2 - 1/(3*x + y)^^^2)) *\
55.1112 \(1/(x - 5*y)^^^2 - 1/(x + 5*y)^^^2)/\
55.1113 \(20*x*y/(x^^^2 - 25*y^^^2))";
55.1114 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1115 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1116 SK.nonterm
55.1117 Kann nicht weiter vereinfacht werden !!!!?? *)
55.1118
55.1119 (*--------------------------------------------------------------------*)
55.1120 "---- MGs test set";
55.1121 val t = str2term " (1 + x^^^5) / (y + x) + x^^^3 / x ";
55.1122 -val Some (t,_) = rewrite_set_ thy false common_nominator_p t;
55.1123 +val SOME (t,_) = rewrite_set_ thy false common_nominator_p t;
55.1124 if term2str t = "(1 + x ^^^ 3 + x ^^^ 5 + y * x ^^^ 2) / (x + y)" then()
55.1125 else raise error "";
55.1126
55.1127 @@ -1756,12 +1756,12 @@
55.1128 (* cancel_p liefert nicht immer Polynomnormalform (2): WN060831???SK3b
55.1129 ---> Sortierung FALSCH !! *)
55.1130 val t = str2term "b^^^3 * a^^^5/a ";
55.1131 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.1132 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.1133 term2str t;
55.1134 "1 * (a^^^4 * b^^^3) / 1"; (*OK*)
55.1135
55.1136 val t = str2term "b^^^3 * a^^^5/b ";
55.1137 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.1138 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.1139 term2str t;
55.1140 "1 * (b^^^2 * a^^^5) / 1"; (*cancel_p sortiert hier falsch um!*)
55.1141
55.1142 @@ -1780,7 +1780,7 @@
55.1143
55.1144 val t = str2term "-1 / (3 + y)";
55.1145 (*~~ *)
55.1146 -val Some (t,_) = rewrite_set_ thy false cancel_p t;
55.1147 +val SOME (t,_) = rewrite_set_ thy false cancel_p t;
55.1148 term2str t;
55.1149 "-1 / (3 + 1 * y)";
55.1150 (********* Das ist das PROBLEM !!!!!!!??? *******************)
55.1151 @@ -1790,19 +1790,19 @@
55.1152 (* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *)
55.1153 "----- MGs test set";
55.1154 val t = str2term "(a^^^2 + -1)/(a+1)";
55.1155 -val Some (t',_) = rewrite_set_ thy false cancel_p t;
55.1156 +val SOME (t',_) = rewrite_set_ thy false cancel_p t;
55.1157 if term2str t' = "(-1 + a) / 1" then ()
55.1158 else raise error "rational.sml MG tests 3d";
55.1159
55.1160 "----- NOT TERMINATING ?: worked before 0707xx";
55.1161 val t = str2term "(a^^^2 - 1)*(b + 1) / ((b^^^2 - 1)*(a+1))";
55.1162 -val Some (t'',_) = rewrite_set_ thy false norm_Rational t;
55.1163 +val SOME (t'',_) = rewrite_set_ thy false norm_Rational t;
55.1164 if term2str t'' = "(1 + -1 * a) / (1 + -1 * b)" then ()
55.1165 else raise error "rational.sml MG tests 3e";
55.1166
55.1167 "----- corrected SK060905";
55.1168 val t = str2term "(4*x^^^2 - 20*x + 25)/(2*x - 5)^^^3";
55.1169 -val Some (t',_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1170 +val SOME (t',_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1171 if term2str t' = "-1 / (5 + -2 * x)" then ()
55.1172 else raise error "rational.sml corrected SK060905";
55.1173
55.1174 @@ -1814,7 +1814,7 @@
55.1175 (*SRAM Schalk I, p.69 Nr. 442b --- abgewandelt*)
55.1176 val t = str2term
55.1177 "(15*a^^^4/(a*x^^^3) - 5*a*((b^^^4 - 5*c^^^2*x)/x^^^2))*(x^^^3/(5*a*b^^^3*c^^^3)) + a/c^^^3 * (x*(b/a) - 3*b*(a/b^^^4))";
55.1178 -val Some (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1179 +val SOME (t,_) = rewrite_set_ thy false norm_Rational(*_mg*) t;
55.1180 term2str t;
55.1181 if (term2str t) =
55.1182 "5 * x ^^^ 2 / (b ^^^ 3 * c)"
55.1183 @@ -1893,9 +1893,9 @@
55.1184 val p = ([2,1,9],Res);
55.1185 getTactic 1 p;
55.1186 val (_, tac, _) = pt_extract (pt, p);
55.1187 -(*case tac of Some (Rewrite ("sym_real_plus_binom_times1", _)) => ()
55.1188 +(*case tac of SOME (Rewrite ("sym_real_plus_binom_times1", _)) => ()
55.1189 WN060905*)
55.1190 -case tac of Some (Rewrite ("sym_real_add_mult_distrib2", _)) => ()
55.1191 +case tac of SOME (Rewrite ("sym_real_add_mult_distrib2", _)) => ()
55.1192 | _ => raise error "rational.sml: getTactic, sym_real_plus_binom_times1";
55.1193
55.1194
55.1195 @@ -1907,27 +1907,27 @@
55.1196 val t = str2term "(a^^^2 + -1*b^^^2) / (a^^^2 + -2*a*b + b^^^2)";
55.1197 val tt = str2term "(1 * a + 1 * b) * (1 * a + -1 * b)"(*numerator only*);
55.1198 "----- with rewrite_set_";
55.1199 -val Some (tt',asm) = rewrite_set_ thy false make_polynomial tt;
55.1200 +val SOME (tt',asm) = rewrite_set_ thy false make_polynomial tt;
55.1201 term2str tt'= "a ^^^ 2 + -1 * b ^^^ 2" (*true*);
55.1202 val tt = str2term "((1 * a + -1 * b) * (1 * a + -1 * b))"(*denominator only*);
55.1203 -val Some (tt',asm) = rewrite_set_ thy false make_polynomial tt;
55.1204 +val SOME (tt',asm) = rewrite_set_ thy false make_polynomial tt;
55.1205 term2str tt' = "a ^^^ 2 + -2 * a * b + b ^^^ 2" (*true*);
55.1206
55.1207 "----- with make_deriv";
55.1208 -val Some (tt, _) = factout_p_ Isac.thy t; term2str tt =
55.1209 +val SOME (tt, _) = factout_p_ Isac.thy t; term2str tt =
55.1210 "(1 * a + 1 * b) * (1 * a + -1 * b) / ((1 * a + -1 * b) * (1 * a + -1 * b))";
55.1211 (*
55.1212 "--- with ruleset as before 060829";
55.1213 val {rules, rew_ord=(_,ro),...} =
55.1214 rep_rls (assoc_rls "make_polynomial");
55.1215 -val der = make_deriv thy Atools_erls rules ro None tt;
55.1216 +val der = make_deriv thy Atools_erls rules ro NONE tt;
55.1217 print_depth 99; map (term2str o #1) der; print_depth 3;
55.1218 print_depth 99; map (rule2str o #2) der; print_depth 3;
55.1219 ... did not terminate"*)
55.1220 "--- with simpler ruleset";
55.1221 val {rules, rew_ord=(_,ro),...} =
55.1222 rep_rls (assoc_rls "rev_rew_p");
55.1223 -val der = make_deriv thy Atools_erls rules ro None tt;
55.1224 +val der = make_deriv thy Atools_erls rules ro NONE tt;
55.1225 print_depth 99; writeln (deriv2str der); print_depth 3;
55.1226
55.1227 print_depth 99; map (term2str o #1) der; print_depth 3;
55.1228 @@ -1935,13 +1935,13 @@
55.1229 print_depth 99; map (rule2str o #2) der; print_depth 3;
55.1230 print_depth 99; map (term2str o #1 o #3) der; print_depth 3;
55.1231
55.1232 -val der = make_deriv thy Atools_erls rules ro None
55.1233 +val der = make_deriv thy Atools_erls rules ro NONE
55.1234 (str2term "(1 * a + 1 * b) * (1 * a + -1 * b)");
55.1235 print_depth 99; writeln (deriv2str der); print_depth 3;
55.1236
55.1237 val {rules, rew_ord=(_,ro),...} =
55.1238 rep_rls (assoc_rls "rev_rew_p");
55.1239 -val der = make_deriv thy Atools_erls rules ro None
55.1240 +val der = make_deriv thy Atools_erls rules ro NONE
55.1241 (str2term "(1 * a + -1 * b) * (1 * a + -1 * b)");
55.1242 print_depth 99; writeln (deriv2str der); print_depth 3;
55.1243 print_depth 99; map (term2str o #1) der; print_depth 3;
55.1244 @@ -1957,21 +1957,21 @@
55.1245
55.1246 "----- see Rational.ML, local cancel_p, fun init_state";
55.1247 val t = str2term "(a^^^2 + (-1)*b^^^2) / (a^^^2 + (-2)*a*b + b^^^2)";
55.1248 -val Some (t',_) = factout_p_ thy t; term2str t';
55.1249 +val SOME (t',_) = factout_p_ thy t; term2str t';
55.1250 (*
55.1251 -val rtas = reverse_deriv thy eval_rls rules ro None t';
55.1252 +val rtas = reverse_deriv thy eval_rls rules ro NONE t';
55.1253 writeln(trtas2str rst);
55.1254 *)
55.1255
55.1256
55.1257 "----- see Rational.ML, local cancel_p, fun init_state";
55.1258 val t = str2term "a^^^2 / a";
55.1259 -val Some (t',_) = factout_p_ thy t;
55.1260 +val SOME (t',_) = factout_p_ thy t;
55.1261 term2str t' = "a * a / (1 * a)" (*true*);
55.1262 (*... can be canceled with
55.1263 real_mult_div_cancel2 ?k ~= 0 ==> ?m * ?k / (?n * ?k) = ?m / ?n"*)
55.1264 (* sml/ME/rewtools.sml:
55.1265 -val rtas = reverse_deriv thy Atools_erls rules ro None t';
55.1266 +val rtas = reverse_deriv thy Atools_erls rules ro NONE t';
55.1267 writeln (deri2str rtas);
55.1268 *)
55.1269
55.1270 @@ -1983,26 +1983,26 @@
55.1271 "----- order on polynomials -- input + output";
55.1272 val thy = Isac.thy;
55.1273 val t = str2term "(a + -1 * b) / (-1 * a + b)";
55.1274 -val Some (t', _) = factout_p_ thy t; term2str t';
55.1275 -val Some (t', _) = cancel_p_ thy t; term2str t';
55.1276 +val SOME (t', _) = factout_p_ thy t; term2str t';
55.1277 +val SOME (t', _) = cancel_p_ thy t; term2str t';
55.1278
55.1279 val t = str2term "a*b*c*d / (d*e*f*g)";
55.1280 -val Some (t', _) = cancel_p_ thy t; term2str t';
55.1281 +val SOME (t', _) = cancel_p_ thy t; term2str t';
55.1282
55.1283 val t = str2term "a*(b*(c*d)) / (b*(e*(f*g)))";
55.1284 -val Some (t', _) = cancel_p_ thy t; term2str t';
55.1285 +val SOME (t', _) = cancel_p_ thy t; term2str t';
55.1286 (*???order.SK ???*)
55.1287
55.1288 "----- SK060904-1a non-termination of cancel_p_ ? worked before 0707xx";
55.1289 val t = str2term "(x^^^2 - 4)*(3 - y) / ((y^^^2 - 9)*(2+x))";
55.1290 -val Some (t',_) = rewrite_set_ thy false norm_Rational t;
55.1291 +val SOME (t',_) = rewrite_set_ thy false norm_Rational t;
55.1292 if term2str t' = "(2 + -1 * x) / (3 + y)" then ()
55.1293 else raise error "rational.sml SK060904-1a worked since 0707xx";
55.1294
55.1295 "----- SK060904-1b non-termination of cancel_p_ ... worked before 0707xx";
55.1296 val t = str2term "(9 * a ^^^ 2 + -16 * b ^^^ 2) /\
55.1297 \(36 * a^^^2 * c + (27 * a^^^2 * e + (-64 * b^^^2 * c + -48 * b^^^2 * e)))";
55.1298 -val Some (t',_) = cancel_p_ thy t;
55.1299 +val SOME (t',_) = cancel_p_ thy t;
55.1300 if term2str t' = "1 / (4 * c + 3 * e)" then ()
55.1301 else raise error "rational.sml SK060904-1b";
55.1302
55.1303 @@ -2011,7 +2011,7 @@
55.1304 val t = str2term " (a + b * x) / (a + -1 * (b * x)) + \
55.1305 \ (-1 * a + b * x) / (a + b * x) ";
55.1306 (* nonterm.SK
55.1307 -val Some (t',_) = rewrite_set_ thy false common_nominator_p t;
55.1308 +val SOME (t',_) = rewrite_set_ thy false common_nominator_p t;
55.1309
55.1310 common_nominator_p_ thy t;
55.1311 " (a + b * x)*(a + b * x) / ((a + -1 * (b * x))*(a + -1 * (b * x))) + \
56.1 --- a/test/Tools/isac/IsacKnowledge/rlang.sml Wed Aug 18 13:53:15 2010 +0200
56.2 +++ b/test/Tools/isac/IsacKnowledge/rlang.sml Wed Aug 18 13:55:23 2010 +0200
56.3 @@ -203,13 +203,13 @@
56.4 val bdv= (term_of o the o (parse thy)) "bdv";
56.5 val v = (term_of o the o (parse thy)) "x";
56.6 val t = (term_of o the o (parse thy)) "3 * x / 5";
56.7 -val Some (t',_) = rewrite_set_inst_ PolyEq.thy true
56.8 +val SOME (t',_) = rewrite_set_inst_ PolyEq.thy true
56.9 [(bdv, v)] make_ratpoly_in t;
56.10 if term2str t' = "3 / 5 * x" then () else raise error "rlang.sml: 1";
56.11
56.12 val t = str2term "(3*x+5)/18 - x/2 - -(3*x - 2)/9 = 0";
56.13 val subst = [(str2term "bdv", str2term "x")];
56.14 -val Some (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.15 +val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.16 if term2str t' = "1 / 18 = 0" then () else raise error "rlang.sml: 2";
56.17 (*WN---^ *)
56.18
56.19 @@ -246,7 +246,7 @@
56.20 (*WN---v *)
56.21 val t = str2term "(17*x - 51)/9 - (-(13*x - 3)/6) + 11 - (9*x - 7)/4 = 0";
56.22 val subst = [(str2term "bdv", str2term "x")];
56.23 -val Some (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.24 +val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.25 term2str t';
56.26 if term2str t' = "79 / 12 + 65 / 36 * x = 0" then ()
56.27 else raise error "rlang.sml: 3";
56.28 @@ -370,13 +370,13 @@
56.29 (*WN---v *)
56.30 val t = str2term "(1/2 + (5*x)/2)^^^2 - ((13*x)/2 - 5/2)^^^2 - (6*x)^^^2 + 29";
56.31 val subst = [(str2term "bdv", str2term "x")];
56.32 -val Some (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.33 +val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.34 if term2str t' = "23 + 35 * x + -72 * x ^^^ 2" then ()
56.35 else raise error "rlang.sml: 4";
56.36
56.37 val t = str2term "(1/2 + (5*x)/2)^^^2 - ((13*x)/2 - 5/2)^^^2 + (6*x)^^^2 - 29";
56.38 val subst = [(str2term "bdv", str2term "x")];
56.39 -val Some (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.40 +val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.41 if term2str t' = "-35 + 35 * x" then ()
56.42 else raise error "rlang.sml: 4.1";
56.43 (*WN---^ *)
56.44 @@ -1536,7 +1536,7 @@
56.45
56.46 val t = str2term"(a + b * x) / (a + -1 * (b * x)) + -1 * (a + -1 * (b * x)) / (a + b * x) =\n4 * a * b / (a ^^^ 2 + -1 * b ^^^ 2)";
56.47 trace_rewrite:=true;
56.48 -val Some (t',asm) = rewrite_set_ thy false norm_Rational t;
56.49 +val SOME (t',asm) = rewrite_set_ thy false norm_Rational t;
56.50 term2str t';
56.51 trace_rewrite:=false;
56.52
56.53 @@ -1730,7 +1730,7 @@
56.54 normiert nicht ... korr.WN:
56.55 val t = str2term "(2*x+1)*x^^^2 = 0";
56.56 val subst = [(str2term "bdv", str2term "x")];
56.57 -val Some (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.58 +val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
56.59 if term2str t' = "x ^^^ 2 + 2 * x ^^^ 3 = 0" then ()
56.60 else raise error "rlang.sml: 7";
56.61 *)
56.62 @@ -1754,7 +1754,7 @@
56.63 > trace_rewrite:=true;
56.64 > val t = str2term
56.65 "(3 + -1 * x + 1 * x ^^^ 2) / (9 * x + -6 * x ^^^ 2 + 1 * x ^^^ 3) = 1 / x";
56.66 -> val Some (t',asm) =
56.67 +> val SOME (t',asm) =
56.68 rewrite_ thy dummy_ord rateq_erls true rat_mult_denominator_both t;
56.69 > term2str t'; terms2str asm;
56.70 "(3 + -1 * x + 1 * x ^^^ 2) * x = 1 * (9 * x + -6 * x ^^^ 2 + 1 * x ^^^ 3)"
57.1 --- a/test/Tools/isac/IsacKnowledge/root.sml Wed Aug 18 13:53:15 2010 +0200
57.2 +++ b/test/Tools/isac/IsacKnowledge/root.sml Wed Aug 18 13:55:23 2010 +0200
57.3 @@ -4,12 +4,12 @@
57.4 val thy = Root.thy;
57.5
57.6 val t = str2term "sqrt 1";
57.7 -val Some (t',_) = rewrite_set_ thy false Root_erls t;
57.8 +val SOME (t',_) = rewrite_set_ thy false Root_erls t;
57.9 if term2str t' = "1" then () else raise error "root.sml: diff.behav. sqrt 1";
57.10 val t = str2term "sqrt -1";
57.11 -val None = rewrite_set_ thy false Root_erls t;
57.12 +val NONE = rewrite_set_ thy false Root_erls t;
57.13
57.14 val t = str2term "sqrt 0";
57.15 -val Some (t',_) = rewrite_set_ thy false Root_erls t;
57.16 +val SOME (t',_) = rewrite_set_ thy false Root_erls t;
57.17 term2str t';
57.18 if term2str t' = "0" then () else raise error "root.sml: diff.behav. sqrt 1";
58.1 --- a/test/Tools/isac/IsacKnowledge/rooteq.sml Wed Aug 18 13:53:15 2010 +0200
58.2 +++ b/test/Tools/isac/IsacKnowledge/rooteq.sml Wed Aug 18 13:55:23 2010 +0200
58.3 @@ -16,62 +16,62 @@
58.4 "--------------(sqrt(x+1)+sqrt(4*x+4)=sqrt(9*x+9))-----------------";
58.5
58.6 val t = (term_of o the o (parse RootEq.thy)) "(sqrt(2+x+3)) is_rootTerm_in x";
58.7 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.8 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.9 val result = term2str t_;
58.10 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.11
58.12 val t = (term_of o the o (parse RootEq.thy)) "(sqrt(2+x+3)) is_rootTerm_in x";
58.13 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.14 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.15 val result = term2str t_;
58.16 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.17
58.18 val t = (term_of o the o (parse RootEq.thy)) "(nroot 5 (x+4)) is_rootTerm_in x";
58.19 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.20 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.21 val result = term2str t_;
58.22 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.23
58.24 val t = (term_of o the o (parse RootEq.thy)) "(sqrt(2+x+3)) is_sqrtTerm_in x";
58.25 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.26 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.27 val result = term2str t_;
58.28 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.29
58.30 val t = (term_of o the o (parse RootEq.thy)) "(sqrt(25)) is_sqrtTerm_in x";
58.31 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.32 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.33 val result = term2str t_;
58.34 if result <> "False" then raise error "rooteq.sml: new behaviour:" else ();
58.35
58.36 val t = (term_of o the o (parse RootEq.thy)) "sqrt(1 + x) is_normSqrtTerm_in x";
58.37 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.38 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.39 val result = term2str t_;
58.40 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.41
58.42 val t = (term_of o the o (parse RootEq.thy)) "(3+3*sqrt(x)) is_normSqrtTerm_in x";
58.43 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.44 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.45 val result = term2str t_;
58.46 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.47
58.48 val t = (term_of o the o (parse RootEq.thy)) "(sqrt(x+1)+1) is_normSqrtTerm_in x";
58.49 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.50 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.51 val result = term2str t_;
58.52 if result <> "False" then raise error "rooteq.sml: new behaviour:" else ();
58.53
58.54 val t = (term_of o the o (parse RootEq.thy)) "(1 - u/(sqrt(r - u))) is_normSqrtTerm_in u";
58.55 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.56 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.57 val result = term2str t_;
58.58 if result <> "False" then raise error "rooteq.sml: new behaviour:" else ();
58.59
58.60 val t = (term_of o the o (parse RootEq.thy)) "(x*(1+x)/(sqrt(x+1))) is_normSqrtTerm_in x";
58.61 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.62 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.63 val result = term2str t_;
58.64 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.65
58.66 val t = (term_of o the o (parse RootEq.thy)) "(1 - (sqrt(2+x+3)^^^3)) is_normSqrtTerm_in x";
58.67 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.68 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.69 val result = term2str t_;
58.70 if result <> "False" then raise error "rooteq.sml: new behaviour:" else ();
58.71
58.72 val t = (term_of o the o (parse RootEq.thy)) "(1 + (sqrt(2+x+3)^^^3)) is_normSqrtTerm_in x";
58.73 -val Some(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.74 +val SOME(t_, _) = rewrite_set_ RootEq.thy false RootEq_prls t;
58.75 val result = term2str t_;
58.76 if result <> "True" then raise error "rooteq.sml: new behaviour:" else ();
58.77
59.1 --- a/test/Tools/isac/IsacKnowledge/rootrateq.sml Wed Aug 18 13:53:15 2010 +0200
59.2 +++ b/test/Tools/isac/IsacKnowledge/rootrateq.sml Wed Aug 18 13:55:23 2010 +0200
59.3 @@ -13,37 +13,37 @@
59.4 trace_rewrite:=false;
59.5 *)
59.6 val t1 = (term_of o the o (parse thy)) "(-8 - sqrt(x) + x^^^2) is_rootRatAddTerm_in x";
59.7 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.8 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.9 if (term2str t) = "False" then ()
59.10 else raise error "rootrateq.sml: diff.behav. 1 in is_rootRatAddTerm_in";
59.11
59.12 val t1 = (term_of o the o (parse thy)) "(1/x) is_rootRatAddTerm_in x";
59.13 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.14 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.15 if (term2str t) = "False" then ()
59.16 else raise error "rootrateq.sml: diff.behav. 2 in is_rootRatAddTerm_in";
59.17
59.18 val t1 = (term_of o the o (parse thy)) "(1/sqrt(x)) is_rootRatAddTerm_in x";
59.19 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.20 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.21 if (term2str t) = "False" then ()
59.22 else raise error "rootrateq.sml: diff.behav. 3 in is_rootRatAddTerm_in";
59.23
59.24 val t1 = (term_of o the o (parse thy)) "(1/(sqrt(x)+1)) is_rootRatAddTerm_in x";
59.25 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.26 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.27 if (term2str t) = "True" then ()
59.28 else raise error "rootrateq.sml: diff.behav. 4 in is_rootRatAddTerm_in";
59.29
59.30 val t1 = (term_of o the o (parse thy)) "(3 + 1/(1+sqrt(x))) is_rootRatAddTerm_in x";
59.31 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.32 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.33 if (term2str t) = "True" then ()
59.34 else raise error "rootrateq.sml: diff.behav. 5 in is_rootRatAddTerm_in";
59.35
59.36 val t1 = (term_of o the o (parse thy)) "(1/(1+sqrt(y)) + 3 + 1/(1+sqrt(x))) is_rootRatAddTerm_in x";
59.37 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.38 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.39 if (term2str t) = "True" then ()
59.40 else raise error "rootrateq.sml: diff.behav. 6 in is_rootRatAddTerm_in";
59.41
59.42 val t1 = (term_of o the o (parse thy)) "(1/(1+sqrt(x)) + 3 + 1/(1+sqrt(y))) is_rootRatAddTerm_in x";
59.43 -val Some (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.44 +val SOME (t,_) = rewrite_set_ RootRatEq.thy false RootRatEq_prls t1;
59.45 if (term2str t) = "True" then ()
59.46 else raise error "rootrateq.sml: diff.behav. 7 in is_rootRatAddTerm_in";
59.47
60.1 --- a/test/Tools/isac/IsacKnowledge/system.sml Wed Aug 18 13:53:15 2010 +0200
60.2 +++ b/test/Tools/isac/IsacKnowledge/system.sml Wed Aug 18 13:55:23 2010 +0200
60.3 @@ -21,14 +21,14 @@
60.4 "----------- normalize system ------------------------------------";
60.5 val t = str2term "[0 = c*0 + -1*q_0*(0^^^2 / 2) + c_2,\
60.6 \ 0 = c*L + -1*q_0*(L^^^2 / 2) + c_2]";
60.7 -val Some (t,_) = rewrite_set_ thy false norm_Poly t;
60.8 +val SOME (t,_) = rewrite_set_ thy false norm_Poly t;
60.9 if term2str t =
60.10 "[0 = -1 * q_0 * (0 / 2) + c_2, 0 = L * c + -1 * q_0 * (L ^^^ 2 / 2) + c_2]"
60.11 then () else raise error "system.sml, diff.behav. in norm_Poly";
60.12
60.13 val t = str2term "[0 = c*0 + -1*q_0*(0^^^2 / 2) + c_2,\
60.14 \ 0 = c*L + -1*q_0*(L^^^2 / 2) + c_2]";
60.15 -val Some (t,_) = rewrite_set_ thy false norm_Rational t;
60.16 +val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
60.17 if term2str t =
60.18 "[0 = c_2, 0 = (2 * c_2 + 2 * L * c + -1 * L ^^^ 2 * q_0) / 2]"
60.19 then () else raise error "system.sml, diff.behav. in norm_Rational";
60.20 @@ -36,7 +36,7 @@
60.21
60.22 val t = str2term "nth_ 1 [0 = c*0 + -1*q_0*(0^^^2 / 2) + c_2,\
60.23 \ 0 = c*L + -1*q_0*(L^^^2 / 2) + c_2]";
60.24 -val Some (t,_) = rewrite_set_ thy false list_rls t;
60.25 +val SOME (t,_) = rewrite_set_ thy false list_rls t;
60.26 if term2str t = "0 = c * 0 + -1 * q_0 * (0 ^^^ 2 / 2) + c_2"
60.27 then () else raise error "system.sml, list_rls";
60.28
61.1 --- a/test/Tools/isac/IsacKnowledge/termorder.sml Wed Aug 18 13:53:15 2010 +0200
61.2 +++ b/test/Tools/isac/IsacKnowledge/termorder.sml Wed Aug 18 13:55:23 2010 +0200
61.3 @@ -44,17 +44,17 @@
61.4 val x = (term_of o the o (parse thy)) "x";
61.5 val a = (term_of o the o (parse thy)) "a";
61.6 val b = (term_of o the o (parse thy)) "b";
61.7 - val Some (t',_) =
61.8 + val SOME (t',_) =
61.9 rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in x2;
61.10 if term2str t' = "b + x + a" then ()
61.11 else raise error "termorder.sml diff.behav ord_make_polynomial_in #11";
61.12
61.13 - val None =
61.14 + val NONE =
61.15 rewrite_set_inst_ thy false [(bdv,b)] make_polynomial_in x2;
61.16 term2str t';
61.17 "a + x + b";
61.18
61.19 - val Some (t',_) =
61.20 + val SOME (t',_) =
61.21 rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in x2;
61.22 if term2str t' = "a + b + x" then ()
61.23 else raise error "termorder.sml diff.behav ord_make_polynomial_in #13";
61.24 @@ -63,7 +63,7 @@
61.25
61.26 val ppp' = "-6 + -5*x + x^^^3 + -1*x^^^2 + -1*x^^^3 + -14*x^^^2";
61.27 val ppp = (term_of o the o (parse thy)) ppp';
61.28 - val Some (t',_) =
61.29 + val SOME (t',_) =
61.30 rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in ppp;
61.31 (*MG 2003...
61.32 term2str t';
61.33 @@ -71,7 +71,7 @@
61.34 if term2str t' = "-6 + -5 * x + -15 * x ^^^ 2 + 0" then ()
61.35 else raise error "termorder.sml diff.behav ord_make_polynomial_in #14";
61.36
61.37 - val Some (t',_) =
61.38 + val SOME (t',_) =
61.39 rewrite_set_inst "Isac.thy"false [("bdv","x")] "make_polynomial_in" ppp';
61.40 (*MG 2003...
61.41 "(-6) + (-5 * x + (-15) * x ^^^ 2)";*)
61.42 @@ -80,12 +80,12 @@
61.43
61.44 val ttt' = "(3*x + 5)/18";
61.45 val ttt = (term_of o the o (parse thy)) ttt';
61.46 - val Some (uuu,_) =
61.47 + val SOME (uuu,_) =
61.48 rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in ttt;
61.49 if term2str uuu = "(5 + 3 * x) / 18" then ()
61.50 else raise error "termorder.sml diff.behav ord_make_polynomial_in #16";
61.51
61.52 - val Some (uuu,_) =
61.53 + val SOME (uuu,_) =
61.54 rewrite_set_ thy false make_polynomial ttt;
61.55 if term2str uuu = "(5 + 3 * x) / 18" then ()
61.56 else raise error "termorder.sml diff.behav ord_make_polynomial_in #16";
61.57 @@ -98,10 +98,10 @@
61.58 (*Aufgabe zum Einstieg in die Arbeit...*)
61.59 val t = (term_of o the o (parse thy)) "a*b - (a+b)*x + x^^^2 = 0";
61.60 (*ein 'ruleset' aus Poly.ML wird angewandt...*)
61.61 - val Some (t,_) = rewrite_set_ thy Poly_erls false make_polynomial t;
61.62 + val SOME (t,_) = rewrite_set_ thy Poly_erls false make_polynomial t;
61.63 term2str t;
61.64 "a * b + (-1 * (a * x) + (-1 * (b * x) + x ^^^ 2)) = 0";
61.65 - val Some (t,_) =
61.66 + val SOME (t,_) =
61.67 rewrite_set_inst_ thy Poly_erls false [("bdv","a")] make_polynomial_in t;
61.68 term2str t;
61.69 "x ^^^ 2 + (-1 * (b * x) + (-1 * (x * a) + b * a)) = 0";
61.70 @@ -109,12 +109,12 @@
61.71 (*"x ^^^ 2 + (-1 * (b * x) + (b * a + -1 * (x * a))) = 0" !!! *)
61.72
61.73 (*wir holen 'a' wieder aus der Klammerung heraus...*)
61.74 - val Some (t,_) = rewrite_set_ thy Poly_erls false discard_parentheses t;
61.75 + val SOME (t,_) = rewrite_set_ thy Poly_erls false discard_parentheses t;
61.76 term2str t;
61.77 "x ^^^ 2 + -1 * b * x + -1 * x * a + b * a = 0";
61.78 (* "x ^^^ 2 + -1 * b * x + b * a + -1 * x * a = 0" !!! *)
61.79
61.80 - val Some (t,_) =
61.81 + val SOME (t,_) =
61.82 rewrite_set_inst_ thy Poly_erls false [("bdv","a")] make_polynomial_in t;
61.83 term2str t;
61.84 "x ^^^ 2 + (-1 * (b * x) + a * (b + -1 * x)) = 0";
61.85 @@ -134,28 +134,28 @@
61.86
61.87 trace_rewrite:=true;
61.88 (* Anwenden einer Regelmenge aus Termorder.ML: *)
61.89 - val Some (t,_) =
61.90 + val SOME (t,_) =
61.91 rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
61.92 term2str t;
61.93 - val Some (t,_) =
61.94 + val SOME (t,_) =
61.95 rewrite_set_ thy false discard_parentheses t;
61.96 term2str t;
61.97 "1 + b * x + x * a";
61.98
61.99 val t = (term_of o the o (parse thy)) "1 + a * (x + b * x) + a^^^2";
61.100 - val Some (t,_) =
61.101 + val SOME (t,_) =
61.102 rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
61.103 term2str t;
61.104 - val Some (t,_) =
61.105 + val SOME (t,_) =
61.106 rewrite_set_ thy false discard_parentheses t;
61.107 term2str t;
61.108 "1 + (x + b * x) * a + a ^^^ 2";
61.109
61.110 val t = (term_of o the o (parse thy)) "1 + a ^^^2 * x + b * a + 7*a^^^2";
61.111 - val Some (t,_) =
61.112 + val SOME (t,_) =
61.113 rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
61.114 term2str t;
61.115 - val Some (t,_) =
61.116 + val SOME (t,_) =
61.117 rewrite_set_ thy false discard_parentheses t;
61.118 term2str t;
61.119 "1 + b * a + (7 + x) * a ^^^ 2";
61.120 @@ -177,10 +177,10 @@
61.121
61.122 *)
61.123 val t = (term_of o the o (parse thy)) "a ^^^2 * x + 7 * a^^^2";
61.124 - val Some (t,_) =
61.125 + val SOME (t,_) =
61.126 rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
61.127 term2str t;
61.128 - val Some (t,_) =
61.129 + val SOME (t,_) =
61.130 rewrite_set_ thy false discard_parentheses t;
61.131 term2str t;
61.132 "(7 + x) * a ^^^ 2";
62.1 --- a/test/Tools/isac/ME/ctree.sml Wed Aug 18 13:53:15 2010 +0200
62.2 +++ b/test/Tools/isac/ME/ctree.sml Wed Aug 18 13:55:23 2010 +0200
62.3 @@ -744,8 +744,8 @@
62.4 let val (dI, pI, _) = get_somespec' spec spec'
62.5 val {cas,...} = get_pbt pI
62.6 in case cas of
62.7 - None => term2str (pblterm dI pI)
62.8 - | Some t => term2str (subst_atomic (mk_env probl) t)
62.9 + NONE => term2str (pblterm dI pI)
62.10 + | SOME t => term2str (subst_atomic (mk_env probl) t)
62.11 end;
62.12 *)
62.13 (*.get an 'interval' from ptree down to a certain level
62.14 @@ -863,7 +863,7 @@
62.15 "-------------- pt_extract form, tac, asm<>[] --------------------";
62.16 "-------------- pt_extract form, tac, asm<>[] --------------------";
62.17 "-------------- pt_extract form, tac, asm<>[] --------------------";
62.18 -val (Form form, Some tac, asm) = pt_extract (pt, ([3], Res));
62.19 +val (Form form, SOME tac, asm) = pt_extract (pt, ([3], Res));
62.20 case (term2str form, tac, terms2strs asm) of
62.21 ("(3 + -1 * x + x ^^^ 2) * x = 1 * (9 * x + -6 * x ^^^ 2 + x ^^^ 3)",
62.22 Subproblem
62.23 @@ -903,57 +903,57 @@
62.24 "-------------- pt_extract form, tac, asm ------------------------";
62.25 "-------------- pt_extract form, tac, asm ------------------------";
62.26 "-------------- pt_extract form, tac, asm ------------------------";
62.27 -val (ModSpec (_,_,form,_,_,_), Some tac, asm) = pt_extract (pt, ([], Frm));
62.28 +val (ModSpec (_,_,form,_,_,_), SOME tac, asm) = pt_extract (pt, ([], Frm));
62.29 case (term2str form, tac, terms2strs asm) of
62.30 ("solve (x + 1 = 2, x)",
62.31 Apply_Method ["Test", "squ-equ-test-subpbl1"],
62.32 []) => ()
62.33 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([], Pbl)";
62.34
62.35 -val (Form form, Some tac, asm) = pt_extract (pt, ([1], Frm));
62.36 +val (Form form, SOME tac, asm) = pt_extract (pt, ([1], Frm));
62.37 case (term2str form, tac, terms2strs asm) of
62.38 ("x + 1 = 2", Rewrite_Set "norm_equation", []) => ()
62.39 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([1], Frm)";
62.40
62.41 -val (Form form, Some tac, asm) = pt_extract (pt, ([1], Res));
62.42 +val (Form form, SOME tac, asm) = pt_extract (pt, ([1], Res));
62.43 case (term2str form, tac, terms2strs asm) of
62.44 ("x + 1 + -1 * 2 = 0", Rewrite_Set "Test_simplify", []) => ()
62.45 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([1], Res)";
62.46
62.47 -val (Form form, Some tac, asm) = pt_extract (pt, ([2], Res));
62.48 +val (Form form, SOME tac, asm) = pt_extract (pt, ([2], Res));
62.49 case (term2str form, tac, terms2strs asm) of
62.50 ("-1 + x = 0",
62.51 Subproblem ("Test.thy", ["linear", "univariate", "equation", "test"]),
62.52 []) => ()
62.53 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([2], Res)";
62.54
62.55 -val (ModSpec (_,_,form,_,_,_), Some tac, asm) = pt_extract (pt, ([3], Pbl));
62.56 +val (ModSpec (_,_,form,_,_,_), SOME tac, asm) = pt_extract (pt, ([3], Pbl));
62.57 case (term2str form, tac, terms2strs asm) of
62.58 ("solve (-1 + x = 0, x)", Apply_Method ["Test", "solve_linear"], []) => ()
62.59 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([3], Pbl)";
62.60
62.61 -val (Form form, Some tac, asm) = pt_extract (pt, ([3,1], Frm));
62.62 +val (Form form, SOME tac, asm) = pt_extract (pt, ([3,1], Frm));
62.63 case (term2str form, tac, terms2strs asm) of
62.64 ("-1 + x = 0", Rewrite_Set_Inst (["(bdv, x)"], "isolate_bdv"), []) => ()
62.65 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([3,1], Frm)";
62.66
62.67 -val (Form form, Some tac, asm) = pt_extract (pt, ([3,1], Res));
62.68 +val (Form form, SOME tac, asm) = pt_extract (pt, ([3,1], Res));
62.69 case (term2str form, tac, terms2strs asm) of
62.70 ("x = 0 + -1 * -1", Rewrite_Set "Test_simplify", []) => ()
62.71 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([3,1], Res)";
62.72
62.73 -val (Form form, Some tac, asm) = pt_extract (pt, ([3,2], Res));
62.74 +val (Form form, SOME tac, asm) = pt_extract (pt, ([3,2], Res));
62.75 case (term2str form, tac, terms2strs asm) of
62.76 ("x = 1", Check_Postcond ["linear", "univariate", "equation", "test"],
62.77 []) => ()
62.78 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([3,2], Res)";
62.79
62.80 -val (Form form, Some tac, asm) = pt_extract (pt, ([3], Res));
62.81 +val (Form form, SOME tac, asm) = pt_extract (pt, ([3], Res));
62.82 case (term2str form, tac, terms2strs asm) of
62.83 ("[x = 1]", Check_elementwise "Assumptions", []) => ()
62.84 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([3], Res)";
62.85
62.86 -val (Form form, Some tac, asm) = pt_extract (pt, ([4], Res));
62.87 +val (Form form, SOME tac, asm) = pt_extract (pt, ([4], Res));
62.88 case (term2str form, tac, terms2strs asm) of
62.89 ("[x = 1]",
62.90 Check_Postcond ["sqroot-test", "univariate", "equation", "test"],
62.91 @@ -962,7 +962,7 @@
62.92
62.93 val (Form form, tac, asm) = pt_extract (pt, ([], Res));
62.94 case (term2str form, tac, terms2strs asm) of
62.95 - ("[x = 1]", None, []) => ()
62.96 + ("[x = 1]", NONE, []) => ()
62.97 | _ => raise error "diff.behav.in ctree.sml: pt_extract ([], Res)";
62.98
62.99 "=====new ptree 6 minisubpbl intersteps ==========================";
63.1 --- a/test/Tools/isac/ME/inform.sml Wed Aug 18 13:53:15 2010 +0200
63.2 +++ b/test/Tools/isac/ME/inform.sml Wed Aug 18 13:55:23 2010 +0200
63.3 @@ -103,13 +103,13 @@
63.4 "----------------------------------------------------------";
63.5 val fod = make_deriv Isac.thy Atools_erls
63.6 ((#rules o rep_rls) Test_simplify)
63.7 - (sqrt_right false ProtoPure.thy) None
63.8 + (sqrt_right false ProtoPure.thy) NONE
63.9 (str2term "x + 1 + -1 * 2 = 0");
63.10 (writeln o trtas2str) fod;
63.11
63.12 val ifod = make_deriv Isac.thy Atools_erls
63.13 ((#rules o rep_rls) Test_simplify)
63.14 - (sqrt_right false ProtoPure.thy) None
63.15 + (sqrt_right false ProtoPure.thy) NONE
63.16 (str2term "-2 * 1 + (1 + x) = 0");
63.17 (writeln o trtas2str) ifod;
63.18 fun equal (_,_,(t1, _)) (_,_,(t2, _)) = t1=t2;
63.19 @@ -517,8 +517,8 @@
63.20 (*5>*)replaceFormula 1 "Diff (x^2 + x + 1, x)";
63.21 val ((pt,_),_) = get_calc 1;
63.22 val PblObj {probl, meth, spec, fmz, env, loc, ...} = get_obj I pt [];
63.23 -val None = env;
63.24 -val (Some istate, None) = loc;
63.25 +val NONE = env;
63.26 +val (SOME istate, NONE) = loc;
63.27 print_depth 5;
63.28 writeln"-----------------------------------------------------------";
63.29 spec;
63.30 @@ -537,11 +537,11 @@
63.31 val ((pt,p),_) = get_calc 1;
63.32 (*val p = ([], Pbl)*)
63.33 val PblObj {probl, meth, spec, fmz, env, loc, ...} = get_obj I pt [];
63.34 -val None = env;
63.35 -val (Some istate, None) = loc;
63.36 +val NONE = env;
63.37 +val (SOME istate, NONE) = loc;
63.38 print_depth 5; writeln (istate2str istate); print_depth 3;
63.39 (*ScrState ([],
63.40 - [], None,
63.41 + [], NONE,
63.42 ??.empty, Sundef, false)*)
63.43 print_depth 5; spec; print_depth 3;
63.44 (*("Isac.thy",
63.45 @@ -582,11 +582,11 @@
63.46 (***difference II***)
63.47 val ((pt,_),_) = get_calc 1;
63.48 val PblObj {probl, meth, spec, fmz, env, loc, ...} = get_obj I pt [];
63.49 -val None = env;
63.50 -val (Some istate, None) = loc;
63.51 +val NONE = env;
63.52 +val (SOME istate, NONE) = loc;
63.53 print_depth 5; writeln (istate2str istate); print_depth 3;
63.54 (*ScrState ([],
63.55 - [], None,
63.56 + [], NONE,
63.57 ??.empty, Sundef, false)*)
63.58 print_depth 5; spec; print_depth 3;
63.59 (*("Isac.thy",
64.1 --- a/test/Tools/isac/ME/ptyps.sml Wed Aug 18 13:53:15 2010 +0200
64.2 +++ b/test/Tools/isac/ME/ptyps.sml Wed Aug 18 13:55:23 2010 +0200
64.3 @@ -39,35 +39,35 @@
64.4 store_pbt
64.5 (prep_pbt DiffApp.thy "pbl_pbla" [] e_pblID
64.6 (["pbla"],
64.7 - [("#Given", ["fixedValues a_"])], e_rls, None, []));
64.8 + [("#Given", ["fixedValues a_"])], e_rls, NONE, []));
64.9 store_pbt
64.10 (prep_pbt DiffApp.thy "pbl_pbla1" [] e_pblID
64.11 (["pbla1","pbla"],
64.12 - [("#Given", ["fixedValues a_","maximum a1_"])], e_rls, None, []));
64.13 + [("#Given", ["fixedValues a_","maximum a1_"])], e_rls, NONE, []));
64.14 store_pbt
64.15 (prep_pbt DiffApp.thy "pbl_pbla2" [] e_pblID
64.16 (["pbla2","pbla"],
64.17 - [("#Given", ["fixedValues a_","valuesFor a2_"])], e_rls, None, []));
64.18 + [("#Given", ["fixedValues a_","valuesFor a2_"])], e_rls, NONE, []));
64.19 store_pbt
64.20 (prep_pbt DiffApp.thy "pbl_pbla2x" [] e_pblID
64.21 (["pbla2x","pbla2","pbla"],
64.22 [("#Given", ["fixedValues a_","valuesFor a2_","functionOf a2x_"])],
64.23 - e_rls, None, []));
64.24 + e_rls, NONE, []));
64.25 store_pbt
64.26 (prep_pbt DiffApp.thy "pbl_pbla2y" [] e_pblID
64.27 (["pbla2y","pbla2","pbla"],
64.28 [("#Given" ,["fixedValues a_","valuesFor a2_","boundVariable a2y_"])],
64.29 - e_rls, None, []));
64.30 + e_rls, NONE, []));
64.31 store_pbt
64.32 (prep_pbt DiffApp.thy "pbl_pbla2z" [] e_pblID
64.33 (["pbla2z","pbla2","pbla"],
64.34 [("#Given" ,["fixedValues a_","valuesFor a2_","interval a2z_"])],
64.35 - e_rls, None, []));
64.36 + e_rls, NONE, []));
64.37 store_pbt
64.38 (prep_pbt DiffApp.thy "pbl_pbla3" [] e_pblID
64.39 (["pbla3","pbla"],
64.40 [("#Given" ,["fixedValues a_","relations a3_"])],
64.41 - e_rls, None, []));
64.42 + e_rls, NONE, []));
64.43
64.44 show_ptyps();
64.45
64.46 @@ -107,24 +107,24 @@
64.47 "----------- refin test-pbtyps -----------------------------------";
64.48 (*case 1: no refinement *)
64.49 refin [] ori1 (hd (!ptyps));
64.50 -(*val it = Some ["pbla"] : pblID option*)
64.51 +(*val it = SOME ["pbla"] : pblID option*)
64.52
64.53 (*case 2: refined to pbt without children *)
64.54 refin [] ori2 (hd (!ptyps));
64.55 -(*val it = Some ["pbla","pbla3"] : pblID option*)
64.56 +(*val it = SOME ["pbla","pbla3"] : pblID option*)
64.57
64.58 (*case 3: refined to pbt with children *)
64.59 refin [] ori3 (hd (!ptyps));
64.60 -(*val it = Some ["pbla","pbla2"] : pblID option*)
64.61 +(*val it = SOME ["pbla","pbla2"] : pblID option*)
64.62
64.63 (*case 4: refined to children (without child)*)
64.64 refin [] ori4 (hd (!ptyps));
64.65 -(*val it = Some ["pbla","pbla2","pbla2y"] : pblID option*)
64.66 +(*val it = SOME ["pbla","pbla2","pbla2y"] : pblID option*)
64.67
64.68 (*case 5: start refinement somewhere in ptyps*)
64.69 val [Ptyp ("pbla",_,[_, ppp as Ptyp ("pbla2",_,_), _])] = !ptyps;
64.70 refin ["pbla"] ori4 ppp;
64.71 -(*val it = Some ["pbla2","pbla2y"] : pblRD option*)
64.72 +(*val it = SOME ["pbla2","pbla2y"] : pblRD option*)
64.73
64.74
64.75 "----------- refine_ori test-pbtyps ------------------------------";
64.76 @@ -132,24 +132,24 @@
64.77 "----------- refine_ori test-pbtyps ------------------------------";
64.78 (*case 1: no refinement *)
64.79 refine_ori ori1 ["pbla"];
64.80 -(*val it = None : pblID option !!!!*)
64.81 +(*val it = NONE : pblID option !!!!*)
64.82
64.83 (*case 2: refined to pbt without children *)
64.84 refine_ori ori2 ["pbla"];
64.85 -(*val it = Some ["pbla3","pbla"] : pblID option*)
64.86 +(*val it = SOME ["pbla3","pbla"] : pblID option*)
64.87
64.88 (*case 3: refined to pbt with children *)
64.89 refine_ori ori3 ["pbla"];
64.90 -(*val it = Some ["pbla2","pbla"] : pblID option*)
64.91 +(*val it = SOME ["pbla2","pbla"] : pblID option*)
64.92
64.93 (*case 4: refined to children (without child)*)
64.94 val opt = refine_ori ori4 ["pbla"];
64.95 -if opt = Some ["pbla2y","pbla2","pbla"] then ()
64.96 +if opt = SOME ["pbla2y","pbla2","pbla"] then ()
64.97 else raise error "new behaviour in refine.sml case 4";
64.98
64.99 (*case 5: start refinement somewhere in ptyps*)
64.100 refine_ori ori4 ["pbla2","pbla"];
64.101 -(*val it = Some ["pbla2y","pbla2","pbla"] : pblID option*)
64.102 +(*val it = SOME ["pbla2y","pbla2","pbla"] : pblID option*)
64.103
64.104
64.105 "----------- refine test-pbtyps ----------------------------------";
65.1 --- a/test/Tools/isac/ME/rewtools.sml Wed Aug 18 13:53:15 2010 +0200
65.2 +++ b/test/Tools/isac/ME/rewtools.sml Wed Aug 18 13:55:23 2010 +0200
65.3 @@ -164,7 +164,7 @@
65.4
65.5 val rls' = "norm_Poly";
65.6 case assoc (startsearch, rls') of
65.7 - Some (thy', _) => thyID2theory' thy'
65.8 + SOME (thy', _) => thyID2theory' thy'
65.9 | _ => raise error ("thy_containing_rls : rls '"^str^
65.10 "' not in !rulset' und thy '"^thy'^"'");
65.11
65.12 @@ -452,7 +452,7 @@
65.13 ("Biegelinie.thy",
65.14 (#srls o get_met) ["IntegrierenUndKonstanteBestimmen"],
65.15 [(str2term "q__::bool", str2term "q x = q_0")],
65.16 - Some (str2term "q x = q_0"),
65.17 + SOME (str2term "q x = q_0"),
65.18 str2term "q__::bool",
65.19 str2term "(Rewrite sym_real_minus_eq_cancel False) (q__::bool)");
65.20 val (a', STac stac) = handle_leaf "next " th sr E a v t;
66.1 --- a/test/Tools/isac/ME/script.sml Wed Aug 18 13:53:15 2010 +0200
66.2 +++ b/test/Tools/isac/ME/script.sml Wed Aug 18 13:55:23 2010 +0200
66.3 @@ -202,11 +202,11 @@
66.4 val x1__ = eval_listexpr_ Biegelinie.thy srls x1__; term2str x1__;
66.5 (*no rewrite*)
66.6 calculate_ Biegelinie.thy ("Tools.lhs", eval_rhs"eval_lhs_") x1__;
66.7 -val Some (str, t) = eval_lhs 0 "Tools.lhs" (str2term"lhs (M_b 0 = 0)") 0;*)
66.8 +val SOME (str, t) = eval_lhs 0 "Tools.lhs" (str2term"lhs (M_b 0 = 0)") 0;*)
66.9
66.10 val l__ = str2term"lhs (M_b 0 = 0)";
66.11 val l__ = eval_listexpr_ Biegelinie.thy srls l__; term2str l__;
66.12 -val Some (str, t) = eval_lhs 0 "Tools.lhs" (str2term"lhs (M_b 0 = 0)") 0;
66.13 +val SOME (str, t) = eval_lhs 0 "Tools.lhs" (str2term"lhs (M_b 0 = 0)") 0;
66.14
66.15
66.16 trace_rewrite:=true;
67.1 --- a/test/Tools/isac/ME/solve.sml Wed Aug 18 13:53:15 2010 +0200
67.2 +++ b/test/Tools/isac/ME/solve.sml Wed Aug 18 13:55:23 2010 +0200
67.3 @@ -80,7 +80,7 @@
67.4
67.5 getTactic 1 ([3,4,1], Frm);
67.6 val ((pt,_),_) = get_calc 1; show_pt pt;
67.7 -val (Form form, Some tac, asm) = pt_extract (pt, ([6], Res));
67.8 +val (Form form, SOME tac, asm) = pt_extract (pt, ([6], Res));
67.9 case (term2str form, tac, terms2strs asm) of
67.10 ("1 / 2", Check_Postcond ["rational", "simplification"],
67.11 ["-36 * x + 4 * x ^^^ 3 ~= 0"]) => ()
67.12 @@ -101,14 +101,14 @@
67.13 (prep_pbt Test.thy "pbl_ttestt" [] e_pblID
67.14 (["test"],
67.15 [],
67.16 - e_rls, None, []));
67.17 + e_rls, NONE, []));
67.18 store_pbt
67.19 (prep_pbt Test.thy "pbl_ttestt_detail" [] e_pblID
67.20 (["detail","test"],
67.21 [("#Given" ,["realTestGiven t_"]),
67.22 ("#Find" ,["realTestFind s_"])
67.23 ],
67.24 - e_rls, None, [["Test","test_detail"]]));
67.25 + e_rls, NONE, [["Test","test_detail"]]));
67.26
67.27 store_met
67.28 (prep_met Test.thy "met_detbin" [] e_metID
67.29 @@ -249,22 +249,22 @@
67.30 (*14.3.03*)
67.31 (*---------------WN060614?!?---
67.32 val t = str2term "(3 + x) * (3 + -1 * x) / ((3 + x) * (3 + x))";
67.33 - val Some (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
67.34 + val SOME (t,_) = rewrite_set_ thy false make_polynomial t; term2str t;
67.35 "(9 + - (x ^^^ 2)) / (9 + 6 * x + x ^^^ 2)";
67.36 - val Some (t,_) = rewrite_set_ thy false cancel_p t; term2str t;
67.37 + val SOME (t,_) = rewrite_set_ thy false cancel_p t; term2str t;
67.38 cancel_p_ thy t;
67.39 (---------------WN060614?!?---*)
67.40
67.41 val t = str2term "(3 + x) * (3 + -1 * x)";
67.42 - val Some (t,_) = rewrite_set_ thy false expand_poly t; term2str t;
67.43 + val SOME (t,_) = rewrite_set_ thy false expand_poly t; term2str t;
67.44 "3 * 3 + 3 * (-1 * x) + (x * 3 + x * (-1 * x))";
67.45 - val Some (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
67.46 + val SOME (t,_) = rewrite_set_ thy false order_add_mult t; term2str t;
67.47 "3 * 3 + (3 * x + (-1 * (3 * x) + -1 * (x * x)))";
67.48 - val Some (t,_) = rewrite_set_ thy false simplify_power t; term2str t;
67.49 + val SOME (t,_) = rewrite_set_ thy false simplify_power t; term2str t;
67.50 "3 ^^^ 2 + (3 * x + (-1 * (3 * x) + -1 * x ^^^ 2))";
67.51 - val Some (t,_) = rewrite_set_ thy false collect_numerals t; term2str t;
67.52 + val SOME (t,_) = rewrite_set_ thy false collect_numerals t; term2str t;
67.53 "9 + (0 * x + -1 * x ^^^ 2)";
67.54 - val Some (t,_) = rewrite_set_ thy false reduce_012 t; term2str t;
67.55 + val SOME (t,_) = rewrite_set_ thy false reduce_012 t; term2str t;
67.56 "9 + - (x ^^^ 2)";
67.57 (*14.3.03*)
67.58
68.1 --- a/test/Tools/isac/OLDTESTS/root-equ.sml Wed Aug 18 13:53:15 2010 +0200
68.2 +++ b/test/Tools/isac/OLDTESTS/root-equ.sml Wed Aug 18 13:55:23 2010 +0200
68.3 @@ -32,7 +32,7 @@
68.4 (*
68.5 > val t = (term_of o the o (parse thy)) "#2^^^#3";
68.6 > val eval_fn = the (assoc (!eval_list, "pow"));
68.7 -> val (Some (id,t')) = get_pair thy "pow" eval_fn t;
68.8 +> val (SOME (id,t')) = get_pair thy "pow" eval_fn t;
68.9 > Sign.string_of_term (sign_of thy) t';
68.10 *)
68.11 (******************************************************************)
68.12 @@ -43,7 +43,7 @@
68.13 val thy' = "Test.thy";
68.14 val ct = "sqrt(9+4*x)=sqrt x + sqrt(-3+x)";
68.15 val thm = ("square_equation_left","");
68.16 -val Some (ct,asm) = rewrite thy' "tless_true" "tval_rls" true thm ct;
68.17 +val SOME (ct,asm) = rewrite thy' "tless_true" "tval_rls" true thm ct;
68.18 (*"9 + 4 * x = (sqrt x + sqrt (-3 + x)) ^^^ 2"*)
68.19 val rls = ("Test_simplify");
68.20 val (ct,_) = the (rewrite_set thy' false rls ct);
68.21 @@ -547,7 +547,7 @@
68.22
68.23 (*.9.6.03
68.24 val t = str2term "sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)";
68.25 - val Some (t',asm) = rewrite_set_ thy false rls t;
68.26 + val SOME (t',asm) = rewrite_set_ thy false rls t;
68.27 term2str t';
68.28 trace_rewrite:=true;
68.29 trace_rewrite:=false;
69.1 --- a/test/Tools/isac/OLDTESTS/script.sml Wed Aug 18 13:53:15 2010 +0200
69.2 +++ b/test/Tools/isac/OLDTESTS/script.sml Wed Aug 18 13:55:23 2010 +0200
69.3 @@ -89,19 +89,19 @@
69.4 ("Substitute", tac2tac_ pt p
69.5 (Substitute [("a","#2*r*sin alpha"),("b","#2*r*cos alpha")]));
69.6 "------- same_tacpbl + eval_to -------";
69.7 -val Some(l1,t1) = same_tacpbl sc ll (mI1,m1);
69.8 +val SOME(l1,t1) = same_tacpbl sc ll (mI1,m1);
69.9 loc_2str l1;
69.10 (*"[R, R, D, R, D, R, D, R, D, R, D, R, D, R, D, L, R]"*)
69.11 Sign.string_of_term (sign_of DiffApp.thy) t1;
69.12 (*"solve_univar (Reals, [univar, equation], no_met) B.1 B.3 "?6 ?4 *)
69.13
69.14 -val Some(l2,t2) = same_tacpbl sc l1 (mI2,m2);
69.15 +val SOME(l2,t2) = same_tacpbl sc l1 (mI2,m2);
69.16 loc_2str l2;
69.17 (*"[R, R, D, R, D, R, D, R, D, R, D, R, D, R, D, R, D, L, R]"*)
69.18 Sign.string_of_term (sign_of DiffApp.thy) t2;
69.19 (*"solve_univar (Reals, [univar, equation], no_met) B.1 B.3 "?7 ?3 *)
69.20
69.21 -val Some(l3,t3) = same_tacpbl sc l2 (mI3,m3);
69.22 +val SOME(l3,t3) = same_tacpbl sc l2 (mI3,m3);
69.23 loc_2str l3;
69.24 (*"[R, R, D, R, D, R, D, R, D, R, D, R, D, R, D, R, D, R, D]"*)
69.25 Sign.string_of_term (sign_of DiffApp.thy) t3;
70.1 --- a/test/Tools/isac/OLDTESTS/script_if.sml Wed Aug 18 13:53:15 2010 +0200
70.2 +++ b/test/Tools/isac/OLDTESTS/script_if.sml Wed Aug 18 13:55:23 2010 +0200
70.3 @@ -10,10 +10,10 @@
70.4
70.5 val thy = Isac.thy;
70.6 val t = (term_of o the o (parse thy)) "contains_root (sqrt(x)=1)";
70.7 -val Some(ss,tt) = eval_contains_root "xxx" 1 t thy;
70.8 +val SOME(ss,tt) = eval_contains_root "xxx" 1 t thy;
70.9
70.10 val t = (term_of o the o (parse thy)) "is_rootequation_in (sqrt(x)=1) x";
70.11 -val Some(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
70.12 +val SOME(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
70.13
70.14 (*---
70.15 val v = (term_of o the o (parse thy)) "x";
70.16 @@ -28,11 +28,11 @@
70.17 ---*)
70.18 val t = (term_of o the o (parse thy))
70.19 "is_rootequation_in (1 + 2*sqrt(3+4*x)=0) x";
70.20 -val Some(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
70.21 +val SOME(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
70.22
70.23 val t = (term_of o the o (parse thy))
70.24 "is_rootequation_in (x + 2*sqrt(3+4*a)=0) x";
70.25 -val Some(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
70.26 +val SOME(ss,tt) = eval_is_rootequation_in "is_rootequation_i" 1 t thy;
70.27
70.28 val t = (term_of o the o (parse Test.thy))
70.29 "is_rootequation_in (sqrt(x)=1) x";
70.30 @@ -42,9 +42,9 @@
70.31 atomty t;
70.32
70.33 (*
70.34 -val Some(tt,_) = rewrite_set_ Test.thytrue tval_rls t;
70.35 +val SOME(tt,_) = rewrite_set_ Test.thytrue tval_rls t;
70.36 *)
70.37 -val Some(tt,_) = rewrite_set_ Isac.thy true tval_rls t;
70.38 +val SOME(tt,_) = rewrite_set_ Isac.thy true tval_rls t;
70.39
70.40 rewrite_set "Isac.thy" true
70.41 "tval_rls" "is_rootequation_in (sqrt(x)=1) x";
71.1 --- a/test/Tools/isac/OLDTESTS/scriptnew.sml Wed Aug 18 13:53:15 2010 +0200
71.2 +++ b/test/Tools/isac/OLDTESTS/scriptnew.sml Wed Aug 18 13:55:23 2010 +0200
71.3 @@ -23,14 +23,14 @@
71.4 (prep_pbt Test.thy "pbl_testss" [] e_pblID
71.5 (["tests"],
71.6 []:(string * string list) list,
71.7 - e_rls, None, []));
71.8 + e_rls, NONE, []));
71.9 store_pbt
71.10 (prep_pbt Test.thy "pbl_testss_term" [] e_pblID
71.11 (["met_testterm","tests"],
71.12 [("#Given" ,["realTestGiven g_"]),
71.13 ("#Find" ,["realTestFind f_"])
71.14 ],
71.15 - e_rls, None, []));
71.16 + e_rls, NONE, []));
71.17 store_met
71.18 (prep_met Test.thy "met_test_simp" [] e_metID
71.19 (*test for simplification*)
71.20 @@ -97,7 +97,7 @@
71.21 [("#Given" ,["boolTestGiven e_"]),
71.22 ("#Find" ,["boolTestFind v_i_"])
71.23 ],
71.24 - e_rls, None, []));
71.25 + e_rls, NONE, []));
71.26
71.27 store_met
71.28 (prep_met Test.thy "met_test_eq1" [] e_metID
72.1 --- a/test/Tools/isac/OLDTESTS/subp-rooteq.sml Wed Aug 18 13:53:15 2010 +0200
72.2 +++ b/test/Tools/isac/OLDTESTS/subp-rooteq.sml Wed Aug 18 13:55:23 2010 +0200
72.3 @@ -51,7 +51,7 @@
72.4 ScrState (["
72.5 (e_, x + 1 = 2)","
72.6 (v_, x)"],
72.7 - [], None,
72.8 + [], NONE,
72.9 ??.empty, Safe, true) ########## OK*)
72.10 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
72.11 (*val f = "x + 1 + -1 * 2 = 0"; val nxt = Rewrite_Set "Test_simplify"*)
72.12 @@ -59,13 +59,13 @@
72.13 ScrState (["
72.14 (e_, x + 1 = 2)","
72.15 (v_, x)"],
72.16 - [], None,
72.17 + [], NONE,
72.18 ??.empty, Safe, true) ########## OK von loc_ uebernommen
72.19 ### solve, after locate_gen: is= ### nxt_solv4 Apply_Method: stored is =
72.20 ScrState (["
72.21 (e_, x + 1 = 2)","
72.22 (v_, x)"],
72.23 - [R,L,R,L,L,R,R], Some e_,
72.24 + [R,L,R,L,L,R,R], SOME e_,
72.25 x + 1 + -1 * 2 = 0, Safe, true) ########## OK*)
72.26 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
72.27
72.28 @@ -76,26 +76,26 @@
72.29 ScrState (["
72.30 (e_, x + 1 = 2)","
72.31 (v_, x)"],
72.32 - [R,L,R,L,L,R,R], Some e_,
72.33 + [R,L,R,L,L,R,R], SOME e_,
72.34 x + 1 + -1 * 2 = 0, Safe, true) ########## OK von loc_ uebernommen
72.35 ### solve, after locate_gen: is= ### nxt_solv4 Apply_Method: stored is =
72.36 ScrState (["
72.37 (e_, x + 1 = 2)","
72.38 (v_, x)"],
72.39 - [R,L,R,L,R,R], Some e_,
72.40 + [R,L,R,L,R,R], SOME e_,
72.41 -1 + x = 0, Safe, false) ########## OK*)
72.42 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
72.43 (*### locate_gen------------: is= ### next_tac-----------------: E=
72.44 ScrState (["
72.45 (e_, x + 1 = 2)","
72.46 (v_, x)"],
72.47 - [R,L,R,L,R,R], Some e_,
72.48 + [R,L,R,L,R,R], SOME e_,
72.49 -1 + x = 0, Safe, false) ########## OK von loc_ uebernommen
72.50 ### solve, after locate_gen: is= ### nxt_solv4 Apply_Method: stored is =
72.51 ScrState (["
72.52 (e_, -1 + x = 0)","
72.53 (v_, x)"],
72.54 - [R,R,D,L,R], Some e_,
72.55 + [R,R,D,L,R], SOME e_,
72.56 Subproblem (Test.thy, [linear, univariate, equation, test]), Safe, true)
72.57 ########## OK*)
72.58 p;
73.1 --- a/test/Tools/isac/OLDTESTS/tacis.sml Wed Aug 18 13:53:15 2010 +0200
73.2 +++ b/test/Tools/isac/OLDTESTS/tacis.sml Wed Aug 18 13:55:23 2010 +0200
73.3 @@ -35,13 +35,13 @@
73.4
73.5 fetchProposedTactic 1 (*'Model_Problem' in tacis*);
73.6 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*equality ///*);
73.7 -(*----- WN060222 since complete_mod_ case cas of Some headline -----
73.8 +(*----- WN060222 since complete_mod_ case cas of SOME headline -----
73.9 fetchProposedTactic 1 (*'Add_Given equality (-1 + x = 0)' in tacis*);
73.10 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1) (*equality (-1 + x =0)*);
73.11 ---------------------------------------------------------------------*)
73.12
73.13 fetchProposedTactic 1 (*'Add_Given solveFor x' in tacis*);
73.14 -(*----- WN060222 since complete_mod_ case cas of Some headline:
73.15 +(*----- WN060222 since complete_mod_ case cas of SOME headline:
73.16 (*Specify_Theory Test.thy*)
73.17 ---------------------------------------------------------------------*)
73.18 autoCalculate 1 CompleteCalcHead; refFormula 1 (get_pos 1 1) (*OK*);
74.1 --- a/test/Tools/isac/Scripts/calculate-float.sml Wed Aug 18 13:53:15 2010 +0200
74.2 +++ b/test/Tools/isac/Scripts/calculate-float.sml Wed Aug 18 13:55:23 2010 +0200
74.3 @@ -20,7 +20,7 @@
74.4 val thy = "Test.thy";
74.5 val op_ = "divide_";
74.6 val ct = "-6 / 3";
74.7 - val Some (ct,_) = calculate thy (the (assoc (calclist, op_))) ct;
74.8 + val SOME (ct,_) = calculate thy (the (assoc (calclist, op_))) ct;
74.9
74.10 (*-----WN050315------------------------------------------------------*)
74.11 (*..*)
74.12 @@ -55,12 +55,12 @@
74.13 val t = str2term "CFloat (1, 2)";
74.14 atomt t;
74.15 atomty t;
74.16 -val Some ct = parse Float.thy "IFloat (1, 2, 3)";
74.17 -val Some ct = parse Float.thy "CFloat (1, 2)";
74.18 +val SOME ct = parse Float.thy "IFloat (1, 2, 3)";
74.19 +val SOME ct = parse Float.thy "CFloat (1, 2)";
74.20 atomt (term_of ct);
74.21 atomty (term_of ct);
74.22 (*----(2)------------------------------*)
74.23 -val Some ct = parse Float.thy "IFloat (-1, 2, 3)";
74.24 +val SOME ct = parse Float.thy "IFloat (-1, 2, 3)";
74.25 val t = (term_of ct);
74.26 atomty t;
74.27 (*#######################################################################3
74.28 @@ -113,12 +113,12 @@
74.29
74.30 (*.the function evaluating a binary operator.*)
74.31 val t = str2term "Float ((1,2),(0,0)) + Float ((3,4),(0,0))";
74.32 -val Some (thmid, t) = eval_binop "#add_" "op +" t thy;
74.33 +val SOME (thmid, t) = eval_binop "#add_" "op +" t thy;
74.34 term2str t;
74.35
74.36
74.37 (*.scan a term for a pair of floats.*)
74.38 - val Some (thmid,t') = get_pair thy op_ eval_fn t;
74.39 + val SOME (thmid,t') = get_pair thy op_ eval_fn t;
74.40
74.41
74.42 (*.use 'calculate' explicitly.*)
74.43 @@ -126,22 +126,22 @@
74.44 val op_ = "divide_";
74.45 val t = str2term "sqrt (x ^^^ 2 + -3 * x) =\
74.46 \Float ((5,6),(0,0)) / Float ((7,8),(0,0))";
74.47 - val Some (t',_) = calculate_ thy (the (assoc (calclist, op_))) t;
74.48 + val SOME (t',_) = calculate_ thy (the (assoc (calclist, op_))) t;
74.49 term2str t';
74.50
74.51
74.52 (*.rewrite with ruleset TEST...simplify (calling calculate internally.*)
74.53 val t = str2term "a + Float ((1,2),(0,0)) + a + Float ((3,4),(0,0)) * \
74.54 \Float ((5,6),(0,0)) / Float ((7,8),(0,0))";
74.55 -val Some (t',_) = rewrite_set_ thy false norm_Rational(*///*) t; term2str t';
74.56 +val SOME (t',_) = rewrite_set_ thy false norm_Rational(*///*) t; term2str t';
74.57 (*Float ((...,...) + 2*a*)
74.58
74.59
74.60 (*. parse a float as seen by the user .*)
74.61 -val Some t = parse Float.thy "123.456";
74.62 -val Some t = parse Float.thy "-123.456";
74.63 -val Some t = parse Float.thy "123.456 E6789";
74.64 -val Some t = parse Float.thy "123.456 E-6789";
74.65 -val Some t = parse Float.thy "-123.456 E-6789";
74.66 +val SOME t = parse Float.thy "123.456";
74.67 +val SOME t = parse Float.thy "-123.456";
74.68 +val SOME t = parse Float.thy "123.456 E6789";
74.69 +val SOME t = parse Float.thy "123.456 E-6789";
74.70 +val SOME t = parse Float.thy "-123.456 E-6789";
74.71
74.72 ################################################################*)
75.1 --- a/test/Tools/isac/Scripts/calculate.sml Wed Aug 18 13:53:15 2010 +0200
75.2 +++ b/test/Tools/isac/Scripts/calculate.sml Wed Aug 18 13:55:23 2010 +0200
75.3 @@ -31,23 +31,23 @@
75.4
75.5 val thy = Test.thy;
75.6 val t = (term_of o the o (parse thy)) "1+2";
75.7 -val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
75.8 +val SOME (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
75.9
75.10 val t = (term_of o the o (parse thy)) "((1+2)*4/3)^^^2";
75.11 -val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
75.12 -val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.13 +val SOME (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
75.14 +val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.15 Sign.string_of_term (sign_of thy) t;
75.16 (*val it = "(#3 * #4 // #3) ^^^ #2" : string*)
75.17 -val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times"))) t;
75.18 -val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.19 +val SOME (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times"))) t;
75.20 +val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.21 Sign.string_of_term (sign_of thy) t;
75.22 (*val it = "(#12 // #3) ^^^ #2" : string*)
75.23 -val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"divide_")))t;
75.24 -val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.25 +val SOME (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"divide_")))t;
75.26 +val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.27 Sign.string_of_term (sign_of thy) t;
75.28 (*it = "#4 ^^^ #2" : string*)
75.29 -val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_")))t;
75.30 -val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.31 +val SOME (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_")))t;
75.32 +val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.33 Sign.string_of_term (sign_of thy) t;
75.34 (*val it = "#16" : string*)
75.35 if it <> "16" then raise error "calculate.sml: new behaviour in calculate_"
75.36 @@ -61,14 +61,14 @@
75.37 (prep_pbt Test.thy "pbl_ttest" [] e_pblID
75.38 (["test"],
75.39 [],
75.40 - e_rls, None, []));
75.41 + e_rls, NONE, []));
75.42 store_pbt
75.43 (prep_pbt Test.thy "pbl_ttest_calc" [] e_pblID
75.44 (["calculate","test"],
75.45 [("#Given" ,["realTestGiven t_"]),
75.46 ("#Find" ,["realTestFind s_"])
75.47 ],
75.48 - e_rls, None, [["Test","test_calculate"]]));
75.49 + e_rls, NONE, [["Test","test_calculate"]]));
75.50
75.51 store_met
75.52 (prep_met Test.thy "met_testcal" [] e_metID
75.53 @@ -145,7 +145,7 @@
75.54 val op_ = "divide_";
75.55 val ct = "sqrt (x ^^^ 2 + -3 * x) =\
75.56 \(-9) / (-2) + (-3 / (-2) + (x * ((-4) / (-2)) + x * (2 / (-2))))";
75.57 - val Some (ct,_) = calculate thy (the(assoc(calclist,op_))) ct;
75.58 + val SOME (ct,_) = calculate thy (the(assoc(calclist,op_))) ct;
75.59 writeln ct;
75.60 (*
75.61 sqrt (x ^^^ 2 + -3 * x) =\
75.62 @@ -171,10 +171,10 @@
75.63 val t = (term_of o the o (parse Test.thy)) "2 is_const";
75.64 atomty t;
75.65 rewrite_set_ Test.thy false tval_rls t;
75.66 -(*val it = Some (Const ("True","bool"),[]) ... works*)
75.67 +(*val it = SOME (Const ("True","bool"),[]) ... works*)
75.68
75.69 val t = str2term "2 * x is_const";
75.70 - val Some (str,t') = eval_const "" "" t Isac.thy;
75.71 + val SOME (str,t') = eval_const "" "" t Isac.thy;
75.72 term2str t';
75.73
75.74
75.75 @@ -185,7 +185,7 @@
75.76 trace_rewrite:=true;
75.77 val thy = Test.thy;
75.78 val t = (term_of o the o (parse thy)) "(-4) / 2";
75.79 - val Some (_,t) = eval_cancel "xxx" "HOL.divide" t thy;
75.80 + val SOME (_,t) = eval_cancel "xxx" "HOL.divide" t thy;
75.81 term2str t;
75.82 "-4 / 2 = (-2)";
75.83 (*-------------- but ... *)
75.84 @@ -219,7 +219,7 @@
75.85 val thy = Test.thy;
75.86 val rls = Test_simplify;
75.87 val t = str2term "(3+(1+2*x))/2";
75.88 - val Some (t',asm) = rewrite_set_ thy false rls t;
75.89 + val SOME (t',asm) = rewrite_set_ thy false rls t;
75.90 term2str t';
75.91 (*val t = "2 + x" ... works: give up----------------------------------------*)
75.92 trace_rewrite:=false;
75.93 @@ -267,12 +267,12 @@
75.94 ### trying calc. 'cancel'
75.95 @@@ get_pair: binop, t = x + (-4) / 2
75.96 @@@ get_pair: t else
75.97 -@@@ get_pair: t else -> None
75.98 +@@@ get_pair: t else -> NONE
75.99 @@@ get_pair: binop, t = (-4) / 2
75.100 @@@ get_pair: then 1
75.101 -@@@ get_pair: t -> None
75.102 -@@@ get_pair: t1 -> None
75.103 -@@@ get_calculation: None
75.104 +@@@ get_pair: t -> NONE
75.105 +@@@ get_pair: t1 -> NONE
75.106 +@@@ get_calculation: NONE
75.107 ### trying calc. 'pow'
75.108 *)
75.109
75.110 @@ -286,10 +286,10 @@
75.111 ### trying calc. 'cancel'
75.112 @@@ get_pair: binop, t = x + -4 / 2
75.113 @@@ get_pair: t else
75.114 -@@@ get_pair: t else -> None
75.115 +@@@ get_pair: t else -> NONE
75.116 @@@ get_pair: binop, t = -4 / 2
75.117 @@@ get_pair: then 1
75.118 -@@@ get_calculation: Some #cancel_-4_2
75.119 +@@@ get_calculation: SOME #cancel_-4_2
75.120 ### calc. to: x + (-2)
75.121 ### trying calc. 'cancel'
75.122 *)
75.123 @@ -331,7 +331,7 @@
75.124 *** . Free ( aaa, real)
75.125 *** . Free ( 1, real) *)
75.126 val thm = num_str real_divide_1;
75.127 - val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.128 + val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.129 (*val t = Free ("aaa","RealDef.real") : term*)
75.130
75.131
75.132 @@ -366,7 +366,7 @@
75.133 *** . Free ( 1, real)
75.134 *** . Free ( aaa, nat) .......................... nat !!! *)
75.135 val thm = num_str realpow_eq_one;
75.136 - val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.137 + val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.138 (*val t = Free ("1","RealDef.real") : term*)
75.139
75.140 " ================= calculate.sml: calculate_ 2002 =================== ";
75.141 @@ -375,34 +375,34 @@
75.142
75.143 val thy = Test.thy;
75.144 val t = (term_of o the o (parse thy)) "12 / 3";
75.145 -val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"divide_")))t;
75.146 -val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.147 +val SOME (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"divide_")))t;
75.148 +val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.149 "12 / 3 = 4";
75.150 val thy = Test.thy;
75.151 val t = (term_of o the o (parse thy)) "4 ^^^ 2";
75.152 -val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_"))) t;
75.153 -val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.154 +val SOME (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_"))) t;
75.155 +val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.156 "4 ^ 2 = 16";
75.157
75.158 val t = (term_of o the o (parse thy)) "((1 + 2) * 4 / 3) ^^^ 2";
75.159 - val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
75.160 + val SOME (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"plus"))) t;
75.161 "1 + 2 = 3";
75.162 - val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.163 + val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.164 Sign.string_of_term (sign_of thy) t;
75.165 "(3 * 4 / 3) ^^^ 2";
75.166 - val Some (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times")))t;
75.167 + val SOME (thmID,thm) = get_calculation_ thy (the(assoc(calclist,"times")))t;
75.168 "3 * 4 = 12";
75.169 - val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.170 + val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.171 Sign.string_of_term (sign_of thy) t;
75.172 "(12 / 3) ^^^ 2";
75.173 - val Some (thmID,thm) =get_calculation_ thy(the(assoc(calclist,"divide_")))t;
75.174 + val SOME (thmID,thm) =get_calculation_ thy(the(assoc(calclist,"divide_")))t;
75.175 "12 / 3 = 4";
75.176 - val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.177 + val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.178 Sign.string_of_term (sign_of thy) t;
75.179 "4 ^^^ 2";
75.180 - val Some (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_")))t;
75.181 + val SOME (thmID,thm) = get_calculation_ thy(the(assoc(calclist,"power_")))t;
75.182 "4 ^^^ 2 = 16";
75.183 - val Some (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.184 + val SOME (t,_) = rewrite_ thy tless_true tval_rls true thm t;
75.185 Sign.string_of_term (sign_of thy) t;
75.186 "16";
75.187 if it <> "16" then raise error "calculate.sml: new behaviour in calculate_"
75.188 @@ -410,7 +410,7 @@
75.189
75.190 (*13.9.02 *** calc: operator = pow not defined*)
75.191 val t = (term_of o the o (parse thy)) "3^^^2";
75.192 - val Some (thmID,thm) =
75.193 + val SOME (thmID,thm) =
75.194 get_calculation_ thy (the(assoc(calclist,"power_"))) t;
75.195 (*** calc: operator = pow not defined*)
75.196
75.197 @@ -419,14 +419,14 @@
75.198 val op_ = "Atools.pow" : string
75.199 val eval_fn = fn : string -> term -> theory -> (string * term) option*)
75.200
75.201 - val Some (thmid,t') = get_pair thy op_ eval_fn t;
75.202 + val SOME (thmid,t') = get_pair thy op_ eval_fn t;
75.203 (*** calc: operator = pow not defined*)
75.204
75.205 - val Some (id,t') = eval_fn op_ t thy;
75.206 + val SOME (id,t') = eval_fn op_ t thy;
75.207 (*** calc: operator = pow not defined*)
75.208
75.209 val (thmid, (Const (op0,t0) $ Free (n1,t1) $ Free(n2,t2))) = (op_, t);
75.210 - val Some (id,t') = eval_binop thmid op_ t thy;
75.211 + val SOME (id,t') = eval_binop thmid op_ t thy;
75.212 (*** calc: operator = pow not defined*)
75.213
75.214
75.215 @@ -439,7 +439,7 @@
75.216 str2term
75.217 "[] from_ [c, c_2, c_3, c_4] occur_exactly_in -1 * (q_0 * L ^^^ 2) / 2"
75.218 );
75.219 -val Some (str, simpl) = get_pair thy op_ ef arg;
75.220 +val SOME (str, simpl) = get_pair thy op_ ef arg;
75.221 if str =
75.222 "[] from_ [c, c_2, c_3, c_4] occur_exactly_in -1 * (q_0 * L ^^^ 2) / 2 = True"
75.223 then () else raise error "calculate.sml get_pair with 3 args:occur_exactly_in";
75.224 @@ -462,10 +462,10 @@
75.225 "------------------ 3.6.03 (2 * x is_const) ---------------------------";
75.226 "------------------ 3.6.03 (2 * x is_const) ---------------------------";
75.227 val t = str2term "2 * x is_const";
75.228 -val Some (str, t') = eval_const "" "" t Test.thy;
75.229 +val SOME (str, t') = eval_const "" "" t Test.thy;
75.230 term2str t';
75.231 "(2 * x is_const) = False";
75.232
75.233 -val Some (t',_) = rewrite_set_ Test.thy false tval_rls t;
75.234 +val SOME (t',_) = rewrite_set_ Test.thy false tval_rls t;
75.235 term2str t';
75.236 "False";
76.1 --- a/test/Tools/isac/Scripts/listg.sml Wed Aug 18 13:53:15 2010 +0200
76.2 +++ b/test/Tools/isac/Scripts/listg.sml Wed Aug 18 13:55:23 2010 +0200
76.3 @@ -14,7 +14,7 @@
76.4 atomty t;
76.5 val thm = (#prop o rep_thm o num_str) nth_Cons_;
76.6 atomty thm;
76.7 -val Some (t',_) = rewrite_ thy dummy_ord Poly_erls false (num_str nth_Cons_) t;
76.8 +val SOME (t',_) = rewrite_ thy dummy_ord Poly_erls false (num_str nth_Cons_) t;
76.9 if term2str t' = "nth_ (3 + - 1) [b, c, d, e]" then ()
76.10 else raise error "list_rls.sml, nth_ (3 + - 1) [b, c, d, e]";
76.11
76.12 @@ -22,20 +22,20 @@
76.13 atomty t;
76.14 val thm = (#prop o rep_thm o num_str) nth_Nil_;
76.15 atomty thm;
76.16 -val Some (t',_) = rewrite_ thy dummy_ord Poly_erls false (num_str nth_Nil_) t;
76.17 +val SOME (t',_) = rewrite_ thy dummy_ord Poly_erls false (num_str nth_Nil_) t;
76.18 term2str t';
76.19 "a";
76.20
76.21 val t = str2term "nth_ 3 [a,b,c,d,e]";
76.22 atomty t;
76.23 trace_rewrite:=true;
76.24 -val Some (t',_) = rewrite_set_ thy false list_rls t;
76.25 +val SOME (t',_) = rewrite_set_ thy false list_rls t;
76.26 trace_rewrite:=false;
76.27 term2str t';
76.28 "c";
76.29
76.30 (*-------------------------------------------------------------------*)
76.31 -val Some (Thm (_,thm)) = rls_get_thm list_rls "nth_Nil_";
76.32 +val SOME (Thm (_,thm)) = rls_get_thm list_rls "nth_Nil_";
76.33 val ttt = (#prop o rep_thm) thm;
76.34 atomty ttt;
76.35 (*Free ( 1, real) ...OK, Var ((x, 0), ?'a) OK*)
77.1 --- a/test/Tools/isac/Scripts/rewrite.sml Wed Aug 18 13:53:15 2010 +0200
77.2 +++ b/test/Tools/isac/Scripts/rewrite.sml Wed Aug 18 13:55:23 2010 +0200
77.3 @@ -158,19 +158,19 @@
77.4 "----------- rewrite_terms_ -------------------------------------";
77.5 val subte = [str2term"x = 0"];
77.6 val t = str2term"M_b x = -1 * q_0 * x ^^^ 2 / 2 + x * c + c_2";
77.7 -val Some (t',_) = rewrite_terms_ thy dummy_ord Erls subte t;
77.8 +val SOME (t',_) = rewrite_terms_ thy dummy_ord Erls subte t;
77.9 if term2str t' = "M_b 0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2" then ()
77.10 else raise error "rewrite.sml rewrite_terms_ [x = 0]";
77.11
77.12 val subte = [str2term"M_b 0 = 0"];
77.13 val t = str2term"M_b 0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2";
77.14 -val Some (t',_) = rewrite_terms_ thy dummy_ord Erls subte t;
77.15 +val SOME (t',_) = rewrite_terms_ thy dummy_ord Erls subte t;
77.16 if term2str t' = "0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2" then ()
77.17 else raise error "rewrite.sml rewrite_terms_ [M_b 0 = 0]";
77.18
77.19 val subte = [str2term"x = 0", str2term"M_b 0 = 0"];
77.20 val t = str2term"M_b x = -1 * q_0 * x ^^^ 2 / 2 + x * c + c_2";
77.21 -val Some (t',_) = rewrite_terms_ thy dummy_ord Erls subte t;
77.22 +val SOME (t',_) = rewrite_terms_ thy dummy_ord Erls subte t;
77.23 if term2str t' = "0 = -1 * q_0 * 0 ^^^ 2 / 2 + 0 * c + c_2" then ()
77.24 else raise error "rewrite.sml rewrite_terms_ [x = 0, M_b 0 = 0]";
77.25
77.26 @@ -185,7 +185,7 @@
77.27 (str2term"bdv_3",str2term"c_3"),
77.28 (str2term"bdv_4",str2term"c_4")];
77.29 (*------------ outcommented WN071210, after inclusion into ROOT.ML
77.30 -val Some (t,_) =
77.31 +val SOME (t,_) =
77.32 rewrite_inst_ thy e_rew_ord
77.33 (append_rls "erls_isolate_bdvs" e_rls
77.34 [(Calc ("EqSystem.occur'_exactly'_in",
78.1 --- a/test/Tools/isac/Scripts/scrtools.sml Wed Aug 18 13:53:15 2010 +0200
78.2 +++ b/test/Tools/isac/Scripts/scrtools.sml Wed Aug 18 13:55:23 2010 +0200
78.3 @@ -169,9 +169,9 @@
78.4
78.5 (*with "Script SimplifyScript (t_::real) = \
78.6 \ ((Rewrite_Set norm_Rational False) t_)"
78.7 -val (Form form, Some tac, asm) = pt_extract (pt, ([1], Res));
78.8 +val (Form form, SOME tac, asm) = pt_extract (pt, ([1], Res));
78.9 *)
78.10 -val (Form form, Some tac, asm) = pt_extract (pt, ([2], Res));
78.11 +val (Form form, SOME tac, asm) = pt_extract (pt, ([2], Res));
78.12 case (term2str form, tac, terms2strs asm) of
78.13 ("a", Check_Postcond ["polynomial", "simplification"], []) => ()
78.14 | _ => raise error "scrtools.sml: auto-generated norm_Rational doesnt work";