1.1 --- a/src/Tools/isac/BaseDefinitions/Know_Store.thy Sun Jan 29 14:31:56 2023 +0100
1.2 +++ b/src/Tools/isac/BaseDefinitions/Know_Store.thy Mon Jan 30 09:47:18 2023 +0100
1.3 @@ -24,6 +24,7 @@
1.4
1.5 ML_file libraryC.sml
1.6 ML_file theoryC.sml
1.7 +ML_file parseC.sml
1.8 ML_file unparseC.sml
1.9 ML_file "rule-def.sml"
1.10 ML_file "thmC-def.sml"
2.1 --- a/src/Tools/isac/BaseDefinitions/error-pattern-def.sml Sun Jan 29 14:31:56 2023 +0100
2.2 +++ b/src/Tools/isac/BaseDefinitions/error-pattern-def.sml Mon Jan 30 09:47:18 2023 +0100
2.3 @@ -33,7 +33,7 @@
2.4 fun s_to_string ctxt errpats = (strs2str' o (map (errpat2str ctxt))) errpats
2.5
2.6 fun adapt_to_type ctxt (id, terms, thms) =
2.7 - (id, map (Model_Pattern.adapt_term_to_type ctxt) terms, thms)
2.8 + (id, map (ParseC.adapt_term_to_type ctxt) terms, thms)
2.9
2.10 (* for (at least) 2 kinds of access:
2.11 (1) given an id, find the respective fill_in's (e.g. in fun find_fill_patterns)
3.1 --- a/src/Tools/isac/BaseDefinitions/model-pattern.sml Sun Jan 29 14:31:56 2023 +0100
3.2 +++ b/src/Tools/isac/BaseDefinitions/model-pattern.sml Mon Jan 30 09:47:18 2023 +0100
3.3 @@ -26,9 +26,6 @@
3.4 val get_field: descriptor -> T -> m_field option
3.5
3.6 val adapt_to_type: Proof.context -> single -> single
3.7 - val adapt_term_to_type: Proof.context -> term -> term
3.8 - val adapt_to_type_real: term -> term
3.9 - val adapt_to_type_int: term -> term
3.10
3.11 \<^isac_test>\<open>
3.12 val split_descriptor: Proof.context -> m_field * term * Position.T -> pre_model_single
3.13 @@ -70,15 +67,9 @@
3.14
3.15 (*val parse_term: Proof.context -> m_field * ((*TermC.as_*)string * Position.T) -> m_field * term*)
3.16 fun parse_term ctxt (m_field, (str, pos)) =
3.17 - (m_field,
3.18 - (Syntax.read_term ctxt str
3.19 - handle ERROR msg => error (msg ^ Position.here pos)),
3.20 - pos)
3.21 + (m_field, ParseC.term_position ctxt (str, pos), pos)
3.22 fun parse_pattern ctxt (m_field, (str, pos)) =
3.23 - (m_field,
3.24 - (Proof_Context.read_term_pattern ctxt str
3.25 - handle ERROR msg => error (msg ^ Position.here pos)),
3.26 - pos)
3.27 + (m_field, ParseC.pattern_position ctxt (str, pos), pos)
3.28
3.29 fun parse_pos ctxt model_input =
3.30 let
3.31 @@ -113,37 +104,8 @@
3.32 |> (fn (a, _) => SOME a))
3.33 handle List.Empty => NONE
3.34
3.35 -(*
3.36 - adapt type of terms with most general type to a more specific one.
3.37 - TODO: clarify how to decide by use of data from the current context.
3.38 -*)
3.39 -fun T_a2real (Type (s, [])) =
3.40 - if s = "'a" orelse s = "'b" orelse s = "'c" then HOLogic.realT else Type (s, [])
3.41 - | T_a2real (Type (s, Ts)) = Type (s, map T_a2real Ts)
3.42 - | T_a2real (TFree (s, srt)) =
3.43 - if s = "'a" orelse s = "'b" orelse s = "'c" then HOLogic.realT else TFree (s, srt)
3.44 - | T_a2real (TVar (("DUMMY", _), _)) = HOLogic.realT
3.45 - | T_a2real (TVar ((s, i), srt)) =
3.46 - if s = "'a" orelse s = "'b" orelse s = "'c" then HOLogic.realT else TVar ((s, i), srt)
3.47 -(*val adapt_to_type_real: term -> term*)
3.48 -fun adapt_to_type_real (Const( s, T)) = (Const( s, T_a2real T))
3.49 - | adapt_to_type_real (Free( s, T)) = (Free( s, T_a2real T))
3.50 - | adapt_to_type_real (Var( n, T)) = (Var( n, T_a2real T))
3.51 - | adapt_to_type_real (Bound i) = (Bound i)
3.52 - | adapt_to_type_real (Abs(s,T,t)) = Abs(s, T, adapt_to_type_real t)
3.53 - | adapt_to_type_real (t1 $ t2) = (adapt_to_type_real t1) $ (adapt_to_type_real t2);
3.54 -(*val adapt_to_type_int: term -> term*)
3.55 -fun adapt_to_type_int _ = raise ERROR "Model_Pattern.adapt_to_type NOT implemented for HOLogic.intT"
3.56 -
3.57 -fun adapt_term_to_type ctxt t =
3.58 - let
3.59 - val choice = ctxt |> K HOLogic.realT (*clarify how ctxt can be used here*)
3.60 - in
3.61 - if choice = HOLogic.realT then adapt_to_type_real t
3.62 - else if choice = HOLogic.intT then adapt_to_type_int t
3.63 - else raise ERROR "TermC.adapt_to_type only implemented for HOLogic.realT"
3.64 - end
3.65 +(* adapt type of terms with most general type to a more specific one *)
3.66 fun adapt_to_type ctxt (field, (descr, term_as_string)) =
3.67 - (field, (adapt_term_to_type ctxt descr, adapt_term_to_type ctxt term_as_string))
3.68 + (field, (ParseC.adapt_term_to_type ctxt descr, ParseC.adapt_term_to_type ctxt term_as_string))
3.69
3.70 (**)end(*struct*)
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/src/Tools/isac/BaseDefinitions/parseC.sml Mon Jan 30 09:47:18 2023 +0100
4.3 @@ -0,0 +1,91 @@
4.4 +(* Title: BaseDefinitions/parseC..sml
4.5 + Author: Walther Neuper
4.6 + (c) due to copyright terms
4.7 +*)
4.8 +signature PARSE_ISAC =
4.9 +sig
4.10 + val pattern_position: Proof.context -> string * Position.T -> term
4.11 + val term_position: Proof.context -> string * Position.T -> term
4.12 +
4.13 + val term_opt: Proof.context -> string -> term option
4.14 + val patt_opt: theory -> string -> term option
4.15 +
4.16 + val parse_test: Proof.context -> string -> term
4.17 + val parse_patt_test: theory -> string -> term
4.18 +
4.19 + val adapt_term_to_type: Proof.context -> term -> term
4.20 + val adapt_to_type_real: term -> term
4.21 + val adapt_to_type_int: term -> term
4.22 +end
4.23 +
4.24 +(**)
4.25 +structure ParseC(**): PARSE_ISAC(**) =
4.26 +struct
4.27 +(**)
4.28 +
4.29 +(** parse term with feedback by PIDE **)
4.30 +
4.31 +fun term_position ctxt (str, pos) =
4.32 + Syntax.read_term ctxt str
4.33 + handle ERROR msg => error (msg ^ Position.here pos)
4.34 + (*this exception is caught by PIDE to show "msg" at the proper location on screen*)
4.35 +fun pattern_position ctxt (str, pos) =
4.36 + Proof_Context.read_term_pattern ctxt str
4.37 + handle ERROR msg => error (msg ^ Position.here pos)
4.38 + (*this exception is caught by PIDE to show "msg" at the proper location on screen*)
4.39 +
4.40 +
4.41 +(** parse term internally **)
4.42 +
4.43 +fun term_opt ctxt str = \<^try>\<open>Syntax.read_term ctxt str\<close>;
4.44 +fun patt_opt thy str = \<^try>\<open>Proof_Context.read_term_pattern (Proof_Context.init_global thy) str\<close>;
4.45 +
4.46 +
4.47 +(** adapt type of pre-typed terms to current context **)
4.48 +(*
4.49 + adapt type of terms with most general type to a more specific one.
4.50 + TODO: clarify how to decide by use of data from the current context.
4.51 +*)
4.52 +fun T_a2real (Type (s, [])) =
4.53 + if s = "'a" orelse s = "'b" orelse s = "'c" then HOLogic.realT else Type (s, [])
4.54 + | T_a2real (Type (s, Ts)) = Type (s, map T_a2real Ts)
4.55 + | T_a2real (TFree (s, srt)) =
4.56 + if s = "'a" orelse s = "'b" orelse s = "'c" then HOLogic.realT else TFree (s, srt)
4.57 + | T_a2real (TVar (("DUMMY", _), _)) = HOLogic.realT
4.58 + | T_a2real (TVar ((s, i), srt)) =
4.59 + if s = "'a" orelse s = "'b" orelse s = "'c" then HOLogic.realT else TVar ((s, i), srt)
4.60 +(*val adapt_to_type_real: term -> term*)
4.61 +fun adapt_to_type_real (Const( s, T)) = (Const( s, T_a2real T))
4.62 + | adapt_to_type_real (Free( s, T)) = (Free( s, T_a2real T))
4.63 + | adapt_to_type_real (Var( n, T)) = (Var( n, T_a2real T))
4.64 + | adapt_to_type_real (Bound i) = (Bound i)
4.65 + | adapt_to_type_real (Abs(s,T,t)) = Abs(s, T, adapt_to_type_real t)
4.66 + | adapt_to_type_real (t1 $ t2) = (adapt_to_type_real t1) $ (adapt_to_type_real t2);
4.67 +(*val adapt_to_type_int: term -> term*)
4.68 +fun adapt_to_type_int _ = raise ERROR "Model_Pattern.adapt_to_type NOT implemented for HOLogic.intT"
4.69 +
4.70 +fun adapt_term_to_type ctxt t =
4.71 + let
4.72 + val choice = ctxt |> K HOLogic.realT (*clarify how ctxt can be used here*)
4.73 + in
4.74 + if choice = HOLogic.realT then adapt_to_type_real t
4.75 + else if choice = HOLogic.intT then adapt_to_type_int t
4.76 + else raise ERROR "TermC.adapt_to_type only implemented for HOLogic.realT"
4.77 + end
4.78 +
4.79 +(** parse term in test/ **)
4.80 +(*
4.81 + This bypasses building ctxt at the begin of a calculation
4.82 + and thus borrows adapt_to_type (used for adapting pre-parsed terms from Know_Store).
4.83 + These identifiers have been crudely query\replaced and
4.84 + shall eventually be brought in accordance with src/.
4.85 +*)
4.86 +fun parse_test ctxt str = str
4.87 + |> Syntax.read_term_global (Proof_Context.theory_of ctxt)
4.88 + |> adapt_term_to_type ctxt
4.89 +fun parse_patt_test thy str = (thy, str)
4.90 + |>> Proof_Context.init_global
4.91 + |-> Proof_Context.read_term_pattern
4.92 + |> adapt_term_to_type (Proof_Context.init_global thy)
4.93 +
4.94 +(**)end(*struct*)
5.1 --- a/src/Tools/isac/BaseDefinitions/termC.sml Sun Jan 29 14:31:56 2023 +0100
5.2 +++ b/src/Tools/isac/BaseDefinitions/termC.sml Mon Jan 30 09:47:18 2023 +0100
5.3 @@ -79,8 +79,6 @@
5.4 val parseNEW': Proof.context -> string -> term (*old version to be eliminated*)
5.5 val parseNEW'': theory -> string -> term (*old version to be eliminated*)
5.6 (*for test/* *)
5.7 -(*goal*)val parse_test: Proof.context -> string -> term
5.8 -(*goal*)val parse_patt_test: theory -> string -> term
5.9
5.10 val str_of_free_opt: term -> string option
5.11 val str_of_int: int -> string
5.12 @@ -537,19 +535,6 @@
5.13 |>> Proof_Context.init_global
5.14 |-> Proof_Context.read_term_pattern
5.15
5.16 -(** parse in test/* **)
5.17 -(*
5.18 - This bypasses building ctxt at the begin of a calculation
5.19 - and thus borrows adapt_to_type (used for adapting pre-parsed terms from Know_Store).
5.20 -*)
5.21 -fun parse_test ctxt str = str
5.22 - |> Syntax.read_term_global (Proof_Context.theory_of ctxt)
5.23 - |> Model_Pattern.adapt_term_to_type ctxt
5.24 -fun parse_patt_test thy str = (thy, str)
5.25 - |>> Proof_Context.init_global
5.26 - |-> Proof_Context.read_term_pattern
5.27 - |> Model_Pattern.adapt_term_to_type (Proof_Context.init_global thy)
5.28 -
5.29
5.30 fun is_atom (Const _) = true
5.31 | is_atom (Free _) = true
5.32 @@ -597,7 +582,7 @@
5.33 | var_for vs (Abs (_, _, t)) id = var_for vs t id
5.34 | var_for vs (t1 $ t2) id = (var_for vs t1 id) @ (var_for vs t2 id)
5.35
5.36 -val poly_consts = (* TODO: adopt syntax-const from Isabelle*)
5.37 +val poly_consts =
5.38 [\<^const_name>\<open>plus\<close>, \<^const_name>\<open>minus\<close>,
5.39 \<^const_name>\<open>divide\<close>, \<^const_name>\<open>times\<close>,
5.40 \<^const_name>\<open>realpow\<close>];
6.1 --- a/src/Tools/isac/MathEngBasic/method.sml Sun Jan 29 14:31:56 2023 +0100
6.2 +++ b/src/Tools/isac/MathEngBasic/method.sml Mon Jan 30 09:47:18 2023 +0100
6.3 @@ -115,7 +115,7 @@
6.4 fun adapt_to_type ctxt {guh, mathauthors, start_refine, rew_ord, asm_rls, prog_rls, (*crls,*) rew_rls, errpats, calc,
6.5 program, where_rls, model, where_} =
6.6 let
6.7 - val where_ = map (Model_Pattern.adapt_term_to_type ctxt) where_
6.8 + val where_ = map (ParseC.adapt_term_to_type ctxt) where_
6.9 val model = map (Model_Pattern.adapt_to_type ctxt) model
6.10 val errpats = map (Error_Pattern_Def.adapt_to_type ctxt) errpats
6.11 in
7.1 --- a/src/Tools/isac/MathEngBasic/problem.sml Sun Jan 29 14:31:56 2023 +0100
7.2 +++ b/src/Tools/isac/MathEngBasic/problem.sml Mon Jan 30 09:47:18 2023 +0100
7.3 @@ -158,9 +158,9 @@
7.4 fun adapt_to_type ctxt ({guh, mathauthors, start_refine, thy, cas, solve_mets, where_rls, where_, model} : Probl_Def.T) =
7.5 let
7.6 val cas = case cas of
7.7 - SOME t => SOME (Model_Pattern.adapt_term_to_type ctxt t)
7.8 + SOME t => SOME (ParseC.adapt_term_to_type ctxt t)
7.9 | NONE => NONE
7.10 - val where_ = map (Model_Pattern.adapt_term_to_type ctxt) where_
7.11 + val where_ = map (ParseC.adapt_term_to_type ctxt) where_
7.12 val model = map (Model_Pattern.adapt_to_type ctxt) model
7.13 in
7.14 {guh = guh, mathauthors = mathauthors, start_refine = start_refine, thy = thy, cas = cas, solve_mets = solve_mets,
8.1 --- a/src/Tools/isac/MathEngBasic/tactic.sml Sun Jan 29 14:31:56 2023 +0100
8.2 +++ b/src/Tools/isac/MathEngBasic/tactic.sml Mon Jan 30 09:47:18 2023 +0100
8.3 @@ -115,7 +115,7 @@
8.4 |> map (apfst HOLogic.dest_string)
8.5 |> map (apfst (fn str => (TermC.mk_Free (str, dummyT))))
8.6 |> map (fn (t1, t2) =>
8.7 - (Model_Pattern.adapt_term_to_type ctxt t1, Model_Pattern.adapt_term_to_type ctxt t2)))
8.8 + (ParseC.adapt_term_to_type ctxt t1, ParseC.adapt_term_to_type ctxt t2)))
8.9 handle TERM _ => raise TERM ("Tactic.subst_adapt_to_type: wrong argument " ^ strs2str' subst, [])
8.10
8.11
9.1 --- a/src/Tools/isac/ProgLang/Prog_Tac.thy Sun Jan 29 14:31:56 2023 +0100
9.2 +++ b/src/Tools/isac/ProgLang/Prog_Tac.thy Mon Jan 30 09:47:18 2023 +0100
9.3 @@ -227,18 +227,18 @@
9.4 (* TermC.parse ctxt fails with "c_2 = 0" \<longrightarrow> \<open>c_2 = (0 :: 'a)\<close> and thus requires adapt_to_type *)
9.5 fun Take_adapt_to_type ctxt arg = arg
9.6 |> TermC.parse ctxt
9.7 - |> Model_Pattern.adapt_term_to_type ctxt
9.8 + |> ParseC.adapt_term_to_type ctxt
9.9
9.10 fun Substitute_adapt_to_type thy isasub =
9.11 isasub
9.12 - |> Model_Pattern.adapt_term_to_type (Proof_Context.init_global thy)
9.13 + |> ParseC.adapt_term_to_type (Proof_Context.init_global thy)
9.14 |> TermC.isalist2list
9.15 |> Subst.eqs_to_input;
9.16
9.17 (* TermC.parse ctxt fails with "c_2 = 0" \<longrightarrow> \<open>c_2 = (0 :: 'a)\<close> and thus requires adapt_to_type *)
9.18 fun Substitute_adapt_to_type' ctxt strs = strs
9.19 |> map (TermC.parse ctxt)
9.20 - |> map (Model_Pattern.adapt_term_to_type ctxt)
9.21 + |> map (ParseC.adapt_term_to_type ctxt)
9.22
9.23 (**)end(*struct*)
9.24 \<close> ML \<open>
10.1 --- a/src/Tools/isac/Specify/refine.sml Sun Jan 29 14:31:56 2023 +0100
10.2 +++ b/src/Tools/isac/Specify/refine.sml Mon Jan 30 09:47:18 2023 +0100
10.3 @@ -196,7 +196,7 @@
10.4 let
10.5 val {where_rls, model, where_, ...} = py: Problem.T
10.6 val model = map (Model_Pattern.adapt_to_type ctxt) model
10.7 - val where_ = map (Model_Pattern.adapt_term_to_type ctxt) where_
10.8 + val where_ = map (ParseC.adapt_term_to_type ctxt) where_
10.9 in
10.10 if M_Match.match_oris ctxt where_rls ori (model, where_)
10.11 then SOME (pblRD @ [pI])
10.12 @@ -206,7 +206,7 @@
10.13 let
10.14 val {where_rls, model, where_, ...} = py: Problem.T
10.15 val model = map (Model_Pattern.adapt_to_type ctxt) model
10.16 - val where_ = map (Model_Pattern.adapt_term_to_type ctxt) where_
10.17 + val where_ = map (ParseC.adapt_term_to_type ctxt) where_
10.18 in
10.19 if M_Match.match_oris ctxt where_rls ori (model, where_)
10.20 then (case refins ctxt (pblRD @ [pI]) ori pys of
10.21 @@ -230,7 +230,7 @@
10.22 val _ = (tracing o (curry op ^ "*** pass ") o strs2str) (pblRD @ [pI])
10.23 val {thy, model, where_, where_rls, ...} = py
10.24 val model = map (Model_Pattern.adapt_to_type ctxt) model
10.25 - val where_ = map (Model_Pattern.adapt_term_to_type ctxt) where_
10.26 + val where_ = map (ParseC.adapt_term_to_type ctxt) where_
10.27 val (oris, _) = O_Model.init thy fmz model; (*WN020803: oris might NOT be complete here*)
10.28 val (b, (itms, where_')) =
10.29 M_Match.match_oris' (Proof_Context.theory_of ctxt) oris (model, where_, where_rls)
10.30 @@ -244,7 +244,7 @@
10.31 val _ = (tracing o ((curry op ^)"*** pass ") o strs2str) (pblRD @ [pI])
10.32 val {thy, model, where_, where_rls, ...} = py
10.33 val model = map (Model_Pattern.adapt_to_type ctxt) model
10.34 - val where_ = map (Model_Pattern.adapt_term_to_type ctxt) where_
10.35 + val where_ = map (ParseC.adapt_term_to_type ctxt) where_
10.36 val (oris, _) = O_Model.init thy fmz model; (*WN020803: oris might NOT be complete here*)
10.37 val (b, (itms, where_')) =
10.38 M_Match.match_oris' (Proof_Context.theory_of ctxt) oris (model, where_, where_rls)
11.1 --- a/test/Tools/isac/ADDTESTS/All_Ctxt.thy Sun Jan 29 14:31:56 2023 +0100
11.2 +++ b/test/Tools/isac/ADDTESTS/All_Ctxt.thy Mon Jan 30 09:47:18 2023 +0100
11.3 @@ -20,6 +20,10 @@
11.4 ["Test", "squ-equ-test-subpbl1"]);
11.5 \<close> ML \<open>
11.6 val (p,_,f,nxt,_,pt) = Test_Code.init_calc @{context} [(f_model, f_refs)];
11.7 +\<close> ML \<open>
11.8 + val PblObj {ctxt, ...} = Ctree.get_obj I pt (#1 p)
11.9 + val Free ("x", Type ("Real.real", [])) = Syntax.read_term ctxt "x"
11.10 + val Free ("a", TFree ("'a", ["HOL.type"])) = Syntax.read_term ctxt "a"
11.11 \<close>
11.12
11.13 section \<open>start of specify phase\<close>
11.14 @@ -50,7 +54,7 @@
11.15 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.16 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.17 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.18 - val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.19 +(*[1], Frm*)val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt; val Rewrite_Set "norm_equation" = nxt;
11.20 \<close>
11.21
11.22 section \<open>start interpretation of method\<close>
11.23 @@ -64,7 +68,7 @@
11.24 ML \<open>
11.25 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.26 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.27 - val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.28 +(*[3], Pbl*)val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt; val Model_Problem = nxt;
11.29 \<close>
11.30
11.31 section \<open>start a subproblem: specification\<close>
11.32 @@ -72,17 +76,13 @@
11.33 ctxt is initialised from the thy in "SubProblem (thy, pbl, met) args"
11.34 and extended with the types of the variables in args.\<close>
11.35
11.36 -ML \<open>(*not significant in this example*)
11.37 - val ctxt = Ctree.get_ctxt pt p;
11.38 - val known_x = TermC.parse ctxt "x+y+z";
11.39 - val unknown = TermC.parseparse ctxt "a+b+c";
11.40 - if type_of known_x = HOLogic.realT andalso
11.41 - type_of unknown = TFree ("'a",["Groups.plus"])
11.42 - then () else error "All_Ctx: type constraints beginning specification of SubProblem ";
11.43 -\<close>
11.44 -
11.45 ML \<open>
11.46 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.47 +\<close> ML \<open>
11.48 + val PblObj {ctxt, ...} = Ctree.get_obj I pt (#1 p)
11.49 + val Free ("x", Type ("Real.real", [])) = Syntax.read_term ctxt "x"
11.50 + val Free ("a", TFree ("'a", ["HOL.type"])) = Syntax.read_term ctxt "a"
11.51 +\<close> ML \<open>
11.52 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.53 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.54 val (p,_,f,nxt,_,pt) = Test_Code.me nxt p [] pt;
11.55 @@ -116,8 +116,8 @@
11.56 ML \<open>
11.57 "artifically inject assumptions";
11.58 val (SOME (iform, cform), SOME (ires, cres)) = Ctree.get_obj Ctree.g_loc pt (fst p);
11.59 - val ctxt = ContextC.insert_assumptions [TermC.parse_test @{context} "x < sub_asm_out",
11.60 - TermC.parse_test @{context} "a < sub_asm_local"] cres;
11.61 + val ctxt = ContextC.insert_assumptions [ParseC.parse_test @{context} "x < sub_asm_out",
11.62 + ParseC.parse_test @{context} "a < sub_asm_local"] cres;
11.63 val pt = Ctree.update_loc' pt (fst p) (SOME (iform, cform), SOME (ires, ctxt));
11.64 \<close>
11.65
11.66 @@ -133,10 +133,6 @@
11.67 \<close>
11.68
11.69 ML \<open>
11.70 -eq_set
11.71 -\<close>
11.72 -
11.73 -ML \<open>
11.74 if eq_set op = (UnparseC.terms_to_strings (Ctree.get_assumptions pt p),
11.75 ["matches (?a = ?b) (- 1 + x = 0)", "x < sub_asm_out", "x = 1", "precond_rootmet x"])
11.76 then () else error "All_Ctx: asms after finishing SubProblem";
12.1 --- a/test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy Sun Jan 29 14:31:56 2023 +0100
12.2 +++ b/test/Tools/isac/ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform.thy Mon Jan 30 09:47:18 2023 +0100
12.3 @@ -80,7 +80,7 @@
12.4 ];
12.5
12.6 \<close> ML \<open>
12.7 - val t = TermC.parse_test @{context} "z / (z - 1) + z / (z - \<alpha>) + 1::real";
12.8 + val t = ParseC.parse_test @{context} "z / (z - 1) + z / (z - \<alpha>) + 1::real";
12.9 \<close> ML \<open>
12.10 val SOME (t', asm) = Rewrite.rewrite_set_ thy true inverse_Z t;
12.11 (*rewrite__set_ called with 'Erls' for '|| z || < 1'*)
13.1 --- a/test/Tools/isac/BaseDefinitions/calcelems.sml Sun Jan 29 14:31:56 2023 +0100
13.2 +++ b/test/Tools/isac/BaseDefinitions/calcelems.sml Mon Jan 30 09:47:18 2023 +0100
13.3 @@ -154,7 +154,7 @@
13.4 "----------- fun subst2str' --------------------------------------------------------------------";
13.5 "----------- fun subst2str' --------------------------------------------------------------------";
13.6 "----------- fun subst2str' --------------------------------------------------------------------";
13.7 -(*> subst2str' [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x"),
13.8 - (TermC.parse_test @{context} "bdv_2", TermC.parse_test @{context} "y")];
13.9 +(*> subst2str' [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x"),
13.10 + (ParseC.parse_test @{context} "bdv_2", ParseC.parse_test @{context} "y")];
13.11 val it = "[(bdv, x)]" : string
13.12 *)
14.1 --- a/test/Tools/isac/BaseDefinitions/contextC.sml Sun Jan 29 14:31:56 2023 +0100
14.2 +++ b/test/Tools/isac/BaseDefinitions/contextC.sml Mon Jan 30 09:47:18 2023 +0100
14.3 @@ -62,9 +62,9 @@
14.4 "----------- fun transfer_asms_from_to ---------------------------------------------------------";
14.5 val ctxt = Proof_Context.init_global @{theory "Isac_Knowledge"}
14.6 val from_ctxt = ContextC.insert_assumptions
14.7 - [TermC.parse_test @{context} "a < (fro::int)", TermC.parse_test @{context} "b < (fro::int)"] ctxt
14.8 + [ParseC.parse_test @{context} "a < (fro::int)", ParseC.parse_test @{context} "b < (fro::int)"] ctxt
14.9 val to_ctxt = ContextC.insert_assumptions
14.10 - [TermC.parse_test @{context} "b < (to::int)", TermC.parse_test @{context} "c < (to::int)"] ctxt
14.11 + [ParseC.parse_test @{context} "b < (to::int)", ParseC.parse_test @{context} "c < (to::int)"] ctxt
14.12 val new_ctxt = transfer_asms_from_to from_ctxt to_ctxt;
14.13 if UnparseC.terms_to_strings (get_assumptions new_ctxt) = ["b < fro", "b < to", "c < to"]
14.14 then () else error "fun transfer_asms_from_to changed"
14.15 @@ -74,34 +74,34 @@
14.16 "----------- fun avoid_contradict --------------------------------------------------------------";
14.17 "----------- fun avoid_contradict --------------------------------------------------------------";
14.18 val preds = [
14.19 -(*0.where_*)TermC.parse_test @{context} "x / (x \<up> 2 - 6 * x + 9) - 1 / (x \<up> 2 - 3 * x) =\n1 / x is_ratequation_in x",
14.20 -(*1.where_*)TermC.parse_patt_test @{theory} ("\<not> matches (?a = 0)\n ((3 + - 1 * x + x \<up> 2) * x =\n 1 * (9 * x + -6 * x \<up> 2 + x \<up> 3)) \<or>\n"
14.21 +(*0.where_*)ParseC.parse_test @{context} "x / (x \<up> 2 - 6 * x + 9) - 1 / (x \<up> 2 - 3 * x) =\n1 / x is_ratequation_in x",
14.22 +(*1.where_*)ParseC.parse_patt_test @{theory} ("\<not> matches (?a = 0)\n ((3 + - 1 * x + x \<up> 2) * x =\n 1 * (9 * x + -6 * x \<up> 2 + x \<up> 3)) \<or>\n"
14.23 (*1.where_*) ^ "\<not> lhs ((3 + - 1 * x + x \<up> 2) * x =\n 1 * (9 * x + -6 * x \<up> 2 + x \<up> 3)) is_poly_in x"),
14.24 -(*0.asm*)TermC.parse_test @{context} "x \<noteq> 0", (* <-------------- "x \<noteq> 0" would contradict "x = 0" ---\*)
14.25 -(*0.asm*)TermC.parse_test @{context} "9 * x + -6 * x \<up> 2 + x \<up> 3 \<noteq> 0"
14.26 +(*0.asm*)ParseC.parse_test @{context} "x \<noteq> 0", (* <-------------- "x \<noteq> 0" would contradict "x = 0" ---\*)
14.27 +(*0.asm*)ParseC.parse_test @{context} "9 * x + -6 * x \<up> 2 + x \<up> 3 \<noteq> 0"
14.28 ];
14.29
14.30 -val t = TermC.parse_test @{context} "[x = 0, x = 6 / 5]";
14.31 +val t = ParseC.parse_test @{context} "[x = 0, x = 6 / 5]";
14.32 val (t', for_asm) = avoid_contradict t preds;
14.33 if UnparseC.term t' = "[x = 6 / 5]" andalso map UnparseC.term for_asm = ["x = 6 / 5"]
14.34 then () else error "avoid_contradict [x = 0, x = 6 / 5] CHANGED";
14.35
14.36 -val t = TermC.parse_test @{context} "x = 0";
14.37 +val t = ParseC.parse_test @{context} "x = 0";
14.38 val (t', for_asm) = avoid_contradict t preds;
14.39 if UnparseC.term t' = "bool_undef" andalso map UnparseC.term for_asm = []
14.40 then () else error "avoid_contradict x = 0 CHANGED"; (* "x \<noteq> 0" in preds *)
14.41
14.42 -val t = TermC.parse_test @{context} "x = 1";
14.43 +val t = ParseC.parse_test @{context} "x = 1";
14.44 val (t', for_asm) = avoid_contradict t preds;
14.45 if UnparseC.term t' = "x = 1" andalso map UnparseC.term for_asm = ["x = 1"]
14.46 then () else error "avoid_contradict x = 1 CHANGED"; (* "x \<noteq> 1" NOT in preds *)
14.47
14.48 -val t = TermC.parse_test @{context} "a + b";
14.49 +val t = ParseC.parse_test @{context} "a + b";
14.50 val (t', for_asm) = avoid_contradict t preds;
14.51 if UnparseC.term t' = "a + b" andalso map UnparseC.term for_asm = []
14.52 then () else error "avoid_contradict a + b CHANGED"; (* NOT a predicate *)
14.53
14.54 -val t = TermC.parse_test @{context} "[a + b]";
14.55 +val t = ParseC.parse_test @{context} "[a + b]";
14.56 val (t', for_asm) = avoid_contradict t preds;
14.57 if UnparseC.term t' = "[a + b]" andalso map UnparseC.term for_asm = []
14.58 then () else error "avoid_contradict [a + b] CHANGED"; (* NOT a predicate *)
14.59 @@ -113,12 +113,12 @@
14.60 val ctxt = Proof_Context.init_global @{theory "Isac_Knowledge"}
14.61
14.62 val sub_ctxt = ContextC.insert_assumptions
14.63 - [TermC.parse_test @{context} "a < (fro::int)", TermC.parse_test @{context} "b < (fro::int)"] ctxt
14.64 -val prog_res = TermC.parse_test @{context} "[x_1 = 1, x_2 = (2::int), x_3 = 3]";
14.65 + [ParseC.parse_test @{context} "a < (fro::int)", ParseC.parse_test @{context} "b < (fro::int)"] ctxt
14.66 +val prog_res = ParseC.parse_test @{context} "[x_1 = 1, x_2 = (2::int), x_3 = 3]";
14.67
14.68 (* NO contradiction ..*)
14.69 val caller_ctxt = ContextC.insert_assumptions
14.70 - [TermC.parse_test @{context} "b < (to::int)", TermC.parse_test @{context} "c < (to::int)"] ctxt
14.71 + [ParseC.parse_test @{context} "b < (to::int)", ParseC.parse_test @{context} "c < (to::int)"] ctxt
14.72 val (t, new_ctxt) = subpbl_to_caller sub_ctxt prog_res caller_ctxt;
14.73
14.74 if UnparseC.term t = "[x_1 = 1, x_2 = 2, x_3 = 3]" andalso map UnparseC.term (get_assumptions new_ctxt) =
14.75 @@ -127,7 +127,7 @@
14.76
14.77 (* a contradiction ..*)
14.78 val caller_ctxt = ContextC.insert_assumptions
14.79 - [TermC.parse_test @{context} "b < (to::int)", TermC.parse_test @{context} "x_2 \<noteq> (2::int)"] ctxt
14.80 + [ParseC.parse_test @{context} "b < (to::int)", ParseC.parse_test @{context} "x_2 \<noteq> (2::int)"] ctxt
14.81 val (t, new_ctxt) = subpbl_to_caller sub_ctxt prog_res caller_ctxt;
14.82
14.83 if UnparseC.term t = "[x_1 = 1, x_3 = 3]" andalso map UnparseC.term (get_assumptions new_ctxt) =
15.1 --- a/test/Tools/isac/BaseDefinitions/rewrite-order.sml Sun Jan 29 14:31:56 2023 +0100
15.2 +++ b/test/Tools/isac/BaseDefinitions/rewrite-order.sml Mon Jan 30 09:47:18 2023 +0100
15.3 @@ -17,7 +17,7 @@
15.4 "-------- identify difference in term-order between isa=NEW, isa2+OLD --------------------------";
15.5 "-------- identify difference in term-order between isa=NEW, isa2+OLD --------------------------";
15.6 "-------- identify difference in term-order between isa=NEW, isa2+OLD --------------------------";
15.7 -val form = TermC.parse_test @{context} "x + -2 ::real"
15.8 +val form = ParseC.parse_test @{context} "x + -2 ::real"
15.9 val Repeat {rew_ord = ("sqrt_right", rew_ord_), asm_rls, ...} = Test_simplify;
15.10 val ctxt = Proof_Context.init_global @{theory Test};
15.11 (*Rewrite.trace_on := false; (*true false*)*)
16.1 --- a/test/Tools/isac/BaseDefinitions/substitution.sml Sun Jan 29 14:31:56 2023 +0100
16.2 +++ b/test/Tools/isac/BaseDefinitions/substitution.sml Mon Jan 30 09:47:18 2023 +0100
16.3 @@ -85,7 +85,7 @@
16.4 Subst.program_to_input: Proof.context -> Subst.program -> string list;
16.5
16.6 val {program = Prog prog, ...} = MethodC.from_store ctxt ["diff", "differentiate_on_R"];
16.7 -val env = [(TermC.parse_test @{context} "v_v", TermC.parse_test @{context} "x")] : Subst.T;
16.8 +val env = [(ParseC.parse_test @{context} "v_v", ParseC.parse_test @{context} "x")] : Subst.T;
16.9
16.10 "~~~~~ fun for_bdv, args:"; val (prog, env) = (prog, env);
16.11 fun scan (Const _) = NONE
17.1 --- a/test/Tools/isac/BaseDefinitions/termC.sml Sun Jan 29 14:31:56 2023 +0100
17.2 +++ b/test/Tools/isac/BaseDefinitions/termC.sml Mon Jan 30 09:47:18 2023 +0100
17.3 @@ -186,7 +186,7 @@
17.4 "\<not> ?bdv occurs_in ?a \<Longrightarrow>\n(?a + ?bdv = 0) = (?bdv = - 1 * ?a)"
17.5 then ()
17.6 else error "termC.sml d1_isolate_add2";
17.7 - val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
17.8 + val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
17.9 val t = (Eval.norm o Thm.prop_of) @{thm d1_isolate_add2};
17.10 val t' = TermC.inst_bdv subst t;
17.11 if UnparseC.term t' = "\<not> x occurs_in ?a \<Longrightarrow> (?a + x = 0) = (x = - 1 * ?a)"
17.12 @@ -199,10 +199,10 @@
17.13 (*default_print_depth 5;*)
17.14
17.15 val subst =
17.16 - [(TermC.parse_test @{context} "bdv_1", TermC.parse_test @{context} "c"),
17.17 - (TermC.parse_test @{context} "bdv_2", TermC.parse_test @{context} "c_2"),
17.18 - (TermC.parse_test @{context} "bdv_3", TermC.parse_test @{context} "c_3"),
17.19 - (TermC.parse_test @{context} "bdv_4", TermC.parse_test @{context} "c_4")];
17.20 + [(ParseC.parse_test @{context} "bdv_1", ParseC.parse_test @{context} "c"),
17.21 + (ParseC.parse_test @{context} "bdv_2", ParseC.parse_test @{context} "c_2"),
17.22 + (ParseC.parse_test @{context} "bdv_3", ParseC.parse_test @{context} "c_3"),
17.23 + (ParseC.parse_test @{context} "bdv_4", ParseC.parse_test @{context} "c_4")];
17.24 val t = (Eval.norm o Thm.prop_of) @{thm separate_bdvs_add};
17.25 val t' = TermC.inst_bdv subst t;
17.26
17.27 @@ -213,9 +213,9 @@
17.28 "----------- subst_atomic_all ---------------------------";
17.29 "----------- subst_atomic_all ---------------------------";
17.30 "----------- subst_atomic_all ---------------------------";
17.31 - val t = TermC.parse_test @{context} "(tl vs_vs) from vs_vs occur_exactly_in (NTH 1 (es_es::bool list))";
17.32 - val env = [(TermC.parse_test @{context} "vs_vs::real list", TermC.parse_test @{context} "[c, c_2]"),
17.33 - (TermC.parse_test @{context} "es_es::bool list", TermC.parse_test @{context} "[c_2 = 0, c + c_2 = 1]")];
17.34 + val t = ParseC.parse_test @{context} "(tl vs_vs) from vs_vs occur_exactly_in (NTH 1 (es_es::bool list))";
17.35 + val env = [(ParseC.parse_test @{context} "vs_vs::real list", ParseC.parse_test @{context} "[c, c_2]"),
17.36 + (ParseC.parse_test @{context} "es_es::bool list", ParseC.parse_test @{context} "[c_2 = 0, c + c_2 = 1]")];
17.37 val (all_Free_subst, t') = TermC.subst_atomic_all env t;
17.38
17.39 if all_Free_subst andalso
17.40 @@ -231,8 +231,8 @@
17.41 "----------- Pattern.match ------------------------------";
17.42 "----------- Pattern.match ------------------------------";
17.43 "----------- Pattern.match ------------------------------";
17.44 - val t = TermC.parse_test @{context} "3 * x\<up>2 = (1::real)";
17.45 - val pat = (TermC.mk_Var o TermC.parse_test @{context}) "a * b\<up>2 = (c::real)";
17.46 + val t = ParseC.parse_test @{context} "3 * x\<up>2 = (1::real)";
17.47 + val pat = (TermC.mk_Var o ParseC.parse_test @{context}) "a * b\<up>2 = (c::real)";
17.48 (* ! \<up> \<up> ^^!... necessary for Pattern.match, see Logic.varify_global below*)
17.49 val insts = Pattern.match @{theory "Isac_Knowledge"} (pat, t) (Vartab.empty, Vartab.empty);
17.50 (*default_print_depth 3; 999*) insts;
17.51 @@ -243,7 +243,7 @@
17.52 (("c", 0), ("Real.real", Free ("1", "Real.real")))})*)
17.53
17.54 "----- throws exn MATCH...";
17.55 -(* val t = TermC.parse_test @{context} "x";
17.56 +(* val t = ParseC.parse_test @{context} "x";
17.57 (Pattern.match @{theory "Isac_Knowledge"} (pat, t) (Vartab.empty, Vartab.empty))
17.58 handle MATCH => ???; *)
17.59
17.60 @@ -283,7 +283,7 @@
17.61 else ();
17.62
17.63 "----- test 2: Nok";
17.64 - val pa = Logic.varify_global (TermC.parse_test @{context} "a = (0::real)");(*<<<<<<<-------------*)
17.65 + val pa = Logic.varify_global (ParseC.parse_test @{context} "a = (0::real)");(*<<<<<<<-------------*)
17.66 tracing "paLo2=..."; TermC.atom_trace_detail @{context} pa; tracing "...=paLo2";
17.67 (***
17.68 *** Const (op =, real => real => bool)
17.69 @@ -291,11 +291,11 @@
17.70 *** . Var ((0, 0), real)
17.71 ***)
17.72 "----- test 2a true";
17.73 - val tm = TermC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (0::real)"; (*<<<<<<<-------------*)
17.74 + val tm = ParseC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (0::real)"; (*<<<<<<<-------------*)
17.75 if TermC.matches thy tm pa then ()
17.76 else error "termC.sml diff.behav. in TermC.matches true 2";
17.77 "----- test 2b false";
17.78 - val tm = TermC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (3::real)"; (*<<<<<<<-------------*)
17.79 + val tm = ParseC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (3::real)"; (*<<<<<<<-------------*)
17.80 if TermC.matches thy tm pa then error "termC.sml diff.behav. in TermC.matches false 2"
17.81 else ();
17.82 (* i.e. !!!!!!!!!!!!!!!!! THIS KIND OF PATTERN IS NOT RELIABLE !!!!!!!!!!!!!!!!!
17.83 @@ -303,7 +303,7 @@
17.84 else ();*)
17.85
17.86 "----- test 3: OK";
17.87 - val pa = TermC.mk_Var (TermC.parse_test @{context} "a = (0::real)");(*<<<<<<<-------------*)
17.88 + val pa = TermC.mk_Var (ParseC.parse_test @{context} "a = (0::real)");(*<<<<<<<-------------*)
17.89 tracing "paF2=..."; TermC.atom_trace_detail @{context} pa; tracing "...=paF2";
17.90 (***
17.91 *** Const (op =, real => real => bool)
17.92 @@ -311,22 +311,22 @@
17.93 *** . Free (0, real)
17.94 ***)
17.95 "----- test 3a true";
17.96 - val tm = TermC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (0::real)"; (*<<<<<<<-------------*)
17.97 + val tm = ParseC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (0::real)"; (*<<<<<<<-------------*)
17.98 if TermC.matches thy tm pa then ()
17.99 else error "termC.sml diff.behav. in TermC.matches true 3";
17.100 "----- test 3b false";
17.101 - val tm = TermC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (3::real)"; (*<<<<<<<-------------*)
17.102 + val tm = ParseC.parse_test @{context} "-8 - 2 * x + x ^ 2 = (3::real)"; (*<<<<<<<-------------*)
17.103 if TermC.matches thy tm pa then error "termC.sml diff.behav. in TermC.matches false 3"
17.104 else ();
17.105
17.106 "----- test 4=3 with specific data";
17.107 - val pa = TermC.mk_Var (TermC.parse_test @{context} "M_b 0");
17.108 + val pa = TermC.mk_Var (ParseC.parse_test @{context} "M_b 0");
17.109 "----- test 4a true";
17.110 - val tm = TermC.parse_test @{context} "M_b 0";
17.111 + val tm = ParseC.parse_test @{context} "M_b 0";
17.112 if TermC.matches thy tm pa then ()
17.113 else error "termC.sml diff.behav. in TermC.matches true 4";
17.114 "----- test 4b false";
17.115 - val tm = TermC.parse_test @{context} "M_b x";
17.116 + val tm = ParseC.parse_test @{context} "M_b x";
17.117 if TermC.matches thy tm pa then error "termC.sml diff.behav. in TermC.matches false 4"
17.118 else ();
17.119
17.120 @@ -362,7 +362,7 @@
17.121 val ctxt = @{context}
17.122 val str = "x + 2*z";
17.123 val t = Syntax.read_term_global thy str;
17.124 - val t = Model_Pattern.adapt_term_to_type ctxt (Syntax.read_term_global thy str);
17.125 + val t = ParseC.adapt_term_to_type ctxt (Syntax.read_term_global thy str);
17.126 Thm.global_cterm_of thy t;
17.127 case TermC.parseNEW ctxt str of
17.128 SOME t' => t'
17.129 @@ -450,7 +450,7 @@
17.130 "----- read_term_pattern ---";
17.131 val t = (thy, str) |>> Proof_Context.init_global
17.132 |-> Proof_Context.read_term_pattern;
17.133 -val t_real = Model_Pattern.adapt_term_to_type ctxt t;
17.134 +val t_real = ParseC.adapt_term_to_type ctxt t;
17.135 if UnparseC.term_in_ctxt ctxt t_real =
17.136 "\<not> (matchsub ((?a::real) + ((?b::real) + (?c::real))) (t_t::real) \<or>\n "
17.137 ^ "matchsub (?a + (?b - ?c)) t_t \<or>\n "
17.138 @@ -540,10 +540,10 @@
17.139 "----------- fun TermC.is_bdv_subst ------------------------------------------------------------------";
17.140 "----------- fun TermC.is_bdv_subst ------------------------------------------------------------------";
17.141 "----------- fun TermC.is_bdv_subst ------------------------------------------------------------------";
17.142 -if TermC.is_bdv_subst (TermC.parse_test @{context} "[(''bdv'', v_v)]") then ()
17.143 +if TermC.is_bdv_subst (ParseC.parse_test @{context} "[(''bdv'', v_v)]") then ()
17.144 else error "TermC.is_bdv_subst canged 1";
17.145
17.146 -if TermC.is_bdv_subst (TermC.parse_test @{context} "[(''bdv_1'', v_s1),(''bdv_2'', v_s2)]") then ()
17.147 +if TermC.is_bdv_subst (ParseC.parse_test @{context} "[(''bdv_1'', v_s1),(''bdv_2'', v_s2)]") then ()
17.148 else error "TermC.is_bdv_subst canged 2";
17.149
17.150 "----------- fun str_of_int --------------------------------------------------------------------";
17.151 @@ -584,41 +584,41 @@
17.152 case ThmC_Def.int_opt_of_string "-123" of
17.153 SOME ~123 => () | _ => raise error "ThmC_Def.int_opt_of_string -123 changed";
17.154
17.155 -val t = TermC.parse_test @{context} "1";
17.156 +val t = ParseC.parse_test @{context} "1";
17.157 if TermC.is_num t = true then () else error "TermC.is_num 1";
17.158
17.159 -val t = TermC.parse_test @{context} "-1";
17.160 +val t = ParseC.parse_test @{context} "-1";
17.161 if TermC.is_num t = true then () else error "TermC.is_num -1";
17.162
17.163 -val t = TermC.parse_test @{context} "a123";
17.164 +val t = ParseC.parse_test @{context} "a123";
17.165 if TermC.is_num t = false then () else error "TermC.is_num a123";
17.166
17.167 "----------- fun TermC.is_f_x ------------------------------------------------------------------------";
17.168 "----------- fun TermC.is_f_x ------------------------------------------------------------------------";
17.169 "----------- fun TermC.is_f_x ------------------------------------------------------------------------";
17.170 -val t = TermC.parse_test @{context} "q_0/2 * L * x";
17.171 +val t = ParseC.parse_test @{context} "q_0/2 * L * x";
17.172 if TermC.is_f_x t = false then () else error "TermC.is_f_x q_0/2 * L * x";
17.173
17.174 -val t = TermC.parse_test @{context} "M_b x";
17.175 +val t = ParseC.parse_test @{context} "M_b x";
17.176 if TermC.is_f_x t = true then () else error "M_b x";
17.177
17.178 "----------- fun list2isalist, fun isalist2list ------------------------------------------------";
17.179 "----------- fun list2isalist, fun isalist2list ------------------------------------------------";
17.180 "----------- fun list2isalist, fun isalist2list ------------------------------------------------";
17.181 -val t = TermC.parse_test @{context} "R=(R::real)";
17.182 +val t = ParseC.parse_test @{context} "R=(R::real)";
17.183 val T = type_of t;
17.184 val ss = TermC.list2isalist T [t,t,t];
17.185 if UnparseC.term ss = "[R = R, R = R, R = R]" then () else error "list2isalist 1";
17.186
17.187 -val t = TermC.parse_test @{context} "[a=b,c=d,e=f]";
17.188 +val t = ParseC.parse_test @{context} "[a=b,c=d,e=f]";
17.189 val il = TermC.isalist2list t;
17.190 if UnparseC.terms il = "[\"a = b\", \"c = d\", \"e = f\"]" then () else error "isalist2list 2";
17.191
17.192 -val t = TermC.parse_test @{context} "[a=b,c=d,e=f]";
17.193 +val t = ParseC.parse_test @{context} "[a=b,c=d,e=f]";
17.194 val il = TermC.isalist2list t;
17.195 if UnparseC.terms il = "[\"a = b\", \"c = d\", \"e = f\"]" then () else error "isalist2list 3";
17.196
17.197 -val t = TermC.parse_test @{context} "ss___s::bool list";
17.198 +val t = ParseC.parse_test @{context} "ss___s::bool list";
17.199 (TermC.isalist2list t; error "isalist2list 1") handle TERM ("isalist2list applied to NON-list: ", _) =>();
17.200
17.201 "----------- fun TermC.strip_imp_prems', fun TermC.ins_concl -----------------------------------------------";
17.202 @@ -650,7 +650,7 @@
17.203 val t = TermC.mk_factroot "SqRoot.sqrt" T 2 3;
17.204 if UnparseC.term t = "2 * ??.SqRoot.sqrt 3" then () else error "mk_factroot";
17.205
17.206 -val t = TermC.parse_test @{context} "aaa + bbb";
17.207 +val t = ParseC.parse_test @{context} "aaa + bbb";
17.208 val op_ as Const (\<^const_name>\<open>plus\<close>, Top) $ Free ("aaa", T1) $ Free ("bbb", T2) = t;
17.209 val t' = TermC.mk_num_op_num T1 T2 (\<^const_name>\<open>plus\<close>, Top) 2 3;
17.210 if UnparseC.term t' = "2 + 3" then () else error "mk_num_op_num";
17.211 @@ -667,11 +667,11 @@
17.212 "----------- fun TermC.is_list -----------------------------------------------------------------------";
17.213 "----------- fun TermC.is_list -----------------------------------------------------------------------";
17.214 val (SOME ct) = TermC.parseNEW ctxt "lll::real list";
17.215 -val t = TermC.parse_test @{context} "lll::real list";
17.216 +val t = ParseC.parse_test @{context} "lll::real list";
17.217 val ty = Term.type_of ct;
17.218 if TermC.is_list t = false then () else error "TermC.is_list lll::real list";
17.219
17.220 -val t = TermC.parse_test @{context} "[a, b, c]";
17.221 +val t = ParseC.parse_test @{context} "[a, b, c]";
17.222 val ty = Term.type_of ct;
17.223 if TermC.is_list t = true then () else error "TermC.is_list [a, b, c]";
17.224
18.1 --- a/test/Tools/isac/Interpret/error-pattern.sml Sun Jan 29 14:31:56 2023 +0100
18.2 +++ b/test/Tools/isac/Interpret/error-pattern.sml Mon Jan 30 09:47:18 2023 +0100
18.3 @@ -120,13 +120,13 @@
18.4 val fod = Derive.do_one (Proof_Context.init_global @{theory "Isac_Knowledge"}) Atools_erls
18.5 ((#rules o Rule_Set.rep) Test_simplify)
18.6 (sqrt_right false) NONE
18.7 - (TermC.parse_test @{context} "x + 1 + - 1 * 2 = 0");
18.8 + (ParseC.parse_test @{context} "x + 1 + - 1 * 2 = 0");
18.9 (writeln o (Derive.trtas2str ctxt)) fod;
18.10
18.11 val ifod = Derive.do_one (Proof_Context.init_global @{theory "Isac_Knowledge"}) Atools_erls
18.12 ((#rules o Rule_Set.rep) Test_simplify)
18.13 (sqrt_right false) NONE
18.14 - (TermC.parse_test @{context} "- 2 * 1 + (1 + x) = 0");
18.15 + (ParseC.parse_test @{context} "- 2 * 1 + (1 + x) = 0");
18.16 (writeln o (Derive.trtas2str ctxt)) ifod;
18.17 fun equal (_,_,(t1, _)) (_,_,(t2, _)) = t1 = t2;
18.18 val (fod', rifod') = dropwhile' equal (rev fod) (rev ifod);
18.19 @@ -643,7 +643,7 @@
18.20 "--------- Take as 1st tac, start with <NEW> (CAS input) ---------";
18.21 "--------- Take as 1st tac, start with <NEW> (CAS input) ---------";
18.22 "--------- Take as 1st tac, start with <NEW> (CAS input) ---------";
18.23 -val t = TermC.parse_test @{context} "Diff (x \<up> 2 + x + 1, x)";
18.24 +val t = ParseC.parse_test @{context} "Diff (x \<up> 2 + x + 1, x)";
18.25 case t of Const (\<^const_name>\<open>Diff\<close>, _) $ _ => ()
18.26 | _ => raise
18.27 error "diff.sml behav.changed for CAS Diff (..., x)";
18.28 @@ -911,11 +911,11 @@
18.29 "--------- build fun check_for' ------------------------------";
18.30 "--------- build fun check_for' ------------------------------";
18.31 "--------- build fun check_for' ------------------------------";
18.32 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")]: subst;
18.33 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")]: subst;
18.34 val rls = norm_Rational
18.35 val pat = TermC.parse_patt @{theory} "(?a + ?b)/(?b + ?c) = ?a / ?c";
18.36 -val (res, inf) = (TermC.parse_test @{context} "(2 + 3)/(3 + 4)", TermC.parse_test @{context} "2 / 4");
18.37 -val (res, inf) = (TermC.parse_test @{context} "(2 + 3)/(3 + 4)", TermC.parse_test @{context} "1 / 2");
18.38 +val (res, inf) = (ParseC.parse_test @{context} "(2 + 3)/(3 + 4)", ParseC.parse_test @{context} "2 / 4");
18.39 +val (res, inf) = (ParseC.parse_test @{context} "(2 + 3)/(3 + 4)", ParseC.parse_test @{context} "1 / 2");
18.40
18.41 val (res', _, _, rewritten) = (*rewritten: the lhs of the pattern TermC.matches in res*)
18.42 rew_sub ctxt 1 [] Rewrite_Ord.function_empty Rule_Set.empty false [] (HOLogic.Trueprop $ pat) res;
18.43 @@ -933,21 +933,21 @@
18.44 norm_res = norm_inf;
18.45
18.46 val pat = TermC.parse_patt @{theory} "(?a + ?b)/?a = ?b";
18.47 -val (res, inf) = (TermC.parse_test @{context} "(2 + 3)/2", TermC.parse_test @{context} "3");
18.48 +val (res, inf) = (ParseC.parse_test @{context} "(2 + 3)/2", ParseC.parse_test @{context} "3");
18.49 if check_for' ctxt (res, inf) subst ("errpatID", pat) rls = SOME "errpatID"
18.50 then () else error "error patt example1 changed";
18.51
18.52 val pat = TermC.parse_patt @{theory} "(?a + ?b)/(?a + ?c) = ?b / ?c";
18.53 -val (res, inf) = (TermC.parse_test @{context} "(2 + 3)/(2 + 4)", TermC.parse_test @{context} "3 / 4");
18.54 +val (res, inf) = (ParseC.parse_test @{context} "(2 + 3)/(2 + 4)", ParseC.parse_test @{context} "3 / 4");
18.55 if check_for' ctxt (res, inf) subst ("errpatID", pat) rls = SOME "errpatID"
18.56 then () else error "error patt example2 changed";
18.57
18.58 val pat = TermC.parse_patt @{theory} "(?a + ?b)/(?b + ?c) = ?a / ?c";
18.59 -val (res, inf) = (TermC.parse_test @{context} "(2 + 3)/(3 + 4)", TermC.parse_test @{context} "2 / 4");
18.60 +val (res, inf) = (ParseC.parse_test @{context} "(2 + 3)/(3 + 4)", ParseC.parse_test @{context} "2 / 4");
18.61 if check_for' ctxt (res, inf) subst ("errpatID", pat) rls = SOME "errpatID"
18.62 then () else error "error patt example3 changed";
18.63
18.64 -val inf = TermC.parse_test @{context} "1 / 2";
18.65 +val inf = ParseC.parse_test @{context} "1 / 2";
18.66 if check_for' ctxt (res, inf) subst ("errpatID", pat) rls = SOME "errpatID"
18.67 then () else error "error patt example3 changed";
18.68
18.69 @@ -955,15 +955,15 @@
18.70 "--------- build fun check_for' ?bdv -------------------------";
18.71 "--------- build fun check_for' ?bdv -------------------------";
18.72 val ctxt = Proof_Context.init_global @{theory}
18.73 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")]: subst;
18.74 -val t = TermC.parse_test @{context} "d_d x (x \<up> 2 + sin (x \<up> 4))";
18.75 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")]: subst;
18.76 +val t = ParseC.parse_test @{context} "d_d x (x \<up> 2 + sin (x \<up> 4))";
18.77 val SOME (t, _) = rewrite_set_inst_ ctxt false subst norm_diff t;
18.78 if UnparseC.term t = "2 * x + cos (x \<up> 4) * 4 * x \<up> 3" then ()
18.79 else error "build fun check_for' ?bdv changed 1";
18.80
18.81 val rls = norm_diff
18.82 val pat = TermC.parse_patt @{theory} "d_d ?bdv (sin ?u) = cos (d_d ?bdv ?u)";
18.83 -val (res, inf) = (TermC.parse_test @{context} "2 * x + d_d x (sin (x \<up> 4))", TermC.parse_test @{context} "2 * x + cos (4 * x \<up> 3)");
18.84 +val (res, inf) = (ParseC.parse_test @{context} "2 * x + d_d x (sin (x \<up> 4))", ParseC.parse_test @{context} "2 * x + cos (4 * x \<up> 3)");
18.85
18.86 val (res', _, _, rewritten) = (*rewritten: the lhs of the pattern TermC.matches in res*)
18.87 rew_sub ctxt 1 subst Rewrite_Ord.function_empty Rule_Set.empty false [] (HOLogic.Trueprop $ pat) res;
18.88 @@ -993,11 +993,11 @@
18.89 "--------- build fun check_for ------------------------";
18.90 "--------- build fun check_for ------------------------";
18.91 val (res, inf) =
18.92 - (TermC.parse_test @{context} "d_d x (x \<up> 2) + d_d x (sin (x \<up> 4))",
18.93 - TermC.parse_test @{context} "d_d x (x \<up> 2) + cos (4 * x \<up> 3)");
18.94 + (ParseC.parse_test @{context} "d_d x (x \<up> 2) + d_d x (sin (x \<up> 4))",
18.95 + ParseC.parse_test @{context} "d_d x (x \<up> 2) + cos (4 * x \<up> 3)");
18.96 val {errpats, rew_rls = rls, program = Prog prog, ...} = MethodC.from_store ctxt ["diff", "differentiate_on_R"]
18.97
18.98 -val env = [(TermC.parse_test @{context} "v_v", TermC.parse_test @{context} "x")];
18.99 +val env = [(ParseC.parse_test @{context} "v_v", ParseC.parse_test @{context} "x")];
18.100 val errpats =
18.101 [Error_Pattern.empty, (*generalised for testing*)
18.102 ("chain-rule-diff-both",
18.103 @@ -1344,7 +1344,7 @@
18.104 "--------- fun concat_deriv --------------------------------------";
18.105 (*
18.106 val ({rew_ord, asm_rls, rules,...}, fo, ifo) =
18.107 - (Rule_Set.rep Test_simplify, TermC.parse_test @{context} "x+1+ - 1*2=0", TermC.parse_test @{context} "-2*1+(x+1)=0");
18.108 + (Rule_Set.rep Test_simplify, ParseC.parse_test @{context} "x+1+ - 1*2=0", ParseC.parse_test @{context} "-2*1+(x+1)=0");
18.109 (tracing o Derive.trtas2str) fod';
18.110 > ["
18.111 (x + 1 + - 1 * 2 = 0, Thm ("radd_commute", "?m + ?n = ?n + ?m"), (- 1 * 2 + (x + 1) = 0, []))", "
19.1 --- a/test/Tools/isac/Knowledge/algein.sml Sun Jan 29 14:31:56 2023 +0100
19.2 +++ b/test/Tools/isac/Knowledge/algein.sml Mon Jan 30 09:47:18 2023 +0100
19.3 @@ -102,7 +102,7 @@
19.4 val rew_ord = Rewrite_Ord.function_empty;
19.5 val asm_rls = Rule_Set.Empty;
19.6 val thm = ThmC.thm_from_thy thy "sym_mult_zero_right";
19.7 -val t = TermC.parse_test @{context} "0 = (0::real)";
19.8 +val t = ParseC.parse_test @{context} "0 = (0::real)";
19.9 val SOME (t',_) = rewrite_ ctxt rew_ord asm_rls false thm t;
19.10 UnparseC.term t' = "0 = ?a1 * 0"; (* = true*)
19.11
20.1 --- a/test/Tools/isac/Knowledge/biegelinie-1.sml Sun Jan 29 14:31:56 2023 +0100
20.2 +++ b/test/Tools/isac/Knowledge/biegelinie-1.sml Mon Jan 30 09:47:18 2023 +0100
20.3 @@ -35,16 +35,16 @@
20.4 "----------- the rules -------------------------------------------";
20.5 "----------- the rules -------------------------------------------";
20.6 "----------- the rules -------------------------------------------";
20.7 -val t = rewrit @{thm Belastung_Querkraft} (TermC.parse_test @{context} "- qq x = - q_0"); term2s t;
20.8 +val t = rewrit @{thm Belastung_Querkraft} (ParseC.parse_test @{context} "- qq x = - q_0"); term2s t;
20.9 if term2s t = "Q' x = - q_0" then ()
20.10 else error "/biegelinie.sml: Belastung_Querkraft";
20.11
20.12 -val t = rewrit @{thm Querkraft_Moment} (TermC.parse_test @{context} "Q x = - q_0 * x + c"); term2s t;
20.13 +val t = rewrit @{thm Querkraft_Moment} (ParseC.parse_test @{context} "Q x = - q_0 * x + c"); term2s t;
20.14 if term2s t = "?M_b' x = - q_0 * x + c" then ()
20.15 (*if term2s t = "M_b' x = - q_0 * x + c" then () cf.fbe1652b0df8 new handling of quotes in mixfix*)
20.16 else error "/biegelinie.sml: Querkraft_Moment";
20.17
20.18 -val t = rewrit @{thm Moment_Neigung} (TermC.parse_test @{context} "M_b x = -q_0 * x \<up> 2/2 + q_0/2 *L*x");
20.19 +val t = rewrit @{thm Moment_Neigung} (ParseC.parse_test @{context} "M_b x = -q_0 * x \<up> 2/2 + q_0/2 *L*x");
20.20 term2s t;
20.21 if term2s t = "- EI * y'' x = - q_0 * x \<up> 2 / 2 + q_0 / 2 * L * x" then ()
20.22 else error "biegelinie.sml: Moment_Neigung";
20.23 @@ -70,13 +70,13 @@
20.24 Eval("Prog_Expr.argument_in", eval_argument_in "Prog_Expr.argument_in")
20.25 ],
20.26 program = Empty_Prog};
20.27 -val rm_ = TermC.parse_test @{context}"[M_b 0 = 0, M_b L = 0]";
20.28 -val M__ = TermC.parse_test @{context}"M_b x = - 1 * x \<up> 2 / 2 + x * c + c_2";
20.29 +val rm_ = ParseC.parse_test @{context}"[M_b 0 = 0, M_b L = 0]";
20.30 +val M__ = ParseC.parse_test @{context}"M_b x = - 1 * x \<up> 2 / 2 + x * c + c_2";
20.31 val SOME (e1__,_) = rewrite_set_ ctxt false prog_rls
20.32 - (TermC.parse_test @{context} "(NTH::[real,bool list]=>bool) 1 " $ rm_);
20.33 + (ParseC.parse_test @{context} "(NTH::[real,bool list]=>bool) 1 " $ rm_);
20.34 if UnparseC.term e1__ = "M_b 0 = 0" then () else error "biegelinie.sml simplify NTH 1 rm_";
20.35
20.36 -val SOME (x1__,_) = rewrite_set_ ctxt false prog_rls (TermC.parse_test @{context} "argument_in (lhs (M_b 0 = 0))");
20.37 +val SOME (x1__,_) = rewrite_set_ ctxt false prog_rls (ParseC.parse_test @{context} "argument_in (lhs (M_b 0 = 0))");
20.38 if UnparseC.term x1__ = "0" then ()
20.39 else error "biegelinie.sml simplify argument_in (lhs (M_b 0 = 0)";
20.40
20.41 @@ -114,8 +114,8 @@
20.42 "----------- investigate normalforms in biegelinien --------------";
20.43 "----------- investigate normalforms in biegelinien --------------";
20.44 "----- coming from integration, kept for later improvements:";
20.45 -val Q = TermC.parse_test @{context} "Q x = c + - 1 * q_0 * x";
20.46 -val M_b = TermC.parse_test @{context} "M_b x = c_2 + c * x + - 1 * q_0 / 2 * x \<up> 2";
20.47 -val y' = TermC.parse_test @{context} "y' x = c_3 + 1 / (- 1 * EI) * (c_2 * x + c / 2 * x \<up> 2 + - 1 * q_0 / 6 * x \<up> 3)";
20.48 -val y = TermC.parse_test @{context} "y x = c_4 + c_3 * x +\n1 / (- 1 * EI) * (c_2 / 2 * x \<up> 2 + c / 6 * x \<up> 3 + - 1 * q_0 / 24 * x \<up> 4)";
20.49 +val Q = ParseC.parse_test @{context} "Q x = c + - 1 * q_0 * x";
20.50 +val M_b = ParseC.parse_test @{context} "M_b x = c_2 + c * x + - 1 * q_0 / 2 * x \<up> 2";
20.51 +val y' = ParseC.parse_test @{context} "y' x = c_3 + 1 / (- 1 * EI) * (c_2 * x + c / 2 * x \<up> 2 + - 1 * q_0 / 6 * x \<up> 3)";
20.52 +val y = ParseC.parse_test @{context} "y x = c_4 + c_3 * x +\n1 / (- 1 * EI) * (c_2 / 2 * x \<up> 2 + c / 6 * x \<up> 3 + - 1 * q_0 / 24 * x \<up> 4)";
20.53 (* \<up> 1 / (- 1 * EI) NOT distributed - ok! \<up> \<up> \<up> \<up> \<up> \<up> \<up> ^^*)
21.1 --- a/test/Tools/isac/Knowledge/diff-app.sml Sun Jan 29 14:31:56 2023 +0100
21.2 +++ b/test/Tools/isac/Knowledge/diff-app.sml Mon Jan 30 09:47:18 2023 +0100
21.3 @@ -455,7 +455,7 @@
21.4 "--------------------- 30.4.03: maximum .. rewrite_set_ prog_expr ---------";
21.5 "--------------------- 30.4.03: maximum .. rewrite_set_ prog_expr ---------";
21.6 "--------------------- 30.4.03: maximum .. rewrite_set_ prog_expr ---------";
21.7 -TermC.parse_test @{context}
21.8 +ParseC.parse_test @{context}
21.9 "Program Maximum_value(f_ix::bool list)(m_m::real) (r_s::bool list)\
21.10 \ (v_v::real) (itv_v::real set) (err_r::bool) = \
21.11 \ (let e_e = (hd o (filterVar m_m)) r_s; \
21.12 @@ -470,22 +470,22 @@
21.13 \ [REAL mx_x, REAL (Rhs t_t), REAL v_v, REAL m_m, \
21.14 \ BOOL_LIST (dropWhile (ident e_e) r_s)])::bool list))";
21.15
21.16 -val f_ix = (TermC.parse_test @{context} "f_ix::bool list",
21.17 - TermC.parse_test @{context} "[r=Arbfix]");
21.18 -val m_m = (TermC.parse_test @{context} "m_m::real",
21.19 - TermC.parse_test @{context} "A");
21.20 -val r_s = (TermC.parse_test @{context} "rs_s::bool list",
21.21 - TermC.parse_test @{context} "[A = a*b, (a/2) \<up> 2 + (b/2) \<up> 2 = r \<up> 2]");
21.22 -val v_v = (TermC.parse_test @{context} "v_v::real",
21.23 - TermC.parse_test @{context} "b");
21.24 -val itv_v = (TermC.parse_test @{context} "itv_v::real set",
21.25 - TermC.parse_test @{context} "{x::real. 0 <= x & x <= 2*r}");
21.26 -val err_r = (TermC.parse_test @{context} "err_r::bool",
21.27 - TermC.parse_test @{context} "eps=0");
21.28 +val f_ix = (ParseC.parse_test @{context} "f_ix::bool list",
21.29 + ParseC.parse_test @{context} "[r=Arbfix]");
21.30 +val m_m = (ParseC.parse_test @{context} "m_m::real",
21.31 + ParseC.parse_test @{context} "A");
21.32 +val r_s = (ParseC.parse_test @{context} "rs_s::bool list",
21.33 + ParseC.parse_test @{context} "[A = a*b, (a/2) \<up> 2 + (b/2) \<up> 2 = r \<up> 2]");
21.34 +val v_v = (ParseC.parse_test @{context} "v_v::real",
21.35 + ParseC.parse_test @{context} "b");
21.36 +val itv_v = (ParseC.parse_test @{context} "itv_v::real set",
21.37 + ParseC.parse_test @{context} "{x::real. 0 <= x & x <= 2*r}");
21.38 +val err_r = (ParseC.parse_test @{context} "err_r::bool",
21.39 + ParseC.parse_test @{context} "eps=0");
21.40 val env = [f_ix, m_m, r_s ,v_v, itv_v, err_r];
21.41
21.42 (*--- 1.line in script ---*)
21.43 -val t = TermC.parse_test @{context} "(hd o (filterVar m_m)) (r_s::bool list)";
21.44 +val t = ParseC.parse_test @{context} "(hd o (filterVar m_m)) (r_s::bool list)";
21.45 val s = subst_atomic env t;
21.46 UnparseC.term s;
21.47 "(hd o filterVar A) [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]";
21.48 @@ -494,10 +494,10 @@
21.49 val s'' = UnparseC.term s';
21.50 if s''="A = a * b" then () else error "new behaviour with prog_expr 1.1.";
21.51 === inhibit exn 110726=============================================================*)
21.52 -val env = env @ [(TermC.parse_test @{context} "e_e::bool",TermC.parse_test @{context} "A = a * b")];
21.53 +val env = env @ [(ParseC.parse_test @{context} "e_e::bool",ParseC.parse_test @{context} "A = a * b")];
21.54
21.55 (*--- 2.line: condition alone ---*)
21.56 -val t = TermC.parse_test @{context} "1 < length_h (r_s::bool list)";
21.57 +val t = ParseC.parse_test @{context} "1 < length_h (r_s::bool list)";
21.58 val s = subst_atomic env t;
21.59 UnparseC.term s;
21.60 "1 < length_h [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]";
21.61 @@ -508,7 +508,7 @@
21.62 === inhibit exn 110726=============================================================*)
21.63
21.64 (*--- 2.line in script ---*)
21.65 -val t = TermC.parse_test @{context}
21.66 +val t = ParseC.parse_test @{context}
21.67 "(if 1 < length_h r_s \
21.68 \ then (SubProblem (Reals_s,[make,function],[no_met])\
21.69 \ [REAL m_m, REAL v_v, BOOL_LIST r_s])\
21.70 @@ -529,15 +529,15 @@
21.71 \ BOOL_LIST [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]]" then ()
21.72 else error "new behaviour with prog_expr 1.3.";
21.73 === inhibit exn 110726=============================================================*)
21.74 -val env = env @ [(TermC.parse_test @{context} "t_t::bool",
21.75 - TermC.parse_test @{context} "A = (2*sqrt(r \<up> 2-(b/2) \<up> 2)) * b")];
21.76 +val env = env @ [(ParseC.parse_test @{context} "t_t::bool",
21.77 + ParseC.parse_test @{context} "A = (2*sqrt(r \<up> 2-(b/2) \<up> 2)) * b")];
21.78
21.79
21.80
21.81 "---------------------- 1.5.03: Make_fun_by_explicit ---------------------";
21.82 "---------------------- 1.5.03: Make_fun_by_explicit ---------------------";
21.83 "---------------------- 1.5.03: Make_fun_by_explicit ---------------------";
21.84 -TermC.parse_test @{context}
21.85 +ParseC.parse_test @{context}
21.86 "Program Make_fun_by_explicit (f_f::real) (v_v::real) \
21.87 \ (eqs::bool list) = \
21.88 \ (let h_h = (hd o (filterVar f_f)) eqs; \
21.89 @@ -547,32 +547,32 @@
21.90 \ (s_1::bool list)=(SubProblem(Reals_s,[univar,equation],[no_met])\
21.91 \ [BOOL e_1, REAL v_1])\
21.92 \ in Substitute [(v_1 = (rhs o hd) s_1)] h_h)";
21.93 -val f_f = (TermC.parse_test @{context} "f_f::real",
21.94 - TermC.parse_test @{context} "A");
21.95 -val v_v = (TermC.parse_test @{context} "v_v::real",
21.96 - TermC.parse_test @{context} "b");
21.97 -val eqs=(TermC.parse_test @{context} "eqs::bool list",
21.98 - TermC.parse_test @{context} "[A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]");
21.99 +val f_f = (ParseC.parse_test @{context} "f_f::real",
21.100 + ParseC.parse_test @{context} "A");
21.101 +val v_v = (ParseC.parse_test @{context} "v_v::real",
21.102 + ParseC.parse_test @{context} "b");
21.103 +val eqs=(ParseC.parse_test @{context} "eqs::bool list",
21.104 + ParseC.parse_test @{context} "[A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]");
21.105 val env = [f_f, v_v, eqs];
21.106
21.107 (*--- 1.line in script ---*)
21.108 -val t = TermC.parse_test @{context} "(hd o (filterVar v_v)) (eqs::bool list)";
21.109 +val t = ParseC.parse_test @{context} "(hd o (filterVar v_v)) (eqs::bool list)";
21.110 val s = subst_atomic env t;
21.111 UnparseC.term s;
21.112 -val t = TermC.parse_test @{context}
21.113 +val t = ParseC.parse_test @{context}
21.114 "(hd o filterVar b) [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]";
21.115 val SOME (t',_) = rewrite_set_ ctxt false prog_expr t;
21.116 val s' = UnparseC.term t';
21.117 (*=== inhibit exn 110726=============================================================
21.118 if s' = "A = a * b" then () else error "new behaviour with prog_expr 2.1";
21.119 === inhibit exn 110726=============================================================*)
21.120 -val env = env @ [(TermC.parse_test @{context} "h_h::bool", TermC.parse_test @{context} s')];
21.121 +val env = env @ [(ParseC.parse_test @{context} "h_h::bool", ParseC.parse_test @{context} s')];
21.122
21.123 (*--- 2.line in script ---*)
21.124 -val t = TermC.parse_test @{context} "hd (dropWhile (ident h_h) (eqs::bool list))";
21.125 +val t = ParseC.parse_test @{context} "hd (dropWhile (ident h_h) (eqs::bool list))";
21.126 val s = subst_atomic env t;
21.127 UnparseC.term s;
21.128 -val t = TermC.parse_test @{context}
21.129 +val t = ParseC.parse_test @{context}
21.130 "hd (dropWhile (ident (A = a * b))\
21.131 \ [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2])";
21.132 (*=== inhibit exn 110726=============================================================
21.133 @@ -583,47 +583,47 @@
21.134 if s' = "(a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2" then ()
21.135 else error "new behaviour with prog_expr 2.2";
21.136 === inhibit exn 110726=============================================================*)
21.137 -val env = env @ [(TermC.parse_test @{context} "e_1::bool", TermC.parse_test @{context} s')];
21.138 +val env = env @ [(ParseC.parse_test @{context} "e_1::bool", ParseC.parse_test @{context} s')];
21.139
21.140 (*--- 3.line in script ---*)
21.141 -val t = TermC.parse_test @{context} "dropWhile (ident f_f) (Vars (h_h::bool))";
21.142 +val t = ParseC.parse_test @{context} "dropWhile (ident f_f) (Vars (h_h::bool))";
21.143 val s = subst_atomic env t;
21.144 UnparseC.term s;
21.145 -val t = TermC.parse_test @{context} "dropWhile (ident A) (Vars (A = a * b))";
21.146 +val t = ParseC.parse_test @{context} "dropWhile (ident A) (Vars (A = a * b))";
21.147 (*=== inhibit exn 110726=============================================================
21.148 val SOME (t',_) = rewrite_set_ thy false prog_expr t;
21.149 val s' = UnparseC.term t';
21.150 if s' = "[a, b]" then () else error "new behaviour with prog_expr 2.3";
21.151 === inhibit exn 110726=============================================================*)
21.152 -val env = env @ [(TermC.parse_test @{context} "vs_s::real list", TermC.parse_test @{context} s')];
21.153 +val env = env @ [(ParseC.parse_test @{context} "vs_s::real list", ParseC.parse_test @{context} s')];
21.154
21.155 (*--- 4.line in script ---*)
21.156 -val t = TermC.parse_test @{context} "hd (dropWhile (ident v_v) v_s)";
21.157 +val t = ParseC.parse_test @{context} "hd (dropWhile (ident v_v) v_s)";
21.158 val s = subst_atomic env t;
21.159 UnparseC.term s;
21.160 -val t = TermC.parse_test @{context} "hd (dropWhile (ident b) [a, b])";
21.161 +val t = ParseC.parse_test @{context} "hd (dropWhile (ident b) [a, b])";
21.162 (*=== inhibit exn 110726=============================================================
21.163 val SOME (t',_) = rewrite_set_ thy false prog_expr t;
21.164 val s' = UnparseC.term t';
21.165 if s' = "a" then () else error "new behaviour with prog_expr 2.4.";
21.166 === inhibit exn 110726=============================================================*)
21.167 -val env = env @ [(TermC.parse_test @{context} "v_1::real", TermC.parse_test @{context} s')];
21.168 +val env = env @ [(ParseC.parse_test @{context} "v_1::real", ParseC.parse_test @{context} s')];
21.169
21.170 (*--- 5.line in script ---*)
21.171 -val t = TermC.parse_test @{context} "(SubProblem(Reals_s,[univar,equation],[no_met])\
21.172 +val t = ParseC.parse_test @{context} "(SubProblem(Reals_s,[univar,equation],[no_met])\
21.173 \ [BOOL e_1, REAL v_1])";
21.174 val s = subst_atomic env t;
21.175 UnparseC.term s;
21.176 "SubProblem (Reals_s, [univar, equation], [no_met])\n\
21.177 \ [BOOL ((a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2), REAL a]";
21.178 -val env = env @ [(TermC.parse_test @{context} "s_1::bool list",
21.179 - TermC.parse_test @{context} "[a = 2 * sqrt (r \<up> 2 - (b/2) \<up> 2)]")];
21.180 +val env = env @ [(ParseC.parse_test @{context} "s_1::bool list",
21.181 + ParseC.parse_test @{context} "[a = 2 * sqrt (r \<up> 2 - (b/2) \<up> 2)]")];
21.182
21.183 (*--- 6.line in script ---*)
21.184 -val t = TermC.parse_test @{context} "Substitute [(v_1 = (rhs o hd) (s_1::bool list))] (h_h::bool)";
21.185 +val t = ParseC.parse_test @{context} "Substitute [(v_1 = (rhs o hd) (s_1::bool list))] (h_h::bool)";
21.186 val s = subst_atomic env t;
21.187 UnparseC.term s;
21.188 -val t = TermC.parse_test @{context}
21.189 +val t = ParseC.parse_test @{context}
21.190 "Substitute [(a = (rhs o hd) [a = 2 * sqrt (r \<up> 2 - (b / 2) \<up> 2)])]\n\
21.191 \ (A = a * b)";
21.192 (*=== inhibit exn 110726=============================================================
21.193 @@ -638,7 +638,7 @@
21.194 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
21.195 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
21.196 "---------------------- 2.5.03: Make_fun_by_new_variable -----------------";
21.197 -TermC.parse_test @{context}
21.198 +ParseC.parse_test @{context}
21.199 "Program Make_fun_by_new_variable (f_f::real) (v_v::real) \
21.200 \ (eqs::bool list) = \
21.201 \(let h_h = (hd o (filterVar f_f)) eqs; \
21.202 @@ -653,32 +653,32 @@
21.203 \ (s_2::bool list) = (SubProblem (Reals_s,[univar,equation],[no_met])\
21.204 \ [BOOL e_2, REAL v_2])\
21.205 \in Substitute [(v_1 = (rhs o hd) s_1),(v_2 = (rhs o hd) s_2)] h_h)";
21.206 -val f_ = (TermC.parse_test @{context} "f_f::real",
21.207 - TermC.parse_test @{context} "A");
21.208 -val v_v = (TermC.parse_test @{context} "v_v::real",
21.209 - TermC.parse_test @{context} "alpha");
21.210 -val eqs=(TermC.parse_test @{context} "eqs::bool list",
21.211 - TermC.parse_test @{context} "[A=a*b, a/2=r*sin alpha, b/2=r*cos (alpha::real)]");
21.212 +val f_ = (ParseC.parse_test @{context} "f_f::real",
21.213 + ParseC.parse_test @{context} "A");
21.214 +val v_v = (ParseC.parse_test @{context} "v_v::real",
21.215 + ParseC.parse_test @{context} "alpha");
21.216 +val eqs=(ParseC.parse_test @{context} "eqs::bool list",
21.217 + ParseC.parse_test @{context} "[A=a*b, a/2=r*sin alpha, b/2=r*cos (alpha::real)]");
21.218 val env = [f_f, v_v, eqs];
21.219
21.220 (*--- 1.line in script ---*)
21.221 -val t = TermC.parse_test @{context} "(hd o (filterVar (f_f::real))) (eqs::bool list)";
21.222 +val t = ParseC.parse_test @{context} "(hd o (filterVar (f_f::real))) (eqs::bool list)";
21.223 val s = subst_atomic env t;
21.224 UnparseC.term s;
21.225 -val t = TermC.parse_test @{context}
21.226 +val t = ParseC.parse_test @{context}
21.227 "(hd o filterVar A) [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
21.228 val SOME (t',_) = rewrite_set_ ctxt false prog_expr t;
21.229 val s' = UnparseC.term t';
21.230 (*=== inhibit exn 110726=============================================================
21.231 if s' = "A = a * b" then() else error "new behaviour with prog_expr 3.1.";
21.232 -val env = env @ [(TermC.parse_test @{context} "h_h::bool", TermC.parse_test @{context} s')];
21.233 +val env = env @ [(ParseC.parse_test @{context} "h_h::bool", ParseC.parse_test @{context} s')];
21.234 === inhibit exn 110726=============================================================*)
21.235
21.236 (*--- 2.line in script ---*)
21.237 -val t = TermC.parse_test @{context} "dropWhile (ident (h_h::bool)) (eqs::bool list)";
21.238 +val t = ParseC.parse_test @{context} "dropWhile (ident (h_h::bool)) (eqs::bool list)";
21.239 val s = subst_atomic env t;
21.240 UnparseC.term s;
21.241 -val t = TermC.parse_test @{context}
21.242 +val t = ParseC.parse_test @{context}
21.243 "dropWhile (ident (A = a * b))\
21.244 \ [A = a * b, a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
21.245 (*=== inhibit exn 110726=============================================================
21.246 @@ -687,49 +687,49 @@
21.247 if s' = "[a / 2 = r * sin alpha, b / 2 = r * cos alpha]"
21.248 then () else error "new behaviour with prog_expr 3.2.";
21.249 === inhibit exn 110726=============================================================*)
21.250 -val env = env @ [(TermC.parse_test @{context} "es_s::bool list", TermC.parse_test @{context} s')];
21.251 +val env = env @ [(ParseC.parse_test @{context} "es_s::bool list", ParseC.parse_test @{context} s')];
21.252
21.253 (*--- 3.line in script ---*)
21.254 -val t = TermC.parse_test @{context} "dropWhile (ident (f_f::real)) (Vars (h_h::bool))";
21.255 +val t = ParseC.parse_test @{context} "dropWhile (ident (f_f::real)) (Vars (h_h::bool))";
21.256 val s = subst_atomic env t;
21.257 UnparseC.term s;
21.258 -val t = TermC.parse_test @{context} "dropWhile (ident A) (Vars (A = a * b))";
21.259 +val t = ParseC.parse_test @{context} "dropWhile (ident A) (Vars (A = a * b))";
21.260 (*=== inhibit exn 110726=============================================================
21.261 val SOME (t',_) = rewrite_set_ thy false prog_expr t;
21.262 val s' = UnparseC.term t';
21.263 if s' = "[a, b]" then () else error "new behaviour with prog_expr 3.3.";
21.264 === inhibit exn 110726=============================================================*)
21.265 -val env = env @ [(TermC.parse_test @{context} "vs_s::real list", TermC.parse_test @{context} s')];
21.266 +val env = env @ [(ParseC.parse_test @{context} "vs_s::real list", ParseC.parse_test @{context} s')];
21.267
21.268 (*--- 4.line in script ---*)
21.269 -val t = TermC.parse_test @{context} "nth_h 1 v_s";
21.270 +val t = ParseC.parse_test @{context} "nth_h 1 v_s";
21.271 val s = subst_atomic env t;
21.272 UnparseC.term s;
21.273 -val t = TermC.parse_test @{context} "nth_h 1 [a, b]";
21.274 +val t = ParseC.parse_test @{context} "nth_h 1 [a, b]";
21.275 (*=== inhibit exn 110726=============================================================
21.276 val SOME (t',_) = rewrite_set_ thy false prog_expr t;
21.277 val s' = UnparseC.term t';
21.278 if s' = "a" then () else error "new behaviour with prog_expr 3.4.";
21.279 === inhibit exn 110726=============================================================*)
21.280 -val env = env @ [(TermC.parse_test @{context} "v_1", TermC.parse_test @{context} s')];
21.281 +val env = env @ [(ParseC.parse_test @{context} "v_1", ParseC.parse_test @{context} s')];
21.282
21.283 (*--- 5.line in script ---*)
21.284 -val t = TermC.parse_test @{context} "nth_h 2 v_s";
21.285 +val t = ParseC.parse_test @{context} "nth_h 2 v_s";
21.286 val s = subst_atomic env t;
21.287 UnparseC.term s;
21.288 -val t = TermC.parse_test @{context} "nth_h 2 [a, b]";
21.289 +val t = ParseC.parse_test @{context} "nth_h 2 [a, b]";
21.290 (*=== inhibit exn 110726=============================================================
21.291 val SOME (t',_) = rewrite_set_ thy false prog_expr t;
21.292 val s' = UnparseC.term t';
21.293 if s' = "b" then () else error "new behaviour with prog_expr 3.5.";
21.294 === inhibit exn 110726=============================================================*)
21.295 -val env = env @ [(TermC.parse_test @{context} "v_2", TermC.parse_test @{context} s')];
21.296 +val env = env @ [(ParseC.parse_test @{context} "v_2", ParseC.parse_test @{context} s')];
21.297
21.298 (*--- 6.line in script ---*)
21.299 -val t = TermC.parse_test @{context} "(hd o (filterVar v_1)) (es_s::bool list)";
21.300 +val t = ParseC.parse_test @{context} "(hd o (filterVar v_1)) (es_s::bool list)";
21.301 val s = subst_atomic env t;
21.302 UnparseC.term s;
21.303 -val t = TermC.parse_test @{context}
21.304 +val t = ParseC.parse_test @{context}
21.305 "(hd o filterVar a) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
21.306 val SOME (t',_) = rewrite_set_ ctxt false prog_expr t;
21.307 val s' = UnparseC.term t';
21.308 @@ -737,14 +737,14 @@
21.309 if s' = "a / 2 = r * sin alpha" then ()
21.310 else error "new behaviour with prog_expr 3.6.";
21.311 === inhibit exn 110726=============================================================*)
21.312 -val e_1 = TermC.parse_test @{context} "e_1::bool";
21.313 -val env = env @ [(e_1, TermC.parse_test @{context} s')];
21.314 +val e_1 = ParseC.parse_test @{context} "e_1::bool";
21.315 +val env = env @ [(e_1, ParseC.parse_test @{context} s')];
21.316
21.317 (*--- 7.line in script ---*)
21.318 -val t = TermC.parse_test @{context} "(hd o (filterVar v_2)) (es_s::bool list)";
21.319 +val t = ParseC.parse_test @{context} "(hd o (filterVar v_2)) (es_s::bool list)";
21.320 val s = subst_atomic env t;
21.321 UnparseC.term s;
21.322 -val t = TermC.parse_test @{context}
21.323 +val t = ParseC.parse_test @{context}
21.324 "(hd o filterVar b) [a / 2 = r * sin alpha, b / 2 = r * cos alpha]";
21.325 val SOME (t',_) = rewrite_set_ ctxt false prog_expr t;
21.326 val s' = UnparseC.term t';
21.327 @@ -752,30 +752,30 @@
21.328 if s' = "b / 2 = r * cos alpha" then ()
21.329 else error "new behaviour with prog_expr 3.7.";
21.330 === inhibit exn 110726=============================================================*)
21.331 -val env = env @ [(TermC.parse_test @{context} "e_2::bool", TermC.parse_test @{context} s')];
21.332 +val env = env @ [(ParseC.parse_test @{context} "e_2::bool", ParseC.parse_test @{context} s')];
21.333
21.334 (*--- 8.line in script ---*)
21.335 -val t = TermC.parse_test @{context} "(SubProblem (Reals_s,[univar,equation],[no_met])\
21.336 +val t = ParseC.parse_test @{context} "(SubProblem (Reals_s,[univar,equation],[no_met])\
21.337 \ [BOOL e_1, REAL v_1])";
21.338 val s = subst_atomic env t;
21.339 UnparseC.term s;
21.340 "SubProblem (Reals_s, [univar, equation], [no_met])\
21.341 \ [BOOL (a / 2 = r * sin alpha), REAL a]";
21.342 -val s_1 = TermC.parse_test @{context} "[a = 2*r*sin alpha]";
21.343 -val env = env @ [(TermC.parse_test @{context} "s_1::bool list", s_1)];
21.344 +val s_1 = ParseC.parse_test @{context} "[a = 2*r*sin alpha]";
21.345 +val env = env @ [(ParseC.parse_test @{context} "s_1::bool list", s_1)];
21.346
21.347 (*--- 9.line in script ---*)
21.348 -val t = TermC.parse_test @{context} "(SubProblem (Reals_s,[univar,equation],[no_met])\
21.349 +val t = ParseC.parse_test @{context} "(SubProblem (Reals_s,[univar,equation],[no_met])\
21.350 \ [BOOL e_2, REAL v_2])";
21.351 val s = subst_atomic env t;
21.352 UnparseC.term s;
21.353 "SubProblem (Reals_s, [univar, equation], [no_met])\
21.354 \ [BOOL (b / 2 = r * cos alpha), REAL b]";
21.355 -val s_2 = TermC.parse_test @{context} "[b = 2*r*cos alpha]";
21.356 -val env = env @ [(TermC.parse_test @{context} "s_2::bool list", s_2)];
21.357 +val s_2 = ParseC.parse_test @{context} "[b = 2*r*cos alpha]";
21.358 +val env = env @ [(ParseC.parse_test @{context} "s_2::bool list", s_2)];
21.359
21.360 (*--- 10.line in script ---*)
21.361 -val t = TermC.parse_test @{context}
21.362 +val t = ParseC.parse_test @{context}
21.363 "Substitute [(v_1 = (rhs o hd) s_1),(v_2 = (rhs o hd) s_2)] (h_h::bool)";
21.364 val s = subst_atomic env t;
21.365 UnparseC.term s;
22.1 --- a/test/Tools/isac/Knowledge/diff.sml Sun Jan 29 14:31:56 2023 +0100
22.2 +++ b/test/Tools/isac/Knowledge/diff.sml Mon Jan 30 09:47:18 2023 +0100
22.3 @@ -218,11 +218,11 @@
22.4 "----------- primed id ----------------------------------";
22.5 "----------- primed id ----------------------------------";
22.6 val ctxt = Proof_Context.init_global @{theory Isac_Knowledge};
22.7 -val f_ = TermC.parse_test @{context} "f_f::bool";
22.8 -val f = TermC.parse_test @{context} "A = s * (a - s)";
22.9 -val v_ = TermC.parse_test @{context} "v_v";
22.10 -val v = TermC.parse_test @{context} "s";
22.11 -val screxp0 = TermC.parse_test @{context} "Take ((primed (lhs f_f)) = d_d v_v (rhs f_f))";
22.12 +val f_ = ParseC.parse_test @{context} "f_f::bool";
22.13 +val f = ParseC.parse_test @{context} "A = s * (a - s)";
22.14 +val v_ = ParseC.parse_test @{context} "v_v";
22.15 +val v = ParseC.parse_test @{context} "s";
22.16 +val screxp0 = ParseC.parse_test @{context} "Take ((primed (lhs f_f)) = d_d v_v (rhs f_f))";
22.17 TermC.atom_trace_detail @{context} screxp0;
22.18
22.19 val screxp1 = subst_atomic [(f_, f), (v_, v)] screxp0;
22.20 @@ -268,32 +268,32 @@
22.21 "----------- diff_conv, sym_diff_conv -------------------";
22.22 "----------- diff_conv, sym_diff_conv -------------------";
22.23 "----------- diff_conv, sym_diff_conv -------------------";
22.24 -val subs = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
22.25 +val subs = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
22.26 val rls = diff_conv;
22.27
22.28 -val t = TermC.parse_test @{context} "2/x \<up> 2";
22.29 +val t = ParseC.parse_test @{context} "2/x \<up> 2";
22.30 val SOME (t,_) = rewrite_set_inst_ ctxt false subs rls t; UnparseC.term t;
22.31 if UnparseC.term t = "2 * x \<up> - 2" then () else error "diff.sml 1/x";
22.32
22.33 -val t = TermC.parse_test @{context} "sqrt (x \<up> 3)";
22.34 +val t = ParseC.parse_test @{context} "sqrt (x \<up> 3)";
22.35 val SOME (t,_) = rewrite_set_inst_ ctxt false subs rls t; UnparseC.term t;
22.36 if UnparseC.term t = "x \<up> (3 / 2)" then () else error "diff.sml x \<up> 1/2";
22.37
22.38 -val t = TermC.parse_test @{context} "2 / sqrt x \<up> 3";
22.39 +val t = ParseC.parse_test @{context} "2 / sqrt x \<up> 3";
22.40 val SOME (t,_) = rewrite_set_inst_ ctxt false subs rls t; UnparseC.term t;
22.41 if UnparseC.term t = "2 * x \<up> (- 3 / 2)" then () else error "diff.sml x \<up> - 1/2";
22.42
22.43 val rls = diff_sym_conv;
22.44
22.45 -val t = TermC.parse_test @{context} "2 * x \<up> - 2";
22.46 +val t = ParseC.parse_test @{context} "2 * x \<up> - 2";
22.47 val SOME (t, _) = rewrite_set_inst_ ctxt false subs rls t; UnparseC.term t;
22.48 if UnparseC.term t = "2 / x \<up> 2" then () else error "diff.sml sym 1/x";
22.49
22.50 -val t = TermC.parse_test @{context} "x \<up> (3 / 2)";
22.51 +val t = ParseC.parse_test @{context} "x \<up> (3 / 2)";
22.52 val SOME (t,_) = rewrite_set_inst_ ctxt false subs rls t; UnparseC.term t;
22.53 if UnparseC.term t = "sqrt (x \<up> 3)" then ((*..wrong rewrite*)) else error"diff.sml sym x \<up> 1/x";
22.54
22.55 -val t = TermC.parse_test @{context} "2 * x \<up> (-3 / 2)";
22.56 +val t = ParseC.parse_test @{context} "2 * x \<up> (-3 / 2)";
22.57 val SOME (t,_) = rewrite_set_inst_ ctxt false subs rls t; UnparseC.term t;
22.58 if UnparseC.term t ="2 / sqrt (x \<up> 3)"then()else error"diff.sml sym x \<up> - 1/x";
22.59
22.60 @@ -388,14 +388,14 @@
22.61 "----------- tests for examples -------------------------";
22.62 "----------- tests for examples -------------------------";
22.63 "----- TermC.parse errors";
22.64 -(*TermC.parse_test @{context} "F = sqrt( y \<up> 2 - O) * (z + O \<up> 2)";
22.65 -TermC.parse_test @{context} "O";
22.66 -TermC.parse_test @{context} "OO"; ---errors*)
22.67 -TermC.parse_test @{context} "OOO";
22.68 +(*ParseC.parse_test @{context} "F = sqrt( y \<up> 2 - O) * (z + O \<up> 2)";
22.69 +ParseC.parse_test @{context} "O";
22.70 +ParseC.parse_test @{context} "OO"; ---errors*)
22.71 +ParseC.parse_test @{context} "OOO";
22.72
22.73 "----- thm 'diff_prod_const'";
22.74 -val subs = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "l")];
22.75 -val f = TermC.parse_test @{context} "G' = d_d l (l * sqrt (7 * s \<up> 2 - l \<up> 2))";
22.76 +val subs = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "l")];
22.77 +val f = ParseC.parse_test @{context} "G' = d_d l (l * sqrt (7 * s \<up> 2 - l \<up> 2))";
22.78
22.79 "------------inform for x \<up> 2+x+1 -------------------------";
22.80 "------------inform for x \<up> 2+x+1 -------------------------";
23.1 --- a/test/Tools/isac/Knowledge/eqsystem-1.sml Sun Jan 29 14:31:56 2023 +0100
23.2 +++ b/test/Tools/isac/Knowledge/eqsystem-1.sml Mon Jan 30 09:47:18 2023 +0100
23.3 @@ -31,46 +31,46 @@
23.4 "----------- occur_exactly_in ------------------------------------";
23.5 "----------- occur_exactly_in ------------------------------------";
23.6 "----------- occur_exactly_in ------------------------------------";
23.7 -val all = [TermC.parse_test @{context}"c", TermC.parse_test @{context}"c_2", TermC.parse_test @{context}"c_3"];
23.8 -val t = TermC.parse_test @{context}"0 = - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2";
23.9 +val all = [ParseC.parse_test @{context}"c", ParseC.parse_test @{context}"c_2", ParseC.parse_test @{context}"c_3"];
23.10 +val t = ParseC.parse_test @{context}"0 = - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2";
23.11
23.12 -if occur_exactly_in [TermC.parse_test @{context}"c", TermC.parse_test @{context}"c_2"] all t
23.13 +if occur_exactly_in [ParseC.parse_test @{context}"c", ParseC.parse_test @{context}"c_2"] all t
23.14 then () else error "eqsystem.sml occur_exactly_in 1";
23.15
23.16 -if not (occur_exactly_in [TermC.parse_test @{context}"c", TermC.parse_test @{context}"c_2", TermC.parse_test @{context}"c_3"] all t)
23.17 +if not (occur_exactly_in [ParseC.parse_test @{context}"c", ParseC.parse_test @{context}"c_2", ParseC.parse_test @{context}"c_3"] all t)
23.18 then () else error "eqsystem.sml occur_exactly_in 2";
23.19
23.20 -if not (occur_exactly_in [TermC.parse_test @{context}"c_2"] all t)
23.21 +if not (occur_exactly_in [ParseC.parse_test @{context}"c_2"] all t)
23.22 then () else error "eqsystem.sml occur_exactly_in 3";
23.23
23.24 -val t = TermC.parse_test @{context}"[c,c_2] from [c,c_2,c_3] occur_exactly_in - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2";
23.25 +val t = ParseC.parse_test @{context}"[c,c_2] from [c,c_2,c_3] occur_exactly_in - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2";
23.26 eval_occur_exactly_in 0 "EqSystem.occur_exactly_in" t 0;
23.27 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur_exactly_in" t 0;
23.28 if str = "[c, c_2] from [c, c_2,\n" ^
23.29 " c_3] occur_exactly_in - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2 = True"
23.30 then () else error "eval_occur_exactly_in [c, c_2]";
23.31
23.32 -val t = TermC.parse_test @{context} ("[c,c_2,c_3] from [c,c_2,c_3] occur_exactly_in " ^
23.33 +val t = ParseC.parse_test @{context} ("[c,c_2,c_3] from [c,c_2,c_3] occur_exactly_in " ^
23.34 "- 1 * q_0 * L \<up> 2 / 2 + L * c + c_2");
23.35 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur_exactly_in" t 0;
23.36 if str = "[c, c_2,\n c_3] from [c, c_2,\n" ^
23.37 " c_3] occur_exactly_in - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2 = False"
23.38 then () else error "eval_occur_exactly_in [c, c_2, c_3]";
23.39
23.40 -val t = TermC.parse_test @{context}"[c_2] from [c,c_2,c_3] occur_exactly_in \
23.41 +val t = ParseC.parse_test @{context}"[c_2] from [c,c_2,c_3] occur_exactly_in \
23.42 \- 1 * q_0 * L \<up> 2 / 2 + L * c + c_2";
23.43 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur_exactly_in" t 0;
23.44 if str = "[c_2] from [c, c_2,\n" ^
23.45 " c_3] occur_exactly_in - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2 = False"
23.46 then () else error "eval_occur_exactly_in [c, c_2, c_3]";
23.47
23.48 -val t = TermC.parse_test @{context}"[] from [c,c_2,c_3] occur_exactly_in 0";
23.49 +val t = ParseC.parse_test @{context}"[] from [c,c_2,c_3] occur_exactly_in 0";
23.50 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur_exactly_in" t 0;
23.51 if str = "[] from [c, c_2, c_3] occur_exactly_in 0 = True" then ()
23.52 else error "eval_occur_exactly_in [c, c_2, c_3]";
23.53
23.54 val t =
23.55 - TermC.parse_test @{context}
23.56 + ParseC.parse_test @{context}
23.57 "[] from [c, c_2, c_3, c_4] occur_exactly_in - 1 * (q_0 * L \<up> 2) /2";
23.58 val SOME (str, t') = eval_occur_exactly_in 0 "EqSystem.occur_exactly_in" t 0;
23.59 if str = "[] from [c, c_2, c_3, c_4] occur_exactly_in \
23.60 @@ -80,7 +80,7 @@
23.61 "----------- problems --------------------------------------------";
23.62 "----------- problems --------------------------------------------";
23.63 "----------- problems --------------------------------------------";
23.64 -val t = TermC.parse_test @{context} "Length [x+y=1,y=2] = 2";
23.65 +val t = ParseC.parse_test @{context} "Length [x+y=1,y=2] = 2";
23.66 TermC.atom_trace_detail @{context} t;
23.67 val testrls = Rule_Set.append_rules "testrls" Rule_Set.empty
23.68 [(Thm ("LENGTH_NIL", @{thm LENGTH_NIL})),
23.69 @@ -97,10 +97,10 @@
23.70 val SOME t = TermC.parseNEW ctxt "solution LL";
23.71 TermC.atom_trace_detail @{context} t;
23.72
23.73 -val t = TermC.parse_test @{context}
23.74 +val t = ParseC.parse_test @{context}
23.75 "(tl (tl (tl v_s))) from v_s occur_exactly_in (NTH 1 (e_s::bool list))";
23.76 TermC.atom_trace_detail @{context} t;
23.77 -val t = TermC.parse_test @{context} ("(tl (tl (tl [c, c_2, c_3, c_4]))) from [c, c_2, c_3, c_4] occur_exactly_in " ^
23.78 +val t = ParseC.parse_test @{context} ("(tl (tl (tl [c, c_2, c_3, c_4]))) from [c, c_2, c_3, c_4] occur_exactly_in " ^
23.79 "(NTH 1 [c_4 = 1, 2 = 2, 3 = 3, 4 = 4])");
23.80 (*----- broken in child of.1790e1073acc : eliminate "handle _ => ..." from Rewrite.rewrite -----\\
23.81 assume flawed test setup hidden by "handle _ => ..."
23.82 @@ -124,39 +124,39 @@
23.83 "----------- rewrite-order ord_simplify_System -------------------";
23.84 "M_b x = c * x + - 1 * q_0 * (x \<up> 2 / 2) + c_2";
23.85 "--- add.commute ---"; (* ... add.commute cf. b42e334c97ee *)
23.86 -if ord_simplify_System false ctxt [] (TermC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2)",
23.87 - TermC.parse_test @{context}"c * x") then ()
23.88 +if ord_simplify_System false ctxt [] (ParseC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2)",
23.89 + ParseC.parse_test @{context}"c * x") then ()
23.90 else error "integrate.sml, (- 1 * q_0 * (x \<up> 2 / 2)) < (c * x) not#1";
23.91
23.92 -if ord_simplify_System false ctxt [] (TermC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2)",
23.93 - TermC.parse_test @{context}"c_2") then ()
23.94 +if ord_simplify_System false ctxt [] (ParseC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2)",
23.95 + ParseC.parse_test @{context}"c_2") then ()
23.96 else error "integrate.sml, (- 1 * q_0 * (x \<up> 2 / 2)) < (c_2) not#2";
23.97
23.98 -if ord_simplify_System false ctxt [] (TermC.parse_test @{context}"c * x",
23.99 - TermC.parse_test @{context}"c_2") then ()
23.100 +if ord_simplify_System false ctxt [] (ParseC.parse_test @{context}"c * x",
23.101 + ParseC.parse_test @{context}"c_2") then ()
23.102 else error "integrate.sml, (c * x) < (c_2) not#3";
23.103
23.104 "--- mult.commute ---";
23.105 -if ord_simplify_System false ctxt [] (TermC.parse_test @{context}"x * c",
23.106 - TermC.parse_test @{context}"c * x") then ()
23.107 +if ord_simplify_System false ctxt [] (ParseC.parse_test @{context}"x * c",
23.108 + ParseC.parse_test @{context}"c * x") then ()
23.109 else error "integrate.sml, (x * c) < (c * x) not#4";
23.110
23.111 -if ord_simplify_System false ctxt [] (TermC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2) * c",
23.112 - TermC.parse_test @{context}"- 1 * q_0 * c * (x \<up> 2 / 2)")
23.113 +if ord_simplify_System false ctxt [] (ParseC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2) * c",
23.114 + ParseC.parse_test @{context}"- 1 * q_0 * c * (x \<up> 2 / 2)")
23.115 then () else error "integrate.sml, (. * .) < (. * .) not#5";
23.116
23.117 -if ord_simplify_System false ctxt [] (TermC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2) * c",
23.118 - TermC.parse_test @{context}"c * - 1 * q_0 * (x \<up> 2 / 2)")
23.119 +if ord_simplify_System false ctxt [] (ParseC.parse_test @{context}"- 1 * q_0 * (x \<up> 2 / 2) * c",
23.120 + ParseC.parse_test @{context}"c * - 1 * q_0 * (x \<up> 2 / 2)")
23.121 then () else error "integrate.sml, (. * .) < (. * .) not#6";
23.122
23.123
23.124 "----------- rewrite in [EqSystem,normalise,2x2] -----------------";
23.125 "----------- rewrite in [EqSystem,normalise,2x2] -----------------";
23.126 "----------- rewrite in [EqSystem,normalise,2x2] -----------------";
23.127 -val t = TermC.parse_test @{context}"[0 = - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2,\
23.128 +val t = ParseC.parse_test @{context}"[0 = - 1 * q_0 * L \<up> 2 / 2 + L * c + c_2,\
23.129 \0 = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c + c_2]";
23.130 -val bdvs = [(TermC.parse_test @{context}"bdv_1",TermC.parse_test @{context}"c"),
23.131 - (TermC.parse_test @{context}"bdv_2",TermC.parse_test @{context}"c_2")];
23.132 +val bdvs = [(ParseC.parse_test @{context}"bdv_1",ParseC.parse_test @{context}"c"),
23.133 + (ParseC.parse_test @{context}"bdv_2",ParseC.parse_test @{context}"c_2")];
23.134 val SOME (t,_) = rewrite_set_inst_ ctxt true bdvs simplify_System_parenthesized t;
23.135 if UnparseC.term t = "[0 = - 1 * q_0 * L \<up> 2 / 2 + (L * c + c_2), 0 = c_2]"
23.136 then () else error "eqsystem.sml rewrite in 2x2 simplify_System_par.1";
23.137 @@ -181,7 +181,7 @@
23.138 val thy = @{theory "Isac_Knowledge"} (*because of Undeclared constant "Biegelinie.EI*);
23.139 val ctxt = Proof_Context.init_global thy;
23.140 val t =
23.141 - TermC.parse_test @{context}"[0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 \<up> 3 + \
23.142 + ParseC.parse_test @{context}"[0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 \<up> 3 + \
23.143 \ - 1 * q_0 / 24 * 0 \<up> 4),\
23.144 \ 0 = c_2 + c * L + 1 / EI * (L * q_0 / 12 * L \<up> 3 + \
23.145 \ - 1 * q_0 / 24 * L \<up> 4)]";
23.146 @@ -217,10 +217,10 @@
23.147 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
23.148 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
23.149 "----------- rewrite in [EqSystem,top_down_substitution,2x2] -----";
23.150 -val e1__ = TermC.parse_test @{context} "c_2 = 77";
23.151 -val e2__ = TermC.parse_test @{context} "L * c + c_2 = q_0 * L \<up> 2 / 2";
23.152 -val bdvs = [(TermC.parse_test @{context}"bdv_1",TermC.parse_test @{context}"c"),
23.153 - (TermC.parse_test @{context}"bdv_2",TermC.parse_test @{context}"c_2")];
23.154 +val e1__ = ParseC.parse_test @{context} "c_2 = 77";
23.155 +val e2__ = ParseC.parse_test @{context} "L * c + c_2 = q_0 * L \<up> 2 / 2";
23.156 +val bdvs = [(ParseC.parse_test @{context}"bdv_1",ParseC.parse_test @{context}"c"),
23.157 + (ParseC.parse_test @{context}"bdv_2",ParseC.parse_test @{context}"c_2")];
23.158 val SOME (e2__,_) = rewrite_terms_ ctxt Rewrite_Ord.function_empty Rule_Set.Empty [e1__] e2__;
23.159 if UnparseC.term e2__ = "L * c + 77 = q_0 * L \<up> 2 / 2" then ()
23.160 else error "eqsystem.sml top_down_substitution,2x2] subst";
23.161 @@ -234,15 +234,15 @@
23.162 if UnparseC.term e2__ = "c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L" then ()
23.163 else error "eqsystem.sml top_down_substitution,2x2] isolate";
23.164
23.165 -val t = TermC.parse_test @{context} "[c_2 = 77, c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L]";
23.166 +val t = ParseC.parse_test @{context} "[c_2 = 77, c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L]";
23.167 val SOME (t,_) = rewrite_set_ ctxt true order_system t;
23.168 if UnparseC.term t = "[c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L, c_2 = 77]" then ()
23.169 else error "eqsystem.sml top_down_substitution,2x2] order_system";
23.170
23.171 if not (ord_simplify_System
23.172 false ctxt []
23.173 - (TermC.parse_test @{context}"[c_2 = 77, c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L]",
23.174 - TermC.parse_test @{context}"[c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L, c_2 = 77]"))
23.175 + (ParseC.parse_test @{context}"[c_2 = 77, c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L]",
23.176 + ParseC.parse_test @{context}"[c = (q_0 * L \<up> 2 / 2 + - 1 * 77) / L, c_2 = 77]"))
23.177 then () else error "eqsystem.sml, order_result rew_ord";
23.178
23.179
23.180 @@ -250,15 +250,15 @@
23.181 "----------- rewrite in [EqSystem,normalise,4x4] -----------------";
23.182 "----------- rewrite in [EqSystem,normalise,4x4] -----------------";
23.183 (*STOPPED.WN06?: revise rewrite in [EqSystem,normalise,4x4] from before 0609*)
23.184 -val t = TermC.parse_test @{context} (
23.185 +val t = ParseC.parse_test @{context} (
23.186 "[(0::real) = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c_3 + c_4, " ^
23.187 "(0::real) = - 1 * q_0 * L \<up> 2 / 2 + L * c_3 + c_4, " ^
23.188 "c + c_2 + c_3 + c_4 = 0, " ^
23.189 "c_2 + c_3 + c_4 = 0]");
23.190 -val bdvs = [(TermC.parse_test @{context}"bdv_1::real",TermC.parse_test @{context}"c::real"),
23.191 - (TermC.parse_test @{context}"bdv_2::real",TermC.parse_test @{context}"c_2::real"),
23.192 - (TermC.parse_test @{context}"bdv_3::real",TermC.parse_test @{context}"c_3::real"),
23.193 - (TermC.parse_test @{context}"bdv_4::real",TermC.parse_test @{context}"c_4::real")];
23.194 +val bdvs = [(ParseC.parse_test @{context}"bdv_1::real",ParseC.parse_test @{context}"c::real"),
23.195 + (ParseC.parse_test @{context}"bdv_2::real",ParseC.parse_test @{context}"c_2::real"),
23.196 + (ParseC.parse_test @{context}"bdv_3::real",ParseC.parse_test @{context}"c_3::real"),
23.197 + (ParseC.parse_test @{context}"bdv_4::real",ParseC.parse_test @{context}"c_4::real")];
23.198 val SOME (t, _) =
23.199 rewrite_set_inst_ ctxt true bdvs simplify_System_parenthesized t;
23.200 if UnparseC.term t = "[0 = c_4, 0 = - 1 * q_0 * L \<up> 2 / 2 + (L * c_3 + c_4),\n c + (c_2 + (c_3 + c_4)) = 0, c_2 + (c_3 + c_4) = 0]"
23.201 @@ -368,7 +368,7 @@
23.202 (*... resulted in
23.203 False "[c, c_2] from_ [c, c_2] occur_exactly_in nth_ 2\n
23.204 [c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]"]*)
23.205 -val t = TermC.parse_test @{context} ("[c, c_2] from [c, c_2] occur_exactly_in NTH 2" ^
23.206 +val t = ParseC.parse_test @{context} ("[c, c_2] from [c, c_2] occur_exactly_in NTH 2" ^
23.207 "[c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]");
23.208
23.209 val SOME (t', _) = rewrite_set_ ctxt false prls_triangular t;
24.1 --- a/test/Tools/isac/Knowledge/eqsystem-2.sml Sun Jan 29 14:31:56 2023 +0100
24.2 +++ b/test/Tools/isac/Knowledge/eqsystem-2.sml Mon Jan 30 09:47:18 2023 +0100
24.3 @@ -105,8 +105,8 @@
24.4 "----------- all systems from Biegelinie -------------------------";
24.5 val thy = @{theory Isac_Knowledge}
24.6 val subst =
24.7 - [(TermC.parse_test @{context} "bdv_1", TermC.parse_test @{context} "c"), (TermC.parse_test @{context} "bdv_2", TermC.parse_test @{context} "c_2"),
24.8 - (TermC.parse_test @{context} "bdv_3", TermC.parse_test @{context} "c_3"), (TermC.parse_test @{context} "bdv_4", TermC.parse_test @{context} "c_4")];
24.9 + [(ParseC.parse_test @{context} "bdv_1", ParseC.parse_test @{context} "c"), (ParseC.parse_test @{context} "bdv_2", ParseC.parse_test @{context} "c_2"),
24.10 + (ParseC.parse_test @{context} "bdv_3", ParseC.parse_test @{context} "c_3"), (ParseC.parse_test @{context} "bdv_4", ParseC.parse_test @{context} "c_4")];
24.11
24.12 "------- Bsp 7.27";
24.13 States.reset ();
24.14 @@ -122,7 +122,7 @@
24.15 c c_2 c_3 c_4 c c_2 1->2: c
24.16 c_2 c_4
24.17 c c_2 c c_2 c_3 c_4 [2':c, 1:c_2, 3:c_4] -> 4:c_3*)
24.18 -val t = TermC.parse_test @{context}
24.19 +val t = ParseC.parse_test @{context}
24.20 ("[0 = c_4, " ^
24.21 "0 = c_4 + L * c_3 +(12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 24 * EI), " ^
24.22 "0 = c_2, " ^
24.23 @@ -133,7 +133,7 @@
24.24 then () else error "Bsp 7.27";
24.25
24.26 "----- Bsp 7.27 go through the rewrites in met_eqsys_norm_4x4";
24.27 -val t = TermC.parse_test @{context} "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2";
24.28 +val t = ParseC.parse_test @{context} "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2";
24.29 val NONE = rewrite_set_ ctxt false norm_Rational t;
24.30 val SOME (t,_) =
24.31 rewrite_set_inst_ ctxt false subst simplify_System_parenthesized t;
24.32 @@ -178,7 +178,7 @@
24.33 c c_2 c_3 c_4 c c_2 c_3 1:c_3 -> 2:c c_2 2: c c_2
24.34 c_3 c_4
24.35 c c_2 c_3 c c_2 c_3 c_4 3:c_4 -> 4:c c_2 c_3 1:c_3 -> 4:c c_2*)
24.36 -val t = TermC.parse_test @{context}
24.37 +val t = ParseC.parse_test @{context}
24.38 ("[0 = c_4 + 0 / (- 1 * EI), " ^
24.39 "0 = c_4 + L * c_3 + (12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 24 * EI), " ^
24.40 "0 = c_3 + 0 / (- 1 * EI), " ^
24.41 @@ -200,7 +200,7 @@
24.42 c_4 | STOPPED.WN06? test methods @@@@@@@@@@@@@@@@@@@@@@@*)
24.43
24.44 "----- 7.70 go through the rewrites in met_eqsys_norm_4x4";
24.45 -val t = TermC.parse_test @{context}
24.46 +val t = ParseC.parse_test @{context}
24.47 ("[L * q_0 = c, " ^
24.48 "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2, " ^
24.49 "0 = c_4, " ^
24.50 @@ -318,7 +318,7 @@
24.51 c_4 | c_3 |2:c_3 -> 4' :c c_2 c_4 | |
24.52 c c_2 c_3 c_4 | c_4 |3' | |
24.53 c_3 |c c_2 c_3 c_4 |3:c_4 -> 4'':c c_2 |4'':c c_2 | *)
24.54 -val t = TermC.parse_test @{context}"[0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2, \
24.55 +val t = ParseC.parse_test @{context}"[0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2, \
24.56 \ 0 = c_4 + 0 / (- 1 * EI), \
24.57 \ 0 = c_4 + L * c_3 +(12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) /(- 24 * EI),\
24.58 \ 0 = c_3 + 0 / (- 1 * EI)]";
24.59 @@ -353,7 +353,7 @@
24.60 c c_2 | |1:c_2 -> 2':c |c_2 c
24.61 c_4 | | |
24.62 c c_2 c_3 c_4 | |3:c_4 -> 4':c c_2 c_3 |c_2 c c_3*)
24.63 -val t = TermC.parse_test @{context}"[0 = c_2, \
24.64 +val t = ParseC.parse_test @{context}"[0 = c_2, \
24.65 \ 0 = (6 * c_2 + 6 * L * c + - 1 * L \<up> 2 * q_0) / 6, \
24.66 \ 0 = c_4 + 0 / (- 1 * EI), \
24.67 \ 0 = c_4 + L * c_3 + (60 * L \<up> 2 * c_2 + 20 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 120 * EI)]";
25.1 --- a/test/Tools/isac/Knowledge/integrate.sml Sun Jan 29 14:31:56 2023 +0100
25.2 +++ b/test/Tools/isac/Knowledge/integrate.sml Mon Jan 30 09:47:18 2023 +0100
25.3 @@ -51,14 +51,14 @@
25.4 "----------- parsing ------------------------------------";
25.5 "----------- parsing ------------------------------------";
25.6 "----------- parsing ------------------------------------";
25.7 -val t = TermC.parse_test @{context} "Integral x D x";
25.8 -val t = TermC.parse_test @{context} "Integral x \<up> 2 D x";
25.9 +val t = ParseC.parse_test @{context} "Integral x D x";
25.10 +val t = ParseC.parse_test @{context} "Integral x \<up> 2 D x";
25.11 case t of
25.12 Const (\<^const_name>\<open>Integral\<close>, _) $
25.13 (Const (\<^const_name>\<open>realpow\<close>, _) $ Free _ $ _) $ Free ("x", _) => ()
25.14 | _ => error "integrate.sml: parsing: Integral x \<up> 2 D x";
25.15
25.16 -val t = TermC.parse_test @{context} "ff x is_f_x";
25.17 +val t = ParseC.parse_test @{context} "ff x is_f_x";
25.18 case t of Const (\<^const_name>\<open>is_f_x\<close>, _) $ _ => ()
25.19 | _ => error "integrate.sml: parsing: ff x is_f_x";
25.20
25.21 @@ -66,26 +66,26 @@
25.22 "----------- integrate by rewriting ---------------------";
25.23 "----------- integrate by rewriting ---------------------";
25.24 "----------- integrate by rewriting ---------------------";
25.25 -val str = rewrit @{thm "integral_const"} (TermC.parse_test @{context} "Integral 1 D x");
25.26 +val str = rewrit @{thm "integral_const"} (ParseC.parse_test @{context} "Integral 1 D x");
25.27 if term2s str = "1 * x" then () else error "integrate.sml Integral 1 D x";
25.28
25.29 -val str = rewrit @{thm "integral_const"} (TermC.parse_test @{context} "Integral M'/EJ D x");
25.30 +val str = rewrit @{thm "integral_const"} (ParseC.parse_test @{context} "Integral M'/EJ D x");
25.31 if term2s str = "M' / EJ * x" then ()
25.32 else error "Integral M'/EJ D x BY integral_const";
25.33
25.34 -val str = rewrit @{thm "integral_var"} (TermC.parse_test @{context} "Integral x D x");
25.35 +val str = rewrit @{thm "integral_var"} (ParseC.parse_test @{context} "Integral x D x");
25.36 if term2s str = "x \<up> 2 / 2" then ()
25.37 else error "Integral x D x BY integral_var";
25.38
25.39 -val str = rewrit @{thm "integral_add"} (TermC.parse_test @{context} "Integral x + 1 D x");
25.40 +val str = rewrit @{thm "integral_add"} (ParseC.parse_test @{context} "Integral x + 1 D x");
25.41 if term2s str = "Integral x D x + Integral 1 D x" then ()
25.42 else error "Integral x + 1 D x BY integral_add";
25.43
25.44 -val str = rewrit @{thm "integral_mult"} (TermC.parse_test @{context} "Integral M'/EJ * x \<up> 3 D x");
25.45 +val str = rewrit @{thm "integral_mult"} (ParseC.parse_test @{context} "Integral M'/EJ * x \<up> 3 D x");
25.46 if term2s str = "M' / EJ * Integral x \<up> 3 D x" then ()
25.47 else error "Integral M'/EJ * x \<up> 3 D x BY integral_mult";
25.48
25.49 -val str = rewrit @{thm "integral_pow"} (TermC.parse_test @{context} "Integral x \<up> 3 D x");
25.50 +val str = rewrit @{thm "integral_pow"} (ParseC.parse_test @{context} "Integral x \<up> 3 D x");
25.51 if term2s str = "x \<up> (3 + 1) / (3 + 1)" then ()
25.52 else error "integrate.sml Integral x \<up> 3 D x";
25.53
25.54 @@ -93,7 +93,7 @@
25.55 "----------- test add_new_c, TermC.is_f_x ---------------------";
25.56 "----------- test add_new_c, TermC.is_f_x ---------------------";
25.57 "----------- test add_new_c, TermC.is_f_x ---------------------";
25.58 -val term = TermC.parse_test @{context} "x \<up> 2 * c + c_2";
25.59 +val term = ParseC.parse_test @{context} "x \<up> 2 * c + c_2";
25.60 val cc = new_c term;
25.61 if UnparseC.term cc = "c_3" then () else error "integrate.sml: new_c ???";
25.62
25.63 @@ -108,7 +108,7 @@
25.64 if UnparseC.term t' = "x \<up> 2 * c + c_2 + c_3" then ()
25.65 else error "intergrate.sml: diff. rewrite_set add_new_c 1";
25.66
25.67 -val term = TermC.parse_test @{context} "ff x = x \<up> 2*c + c_2";
25.68 +val term = ParseC.parse_test @{context} "ff x = x \<up> 2*c + c_2";
25.69 val SOME (t',_) = rewrite_set_ ctxt true add_new_c term;
25.70 if UnparseC.term t' = "ff x = x \<up> 2 * c + c_2 + c_3" then ()
25.71 else error "intergrate.sml: diff. rewrite_set add_new_c 2";
25.72 @@ -173,9 +173,9 @@
25.73 "----------- simplify by ruleset reducing make_ratpoly_in";
25.74 val thy = @{theory "Isac_Knowledge"};
25.75 val ctxt = Proof_Context.init_global thy;
25.76 -val subst = [(TermC.parse_test @{context} "bdv ::real", TermC.parse_test @{context} "x ::real")]; (*DOESN'T HELP*)
25.77 +val subst = [(ParseC.parse_test @{context} "bdv ::real", ParseC.parse_test @{context} "x ::real")]; (*DOESN'T HELP*)
25.78 "===== test 1";
25.79 -val t = TermC.parse_test @{context} "1/EI * (L * q_0 * x / 2 + - 1 * q_0 * x \<up> 2 / 2)";
25.80 +val t = ParseC.parse_test @{context} "1/EI * (L * q_0 * x / 2 + - 1 * q_0 * x \<up> 2 / 2)";
25.81
25.82 "----- stepwise from the rulesets in simplify_Integral and below-----";
25.83 val rls = norm_Rational_noadd_fractions;
25.84 @@ -196,7 +196,7 @@
25.85 else error "integrate.sml simplify by ruleset discard_parenth.. #3";
25.86
25.87 "===== test 4";
25.88 -val subs = [(TermC.parse_test @{context} "bdv::real", TermC.parse_test @{context} "x::real")];
25.89 +val subs = [(ParseC.parse_test @{context} "bdv::real", ParseC.parse_test @{context} "x::real")];
25.90 val rls =
25.91 (Rule_Set.append_rules "separate_bdv" collect_bdv
25.92 [Thm ("separate_bdv", @{thm separate_bdv}),
25.93 @@ -221,7 +221,7 @@
25.94 else error "integrate.sml simplify by ruleset separate_bdv.. #4";
25.95
25.96 "===== test 5";
25.97 -val t = TermC.parse_test @{context} "1/EI * (L * q_0 * x / 2 + - 1 * q_0 * x \<up> 2 / 2)";
25.98 +val t = ParseC.parse_test @{context} "1/EI * (L * q_0 * x / 2 + - 1 * q_0 * x \<up> 2 / 2)";
25.99 val rls = simplify_Integral;
25.100 val SOME (t,[]) = rewrite_set_inst_ ctxt true subs rls t;
25.101 (* given was: "1 / EI * (L * q_0 * x / 2 + - 1 * q_0 * x \<up> 2 / 2)" *)
25.102 @@ -231,10 +231,10 @@
25.103 "........... 2nd integral ........................................";
25.104 "........... 2nd integral ........................................";
25.105 "........... 2nd integral ........................................";
25.106 -val subs = [(TermC.parse_test @{context} "bdv::real", TermC.parse_test @{context} "x::real")];
25.107 +val subs = [(ParseC.parse_test @{context} "bdv::real", ParseC.parse_test @{context} "x::real")];
25.108
25.109 val thy = @{theory Biegelinie};
25.110 -val t = TermC.parse_test @{context}
25.111 +val t = ParseC.parse_test @{context}
25.112 "Integral 1 / EI * (L * q_0 / 2 * (x \<up> 2 / 2) + - 1 * q_0 / 2 * (x \<up> 3 / 3)) D x";
25.113
25.114 val rls = simplify_Integral;
25.115 @@ -309,7 +309,7 @@
25.116 "----------- rewrite 3rd integration in 7.27 ------------";
25.117 "----------- rewrite 3rd integration in 7.27 ------------";
25.118 "----------- rewrite 3rd integration in 7.27 ------------";
25.119 -val t = TermC.parse_test @{context} "Integral 1 / EI * ((L * q_0 * x + - 1 * q_0 * x \<up> 2) / 2) D x";
25.120 +val t = ParseC.parse_test @{context} "Integral 1 / EI * ((L * q_0 * x + - 1 * q_0 * x \<up> 2) / 2) D x";
25.121 val SOME(t, _)= rewrite_set_inst_ ctxt true subs simplify_Integral t;
25.122 if UnparseC.term t =
25.123 "Integral 1 / EI * (L * q_0 / 2 * x + - 1 * q_0 / 2 * x \<up> 2) D x"
25.124 @@ -358,7 +358,7 @@
25.125 if F1_ = F2_ then () else error "integrate.sml: unequal find's";
25.126
25.127 val ((dsc as Const (\<^const_name>\<open>antiDerivativeName\<close>, _))
25.128 - $ Free ("ff", F3_type)) = TermC.parse_test @{context} "antiDerivativeName ff";
25.129 + $ Free ("ff", F3_type)) = ParseC.parse_test @{context} "antiDerivativeName ff";
25.130 if Input_Descript.is_a dsc then () else error "integrate.sml: no description";
25.131 if F1_type = F3_type then ()
25.132 else error "integrate.sml: unequal types in find's";
26.1 --- a/test/Tools/isac/Knowledge/logexp.sml Sun Jan 29 14:31:56 2023 +0100
26.2 +++ b/test/Tools/isac/Knowledge/logexp.sml Mon Jan 30 09:47:18 2023 +0100
26.3 @@ -29,9 +29,9 @@
26.4 ["equation", "test"]; *)
26.5 *)
26.6
26.7 -val t = TermC.parse_test @{context} "(2 log x)";
26.8 -val t = TermC.parse_test @{context} "(2 log x) = 3";
26.9 -val t = TermC.parse_test @{context} "matches ((?a log x) = ?b) ((2 log x) = 3)";
26.10 +val t = ParseC.parse_test @{context} "(2 log x)";
26.11 +val t = ParseC.parse_test @{context} "(2 log x) = 3";
26.12 +val t = ParseC.parse_test @{context} "matches ((?a log x) = ?b) ((2 log x) = 3)";
26.13 TermC.atom_trace_detail @{context} t;
26.14
26.15
27.1 --- a/test/Tools/isac/Knowledge/partial_fractions.sml Sun Jan 29 14:31:56 2023 +0100
27.2 +++ b/test/Tools/isac/Knowledge/partial_fractions.sml Mon Jan 30 09:47:18 2023 +0100
27.3 @@ -272,7 +272,7 @@
27.4 "----------- progr.vers.2: check asm_rls for multiply_ansatz";
27.5 "----------- progr.vers.2: check asm_rls for multiply_ansatz";
27.6 (*test for outcommented 3 lines in script: is norm_Rational strong enough?*)
27.7 -val t = TermC.parse_test @{context} "(3 / ((- 1 + - 2 * z + 8 * z \<up> 2) *3/24)) = (3 / ((z - 1 / 2) * (z - - 1 / 4)))";
27.8 +val t = ParseC.parse_test @{context} "(3 / ((- 1 + - 2 * z + 8 * z \<up> 2) *3/24)) = (3 / ((z - 1 / 2) * (z - - 1 / 4)))";
27.9 val SOME (t', _) = rewrite_set_ @{theory Isac_Knowledge} true ansatz_rls t;
27.10 UnparseC.term t' = "3 / ((- 1 + - 2 * z + 8 * z \<up> 2) * 3 / 24) =\n?A / (z - 1 / 2) + ?B / (z - - 1 / 4)";
27.11
28.1 --- a/test/Tools/isac/Knowledge/poly-1.sml Sun Jan 29 14:31:56 2023 +0100
28.2 +++ b/test/Tools/isac/Knowledge/poly-1.sml Mon Jan 30 09:47:18 2023 +0100
28.3 @@ -30,16 +30,16 @@
28.4 "-------- fun is_polyexp -----------------------------------------------------------------------";
28.5 "-------- fun is_polyexp -----------------------------------------------------------------------";
28.6 "-------- fun is_polyexp -----------------------------------------------------------------------";
28.7 -val t = TermC.parse_test @{context} "x / x";
28.8 +val t = ParseC.parse_test @{context} "x / x";
28.9 if is_polyexp t then error "NOT is_polyexp (x / x)" else ();
28.10
28.11 -val t = TermC.parse_test @{context} "- 1 * A * 3";
28.12 +val t = ParseC.parse_test @{context} "- 1 * A * 3";
28.13 if is_polyexp t then () else error "is_polyexp (- 1 * A * 3)";
28.14
28.15 -val t = TermC.parse_test @{context} "- 1 * AA * 3";
28.16 +val t = ParseC.parse_test @{context} "- 1 * AA * 3";
28.17 if is_polyexp t then () else error "is_polyexp (- 1 * AA * 3)";
28.18
28.19 -val t = TermC.parse_test @{context} "x * x + x * y + (- 1 * y * x + - 1 * y * y)::real";
28.20 +val t = ParseC.parse_test @{context} "x * x + x * y + (- 1 * y * x + - 1 * y * y)::real";
28.21 if is_polyexp t then () else error "is_polyexp (x * x + x * y + (- 1 * y * x + - 1 * y * y))";
28.22
28.23 "-------- fun has_degree_in --------------------------------------------------------------------";
28.24 @@ -264,7 +264,7 @@
28.25 "-------- fun is_addUnordered (x \<up> 2 * y \<up> 2 + x \<up> 3 * y) --------------------------------------";
28.26 "-------- fun is_addUnordered (x \<up> 2 * y \<up> 2 + x \<up> 3 * y) --------------------------------------";
28.27 val ctxt = Proof_Context.init_global @{theory}
28.28 -val t = TermC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x * x \<up> 2 * y";
28.29 +val t = ParseC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x * x \<up> 2 * y";
28.30 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.31 UnparseC.term t = "x \<up> 2 * y \<up> 2 + x \<up> 3 * y";
28.32 if UnparseC.term t = "x \<up> 3 * y + x \<up> 2 * y \<up> 2" then ()
28.33 @@ -280,9 +280,9 @@
28.34 ####### calc. to: False (*isa*)
28.35 True (*isa2*)
28.36 ( **)
28.37 - if is_addUnordered (TermC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x \<up> 3 * y ::real") then ()
28.38 + if is_addUnordered (ParseC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x \<up> 3 * y ::real") then ()
28.39 else error"is_addUnordered x \<up> 2 * y \<up> 2 + x \<up> 3 * y"; (*isa == isa2*)
28.40 -"~~~~~ fun is_addUnordered , args:"; val (t) = (TermC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x \<up> 3 * y ::real");
28.41 +"~~~~~ fun is_addUnordered , args:"; val (t) = (ParseC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x \<up> 3 * y ::real");
28.42 ((is_polyexp t) andalso not (t = sort_monoms t)) = false; (*isa == isa2*)
28.43
28.44 (*+*) if is_polyexp t = true then () else error "is_polyexp x \<up> 2 * y \<up> 2 + x \<up> 3 * y";
28.45 @@ -412,32 +412,32 @@
28.46 "-------- check make_polynomial with simple terms ----------------------------------------------";
28.47 "-------- check make_polynomial with simple terms ----------------------------------------------";
28.48 "----- check 1 ---";
28.49 -val t = TermC.parse_test @{context} "2*3*a";
28.50 +val t = ParseC.parse_test @{context} "2*3*a";
28.51 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
28.52 if UnparseC.term t = "6 * a" then () else error "check make_polynomial 1";
28.53
28.54 "----- check 2 ---";
28.55 -val t = TermC.parse_test @{context} "2*a + 3*a";
28.56 +val t = ParseC.parse_test @{context} "2*a + 3*a";
28.57 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
28.58 if UnparseC.term t = "5 * a" then () else error "check make_polynomial 2";
28.59
28.60 "----- check 3 ---";
28.61 -val t = TermC.parse_test @{context} "2*a + 3*a + 3*a";
28.62 +val t = ParseC.parse_test @{context} "2*a + 3*a + 3*a";
28.63 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
28.64 if UnparseC.term t = "8 * a" then () else error "check make_polynomial 3";
28.65
28.66 "----- check 4 ---";
28.67 -val t = TermC.parse_test @{context} "3*a - 2*a";
28.68 +val t = ParseC.parse_test @{context} "3*a - 2*a";
28.69 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
28.70 if UnparseC.term t = "a" then () else error "check make_polynomial 4";
28.71
28.72 "----- check 5 ---";
28.73 -val t = TermC.parse_test @{context} "4*(3*a - 2*a)";
28.74 +val t = ParseC.parse_test @{context} "4*(3*a - 2*a)";
28.75 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
28.76 if UnparseC.term t = "4 * a" then () else error "check make_polynomial 5";
28.77
28.78 "----- check 6 ---";
28.79 -val t = TermC.parse_test @{context} "4*(3*a \<up> 2 - 2*a \<up> 2)";
28.80 +val t = ParseC.parse_test @{context} "4*(3*a \<up> 2 - 2*a \<up> 2)";
28.81 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
28.82 if UnparseC.term t = "4 * a \<up> 2" then () else error "check make_polynomial 6";
28.83
28.84 @@ -446,7 +446,7 @@
28.85 "-------- fun is_multUnordered (x \<up> 2 * x) -----------------------------------------------------";
28.86 val thy = @{theory "Isac_Knowledge"};
28.87 "===== works for a simple example, see rewrite.sml -- fun app_rev ===";
28.88 -val t = TermC.parse_test @{context} "x \<up> 2 * x";
28.89 +val t = ParseC.parse_test @{context} "x \<up> 2 * x";
28.90 val SOME (t', _) = rewrite_set_ ctxt true order_mult_ t;
28.91 if UnparseC.term t' = "x * x \<up> 2" then ()
28.92 else error "poly.sml Poly.is_multUnordered doesn't work";
28.93 @@ -458,7 +458,7 @@
28.94 ####### try calc: Poly.is_multUnordered'
28.95 ======= calc. to: False !!!!!!!!!!!!! INSTEAD OF TRUE in 2002 !!!!!!!!!!!!!
28.96 *)
28.97 -val t = TermC.parse_test @{context} "5 * x \<up> 2 * (2 * x \<up> 7) + 5 * x \<up> 2 * 3 + (6 * x \<up> 7 + 9) + (- 1 * (3 * x \<up> 5 * (6 * x \<up> 4)) + - 1 * (3 * x \<up> 5 * - 1) + (-48 * x \<up> 4 + 8))";
28.98 +val t = ParseC.parse_test @{context} "5 * x \<up> 2 * (2 * x \<up> 7) + 5 * x \<up> 2 * 3 + (6 * x \<up> 7 + 9) + (- 1 * (3 * x \<up> 5 * (6 * x \<up> 4)) + - 1 * (3 * x \<up> 5 * - 1) + (-48 * x \<up> 4 + 8))";
28.99
28.100 "----- is_multUnordered ---";
28.101 val tsort = sort_variables t;
28.102 @@ -469,7 +469,7 @@
28.103 if is_multUnordered t then () else error "poly.sml diff. is_multUnordered 1";
28.104
28.105 "----- eval_is_multUnordered ---";
28.106 -val tm = TermC.parse_test @{context} "(5 * x \<up> 2 * (2 * x \<up> 7) + 5 * x \<up> 2 * 3 + (6 * x \<up> 7 + 9) + (- 1 * (3 * x \<up> 5 * (6 * x \<up> 4)) + - 1 * (3 * x \<up> 5 * - 1) + (-48 * x \<up> 4 + 8))) is_multUnordered";
28.107 +val tm = ParseC.parse_test @{context} "(5 * x \<up> 2 * (2 * x \<up> 7) + 5 * x \<up> 2 * 3 + (6 * x \<up> 7 + 9) + (- 1 * (3 * x \<up> 5 * (6 * x \<up> 4)) + - 1 * (3 * x \<up> 5 * - 1) + (-48 * x \<up> 4 + 8))) is_multUnordered";
28.108 case eval_is_multUnordered "testid" "" tm @{context} of
28.109 SOME (_, Const (\<^const_name>\<open>Trueprop\<close>, _) $
28.110 (Const (\<^const_name>\<open>HOL.eq\<close>, _) $
28.111 @@ -486,7 +486,7 @@
28.112 "-------- fun is_multUnordered (3 * a + - 2 * a) -----------------------------------------------";
28.113 "-------- fun is_multUnordered (3 * a + - 2 * a) -----------------------------------------------";
28.114 val thy = @{theory "Isac_Knowledge"};
28.115 -val t as (_ $ arg) = TermC.parse_test @{context} "(3 * a + - 2 * a) is_multUnordered";
28.116 +val t as (_ $ arg) = ParseC.parse_test @{context} "(3 * a + - 2 * a) is_multUnordered";
28.117
28.118 (*+*)if UnparseC.term (sort_variables arg) = "3 * a + - 2 * a" andalso is_polyexp arg = true
28.119 (*+*) andalso not (is_multUnordered arg)
28.120 @@ -501,7 +501,7 @@
28.121 | _ => error "eval_is_multUnordered 3 * a + - 2 * a CHANGED";
28.122
28.123 "----- is_multUnordered --- (- 2 * a) is_multUnordered = False";
28.124 -val t as (_ $ arg) = TermC.parse_test @{context} "(- 2 * a) is_multUnordered";
28.125 +val t as (_ $ arg) = ParseC.parse_test @{context} "(- 2 * a) is_multUnordered";
28.126
28.127 (*+*)if UnparseC.term (sort_variables arg) = "- 2 * a" andalso is_polyexp arg = true
28.128 (*+*) andalso not (is_multUnordered arg)
28.129 @@ -515,7 +515,7 @@
28.130 | _ => error "eval_is_multUnordered 3 * a + - 2 * a CHANGED";
28.131
28.132 "----- is_multUnordered --- (a) is_multUnordered = False";
28.133 -val t as (_ $ arg) = TermC.parse_test @{context} "(a) is_multUnordered";
28.134 +val t as (_ $ arg) = ParseC.parse_test @{context} "(a) is_multUnordered";
28.135
28.136 (*+*)if UnparseC.term (sort_variables arg) = "a" andalso is_polyexp arg = true
28.137 (*+*) andalso not (is_multUnordered arg)
28.138 @@ -529,7 +529,7 @@
28.139 | _ => error "eval_is_multUnordered 3 * a + - 2 * a CHANGED";
28.140
28.141 "----- is_multUnordered --- (- 2) is_multUnordered = False";
28.142 -val t as (_ $ arg) = TermC.parse_test @{context} "(- 2) is_multUnordered";
28.143 +val t as (_ $ arg) = ParseC.parse_test @{context} "(- 2) is_multUnordered";
28.144
28.145 (*+*)if UnparseC.term (sort_variables arg) = "- 2" andalso is_polyexp arg = true
28.146 (*+*) andalso not (is_multUnordered arg)
28.147 @@ -567,7 +567,7 @@
28.148 O:x \<up> 3 + - 1 * (3 * (a * x \<up> 2)) + - 1 \<up> 2 * (3 * (a \<up> 2 * x)) + - 1 \<up> 3 * a \<up> 3
28.149 -------------------------------------------------------------------------------------------------<>
28.150 *)
28.151 -val t = TermC.parse_test @{context} "x \<up> 3 + 3 * x \<up> 2 * (- 1 * a) + 3 * x * ((- 1) \<up> 2 * a \<up> 2) + (- 1) \<up> 3 * a \<up> 3";
28.152 +val t = ParseC.parse_test @{context} "x \<up> 3 + 3 * x \<up> 2 * (- 1 * a) + 3 * x * ((- 1) \<up> 2 * a \<up> 2) + (- 1) \<up> 3 * a \<up> 3";
28.153 (*
28.154 "~~~~~ fun is_multUnordered
28.155 "~~~~~~~ fun sort_variables
28.156 @@ -636,7 +636,7 @@
28.157 "-------- fun is_multUnordered b * a * a ------------------------------------------------------";
28.158 "-------- fun is_multUnordered b * a * a ------------------------------------------------------";
28.159 "-------- fun is_multUnordered b * a * a ------------------------------------------------------";
28.160 -val t = TermC.parse_test @{context} "b * a * a";
28.161 +val t = ParseC.parse_test @{context} "b * a * a";
28.162 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.163 if UnparseC.term t = "a \<up> 2 * b" then ()
28.164 else error "poly.sml: diff.behav. in make_polynomial 21";
28.165 @@ -659,7 +659,7 @@
28.166 "-------- fun is_multUnordered 2*3*a -----------------------------------------------------------";
28.167 "-------- fun is_multUnordered 2*3*a -----------------------------------------------------------";
28.168 "-------- fun is_multUnordered 2*3*a -----------------------------------------------------------";
28.169 -val t = TermC.parse_test @{context} "2*3*a";
28.170 +val t = ParseC.parse_test @{context} "2*3*a";
28.171 val SOME (t', _) = rewrite_set_ ctxt false make_polynomial t;
28.172 (*+*)if UnparseC.term t' = "6 * a" then () else error "rewrite_set_ 2*3*a CHANGED";
28.173 (*
28.174 @@ -673,7 +673,7 @@
28.175 ####### calc. to: True (*isa*)
28.176 False (*isa2*)
28.177 *)
28.178 -val t = TermC.parse_test @{context} "(6 * a) is_multUnordered";
28.179 +val t = ParseC.parse_test @{context} "(6 * a) is_multUnordered";
28.180 val SOME
28.181 (_, t') =
28.182 eval_is_multUnordered "xxx" () t @{context};
28.183 @@ -702,7 +702,7 @@
28.184 val ctxt = Proof_Context.init_global thy;
28.185
28.186 val SOME (f',_) = rewrite_set_ ctxt false norm_Poly
28.187 -(TermC.parse_test @{context} "L = k - 2 * q + (k - 2 * q) + (k - 2 * q) + (k - 2 * q) + senkrecht + oben");
28.188 +(ParseC.parse_test @{context} "L = k - 2 * q + (k - 2 * q) + (k - 2 * q) + (k - 2 * q) + senkrecht + oben");
28.189 if UnparseC.term f' = "L = 2 * 2 * k + 2 * - 4 * q + senkrecht + oben"
28.190 then ((*norm_Poly NOT COMPLETE -- TODO MG*))
28.191 else error "norm_Poly changed behavior";
28.192 @@ -720,7 +720,7 @@
28.193 ### rls: order_add_ on: L = k + k + k + k + - 2 * q + - 2 * q + - 2 * q + - 2 * q + senkrecht + oben
28.194 *)
28.195 "~~~~~ fun sort_monoms , args:"; val (t) =
28.196 - (TermC.parse_test @{context} "L = k + k + k + k + - 2 * q + - 2 * q + - 2 * q + - 2 * q + senkrecht + oben");
28.197 + (ParseC.parse_test @{context} "L = k + k + k + k + - 2 * q + - 2 * q + - 2 * q + - 2 * q + senkrecht + oben");
28.198 (*+*)val t' =
28.199 sort_monoms t;
28.200 (*+*)UnparseC.term t' = "L = k + k + k + k + - 2 * q + - 2 * q + - 2 * q + - 2 * q + senkrecht + oben"; (*isa*)
28.201 @@ -729,37 +729,37 @@
28.202 "-------- complex examples from textbook Schalk I ----------------------------------------------";
28.203 "-------- complex examples from textbook Schalk I ----------------------------------------------";
28.204 "-------- complex examples from textbook Schalk I ----------------------------------------------";
28.205 -val t = TermC.parse_test @{context} "1 + 2 * x \<up> 4 + 2 * - 2 * x \<up> 4 + x \<up> 8";
28.206 +val t = ParseC.parse_test @{context} "1 + 2 * x \<up> 4 + 2 * - 2 * x \<up> 4 + x \<up> 8";
28.207 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.208 if (UnparseC.term t) = "1 + - 2 * x \<up> 4 + x \<up> 8"
28.209 then () else error "poly.sml: diff.behav. in make_polynomial 9b";
28.210
28.211 "-----SPB Schalk I p.64 No.296a ---";
28.212 -val t = TermC.parse_test @{context} "(x - a) \<up> 3";
28.213 +val t = ParseC.parse_test @{context} "(x - a) \<up> 3";
28.214 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.215 if (UnparseC.term t) = "- 1 * a \<up> 3 + 3 * a \<up> 2 * x + - 3 * a * x \<up> 2 + x \<up> 3"
28.216 then () else error "poly.sml: diff.behav. in make_polynomial 10";
28.217
28.218 "-----SPB Schalk I p.64 No.296c ---";
28.219 -val t = TermC.parse_test @{context} "(-3*x - 4*y) \<up> 3";
28.220 +val t = ParseC.parse_test @{context} "(-3*x - 4*y) \<up> 3";
28.221 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.222 if (UnparseC.term t) = "- 27 * x \<up> 3 + - 108 * x \<up> 2 * y + - 144 * x * y \<up> 2 +\n- 64 * y \<up> 3"
28.223 then () else error "poly.sml: diff.behav. in make_polynomial 11";
28.224
28.225 "-----SPB Schalk I p.62 No.242c ---";
28.226 -val t = TermC.parse_test @{context} "x \<up> (- 4)*(x \<up> (- 4)*y \<up> (- 2)) \<up> (- 1)*y \<up> (- 2)";
28.227 +val t = ParseC.parse_test @{context} "x \<up> (- 4)*(x \<up> (- 4)*y \<up> (- 2)) \<up> (- 1)*y \<up> (- 2)";
28.228 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.229 if (UnparseC.term t) = "1"
28.230 then () else error "poly.sml: diff.behav. in make_polynomial 12";
28.231
28.232 "-----SPB Schalk I p.60 No.209a ---";
28.233 -val t = TermC.parse_test @{context} "a \<up> (7-x) * a \<up> x";
28.234 +val t = ParseC.parse_test @{context} "a \<up> (7-x) * a \<up> x";
28.235 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.236 if UnparseC.term t = "a \<up> 7"
28.237 then () else error "poly.sml: diff.behav. in make_polynomial 13";
28.238
28.239 "-----SPB Schalk I p.60 No.209d ---";
28.240 -val t = TermC.parse_test @{context} "d \<up> x * d \<up> (x+1) * d \<up> (2 - 2*x)";
28.241 +val t = ParseC.parse_test @{context} "d \<up> x * d \<up> (x+1) * d \<up> (2 - 2*x)";
28.242 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.243 if UnparseC.term t = "d \<up> 3"
28.244 then () else error "poly.sml: diff.behav. in make_polynomial 14";
28.245 @@ -769,23 +769,23 @@
28.246 "-------- complex Eigene Beispiele (Mathias Goldgruber) ----------------------------------------";
28.247 "-------- complex Eigene Beispiele (Mathias Goldgruber) ----------------------------------------";
28.248 "-----SPO ---";
28.249 -val t = TermC.parse_test @{context} "a \<up> 2*a \<up> (- 2)";
28.250 +val t = ParseC.parse_test @{context} "a \<up> 2*a \<up> (- 2)";
28.251 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.252 if UnparseC.term t = "1" then ()
28.253 else error "poly.sml: diff.behav. in make_polynomial 15";
28.254
28.255 "-----SPO ---";
28.256 -val t = TermC.parse_test @{context} "a \<up> 2*b*b \<up> (- 1)";
28.257 +val t = ParseC.parse_test @{context} "a \<up> 2*b*b \<up> (- 1)";
28.258 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.259 if UnparseC.term t = "a \<up> 2" then ()
28.260 else error "poly.sml: diff.behav. in make_polynomial 18";
28.261 "-----SPO ---";
28.262 -val t = TermC.parse_test @{context} "a \<up> 2*a \<up> (- 2)";
28.263 +val t = ParseC.parse_test @{context} "a \<up> 2*a \<up> (- 2)";
28.264 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.265 if (UnparseC.term t) = "1" then ()
28.266 else error "poly.sml: diff.behav. in make_polynomial 19";
28.267 "-----SPO ---";
28.268 -val t = TermC.parse_test @{context} "b + a - b";
28.269 +val t = ParseC.parse_test @{context} "b + a - b";
28.270 val SOME (t,_) = rewrite_set_ ctxt false make_polynomial t; UnparseC.term t;
28.271 if (UnparseC.term t) = "a" then ()
28.272 else error "poly.sml: diff.behav. in make_polynomial 20";
29.1 --- a/test/Tools/isac/Knowledge/poly-2.sml Sun Jan 29 14:31:56 2023 +0100
29.2 +++ b/test/Tools/isac/Knowledge/poly-2.sml Mon Jan 30 09:47:18 2023 +0100
29.3 @@ -255,7 +255,7 @@
29.4 "~~~~~~~~~~~~~ fun get_basStr used twice --^^
29.5 "~~~~~~~~~~~~~ fun get_potStr used twice --^^
29.6 *)
29.7 -val t = TermC.parse_test @{context} "(1 + 2 * x \<up> 4 + - 4 * x \<up> 4 + x \<up> 8) is_addUnordered";
29.8 +val t = ParseC.parse_test @{context} "(1 + 2 * x \<up> 4 + - 4 * x \<up> 4 + x \<up> 8) is_addUnordered";
29.9
29.10 eval_is_addUnordered "xxx" "yyy" t @{context};
29.11 "~~~~~ fun eval_is_addUnordered , args:"; val ((thmid:string), _,
29.12 @@ -420,20 +420,20 @@
29.13 "-------- examples from textbook Schalk I ------------------------------------------------------";
29.14 "-------- examples from textbook Schalk I ------------------------------------------------------";
29.15 "-----SPB Schalk I p.63 No.267b ---";
29.16 -val t = TermC.parse_test @{context} "(5*x \<up> 2 + 3) * (2*x \<up> 7 + 3) - (3*x \<up> 5 + 8) * (6*x \<up> 4 - 1)";
29.17 +val t = ParseC.parse_test @{context} "(5*x \<up> 2 + 3) * (2*x \<up> 7 + 3) - (3*x \<up> 5 + 8) * (6*x \<up> 4 - 1)";
29.18 val SOME (t, _) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.19 if UnparseC.term t = "17 + 15 * x \<up> 2 + - 48 * x \<up> 4 + 3 * x \<up> 5 + 6 * x \<up> 7 +\n- 8 * x \<up> 9"
29.20 then () else error "poly.sml: diff.behav. in make_polynomial 1";
29.21
29.22 "-----SPB Schalk I p.63 No.275b ---";
29.23 -val t = TermC.parse_test @{context} "(3*x \<up> 2 - 2*x*y + y \<up> 2) * (x \<up> 2 - 2*y \<up> 2)";
29.24 +val t = ParseC.parse_test @{context} "(3*x \<up> 2 - 2*x*y + y \<up> 2) * (x \<up> 2 - 2*y \<up> 2)";
29.25 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.26 if UnparseC.term t =
29.27 "3 * x \<up> 4 + - 2 * x \<up> 3 * y + - 5 * x \<up> 2 * y \<up> 2 +\n4 * x * y \<up> 3 +\n- 2 * y \<up> 4"
29.28 then () else error "poly.sml: diff.behav. in make_polynomial 2";
29.29
29.30 "-----SPB Schalk I p.63 No.279b ---";
29.31 -val t = TermC.parse_test @{context} "(x-a)*(x-b)*(x-c)*(x-d)";
29.32 +val t = ParseC.parse_test @{context} "(x-a)*(x-b)*(x-c)*(x-d)";
29.33 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.34 if UnparseC.term t =
29.35 ("a * b * c * d + - 1 * a * b * c * x + - 1 * a * b * d * x +\na * b * x \<up> 2 +\n" ^
29.36 @@ -444,32 +444,32 @@
29.37 (*associate poly*)
29.38
29.39 "-----SPB Schalk I p.63 No.291 ---";
29.40 -val t = TermC.parse_test @{context} "(5+96*x \<up> 3+8*x*(-4+(7- 3*x)*4*x))*(5*(2- 3*x)- (- 15*x*(-8*x- 5)))";
29.41 +val t = ParseC.parse_test @{context} "(5+96*x \<up> 3+8*x*(-4+(7- 3*x)*4*x))*(5*(2- 3*x)- (- 15*x*(-8*x- 5)))";
29.42 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.43 if UnparseC.term t = "50 + - 770 * x + 4520 * x \<up> 2 + - 16320 * x \<up> 3 +\n- 26880 * x \<up> 4"
29.44 then () else error "poly.sml: diff.behav. in make_polynomial 4";
29.45
29.46 "-----SPB Schalk I p.64 No.295c ---";
29.47 -val t = TermC.parse_test @{context} "(13*a \<up> 4*b \<up> 9*c - 12*a \<up> 3*b \<up> 6*c \<up> 9) \<up> 2";
29.48 +val t = ParseC.parse_test @{context} "(13*a \<up> 4*b \<up> 9*c - 12*a \<up> 3*b \<up> 6*c \<up> 9) \<up> 2";
29.49 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.50 if UnparseC.term t =
29.51 "169 * a \<up> 8 * b \<up> 18 * c \<up> 2 +\n- 312 * a \<up> 7 * b \<up> 15 * c \<up> 10 +\n144 * a \<up> 6 * b \<up> 12 * c \<up> 18"
29.52 then ()else error "poly.sml: diff.behav. in make_polynomial 5";
29.53
29.54 "-----SPB Schalk I p.64 No.299a ---";
29.55 -val t = TermC.parse_test @{context} "(x - y)*(x + y)";
29.56 +val t = ParseC.parse_test @{context} "(x - y)*(x + y)";
29.57 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.58 if UnparseC.term t = "x \<up> 2 + - 1 * y \<up> 2"
29.59 then () else error "poly.sml: diff.behav. in make_polynomial 6";
29.60
29.61 "-----SPB Schalk I p.64 No.300c ---";
29.62 -val t = TermC.parse_test @{context} "(3*x \<up> 2*y - 1)*(3*x \<up> 2*y + 1)";
29.63 +val t = ParseC.parse_test @{context} "(3*x \<up> 2*y - 1)*(3*x \<up> 2*y + 1)";
29.64 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.65 if UnparseC.term t = "- 1 + 9 * x \<up> 4 * y \<up> 2"
29.66 then () else error "poly.sml: diff.behav. in make_polynomial 7";
29.67
29.68 "-----SPB Schalk I p.64 No.302 ---";
29.69 -val t = TermC.parse_test @{context}
29.70 +val t = ParseC.parse_test @{context}
29.71 "(13*x \<up> 2 + 5)*(13*x \<up> 2 - 5) - (5*x \<up> 2 + 3)*(5*x \<up> 2 - 3) - (12*x \<up> 2 + 4)*(12*x \<up> 2 - 4)";
29.72 val SOME (t,_) = rewrite_set_ thy false make_polynomial t;
29.73 if UnparseC.term t = "0"
29.74 @@ -477,47 +477,47 @@
29.75 (* RL?MG?: Bei Berechnung sollte 3 mal real_plus_minus_binom1_p aus expand_poly verwendet werden *)
29.76
29.77 "-----SPB Schalk I p.64 No.306a ---";
29.78 -val t = TermC.parse_test @{context} "((x \<up> 2 + 1)*(x \<up> 2 - 1)) \<up> 2";
29.79 +val t = ParseC.parse_test @{context} "((x \<up> 2 + 1)*(x \<up> 2 - 1)) \<up> 2";
29.80 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.81 if UnparseC.term t = "1 + 2 * x \<up> 4 + 2 * - 2 * x \<up> 4 + x \<up> 8" then ()
29.82 else error "poly.sml: diff.behav. in 2 * x \<up> 4 + 2 * - 2 * x \<up> 4 = - 2 * x \<up> 4";
29.83
29.84 (*WN071729 when reducing "rls reduce_012_" for Schaerding,
29.85 the above resulted in the term below ... but reduces from then correctly*)
29.86 -val t = TermC.parse_test @{context} "1 + 2 * x \<up> 4 + 2 * - 2 * x \<up> 4 + x \<up> 8";
29.87 +val t = ParseC.parse_test @{context} "1 + 2 * x \<up> 4 + 2 * - 2 * x \<up> 4 + x \<up> 8";
29.88 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.89 if UnparseC.term t = "1 + - 2 * x \<up> 4 + x \<up> 8"
29.90 then () else error "poly.sml: diff.behav. in make_polynomial 9b";
29.91
29.92 "-----SPB Schalk I p.64 No.296a ---";
29.93 -val t = TermC.parse_test @{context} "(x - a) \<up> 3";
29.94 +val t = ParseC.parse_test @{context} "(x - a) \<up> 3";
29.95 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.96
29.97 -val NONE = eval_is_even "aaa" "bbb" (TermC.parse_test @{context} "3::real") "ccc";
29.98 +val NONE = eval_is_even "aaa" "bbb" (ParseC.parse_test @{context} "3::real") "ccc";
29.99
29.100 if UnparseC.term t = "- 1 * a \<up> 3 + 3 * a \<up> 2 * x + - 3 * a * x \<up> 2 + x \<up> 3"
29.101 then () else error "poly.sml: diff.behav. in make_polynomial 10";
29.102
29.103 "-----SPB Schalk I p.64 No.296c ---";
29.104 -val t = TermC.parse_test @{context} "(-3*x - 4*y) \<up> 3";
29.105 +val t = ParseC.parse_test @{context} "(-3*x - 4*y) \<up> 3";
29.106 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.107 if UnparseC.term t = "- 27 * x \<up> 3 + - 108 * x \<up> 2 * y + - 144 * x * y \<up> 2 +\n- 64 * y \<up> 3"
29.108 then () else error "poly.sml: diff.behav. in make_polynomial 11";
29.109
29.110 "-----SPB Schalk I p.62 No.242c ---";
29.111 -val t = TermC.parse_test @{context} "x \<up> (-4)*(x \<up> (-4)*y \<up> (- 2)) \<up> (- 1)*y \<up> (- 2)";
29.112 +val t = ParseC.parse_test @{context} "x \<up> (-4)*(x \<up> (-4)*y \<up> (- 2)) \<up> (- 1)*y \<up> (- 2)";
29.113 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.114 if UnparseC.term t = "1"
29.115 then () else error "poly.sml: diff.behav. in make_polynomial 12";
29.116
29.117 "-----SPB Schalk I p.60 No.209a ---";
29.118 -val t = TermC.parse_test @{context} "a \<up> (7-x) * a \<up> x";
29.119 +val t = ParseC.parse_test @{context} "a \<up> (7-x) * a \<up> x";
29.120 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.121 if UnparseC.term t = "a \<up> 7"
29.122 then () else error "poly.sml: diff.behav. in make_polynomial 13";
29.123
29.124 "-----SPB Schalk I p.60 No.209d ---";
29.125 -val t = TermC.parse_test @{context} "d \<up> x * d \<up> (x+1) * d \<up> (2 - 2*x)";
29.126 +val t = ParseC.parse_test @{context} "d \<up> x * d \<up> (x+1) * d \<up> (2 - 2*x)";
29.127 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.128 if UnparseC.term t = "d \<up> 3"
29.129 then () else error "poly.sml: diff.behav. in make_polynomial 14";
29.130 @@ -526,7 +526,7 @@
29.131 "-------- ?RL?Bsple bei denen es Probleme gibt--------------------------------------------------";
29.132 "-------- ?RL?Bsple bei denen es Probleme gibt--------------------------------------------------";
29.133 "-----Schalk I p.64 No.303 ---";
29.134 -val t = TermC.parse_test @{context} "(a + 2*b)*(a \<up> 2 + 4*b \<up> 2)*(a - 2*b) - (a - 6*b)*(a \<up> 2 + 36*b \<up> 2)*(a + 6*b)";
29.135 +val t = ParseC.parse_test @{context} "(a + 2*b)*(a \<up> 2 + 4*b \<up> 2)*(a - 2*b) - (a - 6*b)*(a \<up> 2 + 36*b \<up> 2)*(a + 6*b)";
29.136 (*SOMETIMES LOOPS---------------------------------------------------------------------------\\*)
29.137 val SOME (t, _) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.138 if UnparseC.term t = "1280 * b \<up> 4"
29.139 @@ -538,49 +538,49 @@
29.140 "-------- Eigene Beispiele (Mathias Goldgruber) ------------------------------------------------";
29.141 "-------- Eigene Beispiele (Mathias Goldgruber) ------------------------------------------------";
29.142 "-----SPO ---";
29.143 -val t = TermC.parse_test @{context} "a + a + a";
29.144 +val t = ParseC.parse_test @{context} "a + a + a";
29.145 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.146 if UnparseC.term t = "3 * a" then ()
29.147 else error "poly.sml: diff.behav. in make_polynomial 16";
29.148 "-----SPO ---";
29.149 -val t = TermC.parse_test @{context} "a + b + b + b";
29.150 +val t = ParseC.parse_test @{context} "a + b + b + b";
29.151 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.152 if UnparseC.term t = "a + 3 * b" then ()
29.153 else error "poly.sml: diff.behav. in make_polynomial 17";
29.154 "-----SPO ---";
29.155 -val t = TermC.parse_test @{context} "b * a * a";
29.156 +val t = ParseC.parse_test @{context} "b * a * a";
29.157 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.158 if UnparseC.term t = "a \<up> 2 * b" then ()
29.159 else error "poly.sml: diff.behav. in make_polynomial 21";
29.160 "-----SPO ---";
29.161 -val t = TermC.parse_test @{context} "(a \<up> 2) \<up> 3";
29.162 +val t = ParseC.parse_test @{context} "(a \<up> 2) \<up> 3";
29.163 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.164 if UnparseC.term t = "a \<up> 6" then ()
29.165 else error "poly.sml: diff.behav. in make_polynomial 22";
29.166 "-----SPO ---";
29.167 -val t = TermC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x * x \<up> 2 * y";
29.168 +val t = ParseC.parse_test @{context} "x \<up> 2 * y \<up> 2 + x * x \<up> 2 * y";
29.169 val SOME (t,_) = rewrite_set_ thy false make_polynomial t; UnparseC.term t;
29.170 if UnparseC.term t = "x \<up> 3 * y + x \<up> 2 * y \<up> 2" then ()
29.171 else error "poly.sml: diff.behav. in make_polynomial 23";
29.172 "-----SPO ---";
29.173 -val t = TermC.parse_test @{context} "a * b * b \<up> (- 1) + a";
29.174 +val t = ParseC.parse_test @{context} "a * b * b \<up> (- 1) + a";
29.175 val SOME (t,_) = rewrite_set_ @{context} false make_polynomial t; UnparseC.term t;
29.176 if UnparseC.term t = "2 * a" then ()
29.177 else error "poly.sml: diff.behav. in make_polynomial 25";
29.178 "-----SPO ---";
29.179 -val t = TermC.parse_test @{context} "a*c*b \<up> (2*n) + 3*a + 5*b \<up> (2*n)*c*b";
29.180 +val t = ParseC.parse_test @{context} "a*c*b \<up> (2*n) + 3*a + 5*b \<up> (2*n)*c*b";
29.181 val SOME (t,_) = rewrite_set_ @{context} false make_polynomial t; UnparseC.term t;
29.182 if UnparseC.term t = "3 * a + 5 * b \<up> (1 + 2 * n) * c + a * b \<up> (2 * n) * c"
29.183 then () else error "poly.sml: diff.behav. in make_polynomial 26";
29.184
29.185 (*MG030627 -------------vvv-: Verschachtelte Terme -----------*)
29.186 "-----SPO ---";
29.187 -val t = TermC.parse_test @{context} "(1 + (x*y*a) + x) \<up> (1 + (x*y*a) + x)";
29.188 +val t = ParseC.parse_test @{context} "(1 + (x*y*a) + x) \<up> (1 + (x*y*a) + x)";
29.189 val SOME (t,_) = rewrite_set_ @{context} false make_polynomial t;
29.190 if UnparseC.term t = "(1 + x + a * x * y) \<up> (1 + x + a * x * y)"
29.191 then () else error "poly.sml: diff.behav. in make_polynomial 27";(*SPO*)
29.192
29.193 -val t = TermC.parse_test @{context} "(1 + x*(y*z)*zz) \<up> (1 + x*(y*z)*zz)";
29.194 +val t = ParseC.parse_test @{context} "(1 + x*(y*z)*zz) \<up> (1 + x*(y*z)*zz)";
29.195 val SOME (t,_) = rewrite_set_ @{context} false make_polynomial t;
29.196 if UnparseC.term t = "(1 + x * y * z * zz) \<up> (1 + x * y * z * zz)"
29.197 then () else error "poly.sml: diff.behav. in make_polynomial 28";
29.198 @@ -611,7 +611,7 @@
29.199 (*default_print_depth 7;*)
29.200 val where_rls = (#where_rls o Problem.from_store @{context}) ["polynomial", "simplification"];
29.201 (*default_print_depth 3;*)
29.202 -val t = TermC.parse_test @{context} "((5*x \<up> 2 + 3) * (2*x \<up> 7 + 3) - (3*x \<up> 5 + 8) * (6*x \<up> 4 - 1)) is_polyexp";
29.203 +val t = ParseC.parse_test @{context} "((5*x \<up> 2 + 3) * (2*x \<up> 7 + 3) - (3*x \<up> 5 + 8) * (6*x \<up> 4 - 1)) is_polyexp";
29.204 val SOME (t',_) = rewrite_set_ thy false where_rls t;
29.205 if t' = @{term True} then ()
29.206 else error "poly.sml: diff.behav. in check pbl 'polynomial..";
29.207 @@ -690,14 +690,14 @@
29.208 "-------- ord_make_polynomial ------------------------------------------------------------------";
29.209 "-------- ord_make_polynomial ------------------------------------------------------------------";
29.210 "-------- ord_make_polynomial ------------------------------------------------------------------";
29.211 -val t1 = TermC.parse_test @{context} "2 * b + (3 * a + 3 * b)";
29.212 -val t2 = TermC.parse_test @{context} "(3 * a + 3 * b) + 2 * b";
29.213 +val t1 = ParseC.parse_test @{context} "2 * b + (3 * a + 3 * b)";
29.214 +val t2 = ParseC.parse_test @{context} "(3 * a + 3 * b) + 2 * b";
29.215
29.216 if ord_make_polynomial true @{context} [] (t1, t2) then ()
29.217 else error "poly.sml: diff.behav. in ord_make_polynomial";
29.218 (*SO: WHY IS THERE NO REWRITING ...*)
29.219
29.220 -val term = TermC.parse_test @{context} "2*b + (3*a + 3*b)";
29.221 +val term = ParseC.parse_test @{context} "2*b + (3*a + 3*b)";
29.222 (*+++*)val NONE = rewrite_set_ (Proof_Context.init_global @{theory "Isac_Knowledge"}) false order_add_mult term;
29.223 (*
29.224 WHY IS THERE NO REWRITING ?!?
30.1 --- a/test/Tools/isac/Knowledge/polyeq-1.sml Sun Jan 29 14:31:56 2023 +0100
30.2 +++ b/test/Tools/isac/Knowledge/polyeq-1.sml Mon Jan 30 09:47:18 2023 +0100
30.3 @@ -323,16 +323,16 @@
30.4
30.5 (** )end;( *local*)
30.6
30.7 -val subs = [(TermC.parse_test @{context} "bdv::real", TermC.parse_test @{context} "x::real")];
30.8 +val subs = [(ParseC.parse_test @{context} "bdv::real", ParseC.parse_test @{context} "x::real")];
30.9 if ord_make_polynomial_in false(*true*) @{theory} subs (t1, t2) then () else error "still GREATER?";
30.10
30.11 -val x = TermC.parse_test @{context} "x ::real";
30.12 +val x = ParseC.parse_test @{context} "x ::real";
30.13
30.14 -val t1 = TermC.numerals_to_Free (TermC.parse_test @{context} "L * q_0 * x \<up> 2 / 4 ::real");
30.15 +val t1 = TermC.numerals_to_Free (ParseC.parse_test @{context} "L * q_0 * x \<up> 2 / 4 ::real");
30.16 if 2006 = size_of_term' 1 false(*true*) x t1
30.17 then () else error "size_of_term' (L * q_0 * x \<up> 2) CHANGED)";
30.18
30.19 -val t2 = TermC.numerals_to_Free (TermC.parse_test @{context} "- 1 * (q_0 * x \<up> 3) :: real");
30.20 +val t2 = TermC.numerals_to_Free (ParseC.parse_test @{context} "- 1 * (q_0 * x \<up> 3) :: real");
30.21 if 3004 = size_of_term' 1 false(*true*) x t2
30.22 then () else error "size_of_term' (- 1 * (q_0 * x \<up> 3)) CHANGED";
30.23
31.1 --- a/test/Tools/isac/Knowledge/polyeq-2.sml Sun Jan 29 14:31:56 2023 +0100
31.2 +++ b/test/Tools/isac/Knowledge/polyeq-2.sml Mon Jan 30 09:47:18 2023 +0100
31.3 @@ -218,22 +218,22 @@
31.4 val ctxt = @{context};
31.5 (*Punkte aus dem TestBericht, die ich in rlang.sml nicht zuordnen konnte:*)
31.6 (*WN.19.3.03 ---v-*)
31.7 -(*3(b)*)val (bdv,v) = (TermC.parse_test @{context} "''bdv''", TermC.parse_test @{context} "R1");
31.8 -val t = TermC.parse_test @{context} "- 1 * (R * R2) + R2 * R1 + - 1 * (R * R1) = 0";
31.9 +(*3(b)*)val (bdv,v) = (ParseC.parse_test @{context} "''bdv''", ParseC.parse_test @{context} "R1");
31.10 +val t = ParseC.parse_test @{context} "- 1 * (R * R2) + R2 * R1 + - 1 * (R * R1) = 0";
31.11 val SOME (t',_) = rewrite_set_inst_ ctxt false [(bdv,v)] make_polynomial_in t;
31.12 if UnparseC.term t' = "- 1 * R * R2 + R2 * R1 + - 1 * R * R1 = 0" then ()
31.13 else error "make_polynomial_in (- 1 * (R * R2) + R2 * R1 + - 1 * (R * R1) = 0)";
31.14 "- 1 * R * R2 + (R2 + - 1 * R) * R1 = 0";
31.15 (*WN.19.3.03 ---^-*)
31.16
31.17 -(*3(c)*)val (bdv,v) = (TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "p");
31.18 -val t = TermC.parse_test @{context} "y \<up> 2 + - 2 * (x * p) = 0";
31.19 +(*3(c)*)val (bdv,v) = (ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "p");
31.20 +val t = ParseC.parse_test @{context} "y \<up> 2 + - 2 * (x * p) = 0";
31.21 val SOME (t',_) = rewrite_set_inst_ ctxt false [(bdv,v)] make_polynomial_in t;
31.22 if UnparseC.term t' = "y \<up> 2 + - 2 * x * p = 0" then ()
31.23 else error "make_polynomial_in (y \<up> 2 + - 2 * (x * p) = 0)";
31.24
31.25 -(*3(d)*)val (bdv,v) = (TermC.parse_test @{context} "''bdv''", TermC.parse_test @{context} "x2");
31.26 -val t = TermC.parse_test @{context}
31.27 +(*3(d)*)val (bdv,v) = (ParseC.parse_test @{context} "''bdv''", ParseC.parse_test @{context} "x2");
31.28 +val t = ParseC.parse_test @{context}
31.29 "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";
31.30 val SOME (t',_) = rewrite_set_inst_ ctxt false [(bdv,v)] make_polynomial_in t;
31.31 if UnparseC.term t' =
31.32 @@ -249,13 +249,13 @@
31.33 else error "make_ratpoly_in (A + x1 * (y3 * (1 / 2)) + x3 * (y2 * (1 / 2)) + - 1...";
31.34 "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";
31.35
31.36 -(*3(e)*)val (bdv,v) = (TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "a");
31.37 -val t = TermC.parse_test @{context}
31.38 +(*3(e)*)val (bdv,v) = (ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "a");
31.39 +val t = ParseC.parse_test @{context}
31.40 "A \<up> 2 + c \<up> 2 * (c / d) \<up> 2 + (-4 * (c / d) \<up> 2) * a \<up> 2 = 0";
31.41 val NONE = rewrite_set_inst_ ctxt false [(bdv,v)] make_polynomial_in t;
31.42 (* the invisible parentheses are as expected *)
31.43
31.44 -val t = TermC.parse_test @{context} "(x + 1) * (x + 2) - (3 * x - 2) \<up> 2 - ((2 * x - 1) \<up> 2 + (3 * x - 1) * (x + 1)) = 0";
31.45 +val t = ParseC.parse_test @{context} "(x + 1) * (x + 2) - (3 * x - 2) \<up> 2 - ((2 * x - 1) \<up> 2 + (3 * x - 1) * (x + 1)) = 0";
31.46 rewrite_set_ ctxt false expand_binoms t;
31.47
31.48
31.49 @@ -278,8 +278,8 @@
31.50 "----------- rls d2_polyeq_bdv_only_simplify ---------------------";
31.51 "----------- rls d2_polyeq_bdv_only_simplify ---------------------";
31.52 "----------- rls d2_polyeq_bdv_only_simplify ---------------------";
31.53 -val t = TermC.parse_test @{context} "-6 * x + 5 * x \<up> 2 = (0::real)";
31.54 -val subst = [(TermC.parse_test @{context} "(bdv::real)", TermC.parse_test @{context} "(x::real)")];
31.55 +val t = ParseC.parse_test @{context} "-6 * x + 5 * x \<up> 2 = (0::real)";
31.56 +val subst = [(ParseC.parse_test @{context} "(bdv::real)", ParseC.parse_test @{context} "(x::real)")];
31.57 val SOME (t''''', _) = rewrite_set_inst_ ctxt true subst d2_polyeq_bdv_only_simplify t;
31.58 (* steps in rls d2_polyeq_bdv_only_simplify:*)
31.59
32.1 --- a/test/Tools/isac/Knowledge/polyminus.sml Sun Jan 29 14:31:56 2023 +0100
32.2 +++ b/test/Tools/isac/Knowledge/polyminus.sml Mon Jan 30 09:47:18 2023 +0100
32.3 @@ -36,21 +36,21 @@
32.4 "----------- fun identifier --------------------------------------------------------------------";
32.5 "----------- fun identifier --------------------------------------------------------------------";
32.6 "----------- fun identifier --------------------------------------------------------------------";
32.7 -if identifier (TermC.parse_test @{context} "12 ::real") = "12" then () else error "identifier 1";
32.8 -if identifier (TermC.parse_test @{context}
32.9 +if identifier (ParseC.parse_test @{context} "12 ::real") = "12" then () else error "identifier 1";
32.10 +if identifier (ParseC.parse_test @{context}
32.11 "5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * g ::real") = "|||||||||||||"
32.12 then () else error "identifier 1a";
32.13
32.14 -if identifier (TermC.parse_test @{context} "a ::real") = "a" then () else error "identifier 2";
32.15 -if identifier (TermC.parse_test @{context} "3 * a ::real") = "a" then () else error "identifier 3";
32.16 +if identifier (ParseC.parse_test @{context} "a ::real") = "a" then () else error "identifier 2";
32.17 +if identifier (ParseC.parse_test @{context} "3 * a ::real") = "a" then () else error "identifier 3";
32.18
32.19 -if identifier (TermC.parse_test @{context} "a \<up> 2 ::real") = "a" then () else error "identifier 4";
32.20 -if identifier (TermC.parse_test @{context} "3*a \<up> 2 ::real") = "a" then () else error "identifier 5";
32.21 -if identifier (TermC.parse_test @{context} "a * b ::real") = "b" then () else error "identifier 5b";
32.22 +if identifier (ParseC.parse_test @{context} "a \<up> 2 ::real") = "a" then () else error "identifier 4";
32.23 +if identifier (ParseC.parse_test @{context} "3*a \<up> 2 ::real") = "a" then () else error "identifier 5";
32.24 +if identifier (ParseC.parse_test @{context} "a * b ::real") = "b" then () else error "identifier 5b";
32.25
32.26 (*these are strange (see "specific monomials" in comment to fun.def.)..*)
32.27 -if identifier (TermC.parse_test @{context} "a*b ::real") = "b" then () else error "identifier 6";
32.28 -if identifier (TermC.parse_test @{context} "(3*a*b) ::real") = "b" then () else error "identifier 7";
32.29 +if identifier (ParseC.parse_test @{context} "a*b ::real") = "b" then () else error "identifier 6";
32.30 +if identifier (ParseC.parse_test @{context} "(3*a*b) ::real") = "b" then () else error "identifier 7";
32.31
32.32
32.33 "----------- fun eval_kleiner, fun kleiner -----------------------------------------------------";
32.34 @@ -62,33 +62,33 @@
32.35 "12" < "3"; (*true !!!*)
32.36
32.37 " a kleiner b ==> (b + a) = (a + b)";
32.38 -TermC.parse_test @{context} "aaa";
32.39 -TermC.parse_test @{context} "222 * aaa";
32.40 +ParseC.parse_test @{context} "aaa";
32.41 +ParseC.parse_test @{context} "222 * aaa";
32.42
32.43 -case eval_kleiner 0 0 (TermC.parse_test @{context} "123 kleiner 32") 0 of
32.44 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "123 kleiner 32") 0 of
32.45 SOME ("123 kleiner 32 = False", _) => ()
32.46 | _ => error "polyminus.sml: 12 kleiner 9 = False";
32.47 -case eval_kleiner 0 0 (TermC.parse_test @{context} "a kleiner b") 0 of
32.48 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "a kleiner b") 0 of
32.49 SOME ("a kleiner b = True", _) => ()
32.50 | _ => error "polyminus.sml: a kleiner b = True";
32.51 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(10*g) kleiner f") 0 of
32.52 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(10*g) kleiner f") 0 of
32.53 SOME ("10 * g kleiner f = False", _) => ()
32.54 | _ => error "polyminus.sml: 10 * g kleiner f = False";
32.55 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(a \<up> 2) kleiner b") 0 of
32.56 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(a \<up> 2) kleiner b") 0 of
32.57 SOME ("a \<up> 2 kleiner b = True", _) => ()
32.58 | _ => error "polyminus.sml: a \<up> 2 kleiner b = True";
32.59 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(3*a \<up> 2) kleiner b") 0 of
32.60 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(3*a \<up> 2) kleiner b") 0 of
32.61 SOME ("3 * a \<up> 2 kleiner b = True", _) => ()
32.62 | _ => error "polyminus.sml: 3 * a \<up> 2 kleiner b = True";
32.63 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(a*b) kleiner c") 0 of
32.64 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(a*b) kleiner c") 0 of
32.65 SOME ("a * b kleiner c = True", _) => ()
32.66 | _ => error "polyminus.sml: a * b kleiner b = True";
32.67 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(3*a*b) kleiner c") 0 of
32.68 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(3*a*b) kleiner c") 0 of
32.69 SOME ("3 * a * b kleiner c = True", _) => ()
32.70 | _ => error "polyminus.sml: 3 * a * b kleiner b = True";
32.71
32.72
32.73 -val t = TermC.parse_test @{context} "12 kleiner 5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * (g::real)";
32.74 +val t = ParseC.parse_test @{context} "12 kleiner 5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * (g::real)";
32.75 val SOME ("12 kleiner 5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * g = True", _) =
32.76 eval_kleiner "aaa" "bbb" t "ccc";
32.77 "~~~~~ fun eval_kleiner , args:"; val (_, _, (p as (Const (\<^const_name>\<open>kleiner\<close>,_) $ a $ b)), _) =
32.78 @@ -106,61 +106,61 @@
32.79 "----------- fun ist_monom ---------------------------------------------------------------------";
32.80 "----------- fun ist_monom ---------------------------------------------------------------------";
32.81 "----------- fun ist_monom ---------------------------------------------------------------------";
32.82 -val t = TermC.parse_test @{context} "0 ::real";
32.83 +val t = ParseC.parse_test @{context} "0 ::real";
32.84 if ist_monom t then () else error "ist_monom 1";
32.85
32.86 -val t = TermC.parse_test @{context} "a";
32.87 +val t = ParseC.parse_test @{context} "a";
32.88 if ist_monom t then () else error "ist_monom 2";
32.89
32.90 -val t = TermC.parse_test @{context} "2 * a";
32.91 +val t = ParseC.parse_test @{context} "2 * a";
32.92 if ist_monom t then () else error "ist_monom 3";
32.93
32.94 -val t = TermC.parse_test @{context} "2 * a * b";
32.95 +val t = ParseC.parse_test @{context} "2 * a * b";
32.96 if ist_monom t then () else error "ist_monom 4";
32.97
32.98 -val t = TermC.parse_test @{context} "a * b";
32.99 +val t = ParseC.parse_test @{context} "a * b";
32.100 if ist_monom t then () else error "ist_monom 5";
32.101
32.102 (*not covered before NEW numerals*)
32.103 -val t = TermC.parse_test @{context} "2 * a \<up> 2 * b";
32.104 +val t = ParseC.parse_test @{context} "2 * a \<up> 2 * b";
32.105 if ist_monom t then () else error "ist_monom 6";
32.106
32.107 (*not covered before NEW numerals*)
32.108 -val t = TermC.parse_test @{context} "a \<up> 2 * b \<up> 3";
32.109 +val t = ParseC.parse_test @{context} "a \<up> 2 * b \<up> 3";
32.110 if ist_monom t then () else error "ist_monom 7";
32.111
32.112 -val t = TermC.parse_test @{context} "a \<up> 2 * 4 * b \<up> 3 * 5";
32.113 +val t = ParseC.parse_test @{context} "a \<up> 2 * 4 * b \<up> 3 * 5";
32.114 if ist_monom t then () else error "ist_monom 8";
32.115
32.116
32.117 "----------- fun eval_ist_monom ----------------------------------";
32.118 "----------- fun eval_ist_monom ----------------------------------";
32.119 "----------- fun eval_ist_monom ----------------------------------";
32.120 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "12 ist_monom") 0 of
32.121 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "12 ist_monom") 0 of
32.122 SOME ("12 ist_monom = True", _) => ()
32.123 | _ => error "polyminus.sml: 12 ist_monom = True";
32.124
32.125 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "a ist_monom") 0 of
32.126 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "a ist_monom") 0 of
32.127 SOME ("a ist_monom = True", _) => ()
32.128 | _ => error "polyminus.sml: a ist_monom = True";
32.129
32.130 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "(3*a) ist_monom") 0 of
32.131 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "(3*a) ist_monom") 0 of
32.132 SOME ("3 * a ist_monom = True", _) => ()
32.133 | _ => error "polyminus.sml: 3 * a ist_monom = True";
32.134
32.135 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "(a \<up> 2) ist_monom") 0 of
32.136 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "(a \<up> 2) ist_monom") 0 of
32.137 SOME ("a \<up> 2 ist_monom = True", _) => ()
32.138 | _ => error "polyminus.sml: a \<up> 2 ist_monom = True";
32.139
32.140 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "(3*a \<up> 2) ist_monom") 0 of
32.141 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "(3*a \<up> 2) ist_monom") 0 of
32.142 SOME ("3 * a \<up> 2 ist_monom = True", _) => ()
32.143 | _ => error "polyminus.sml: 3*a \<up> 2 ist_monom = True";
32.144
32.145 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "(a*b) ist_monom") 0 of
32.146 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "(a*b) ist_monom") 0 of
32.147 SOME ("a * b ist_monom = True", _) => ()
32.148 | _ => error "polyminus.sml: a*b ist_monom = True";
32.149
32.150 -case eval_ist_monom 0 0 (TermC.parse_test @{context} "(3*a*b) ist_monom") 0 of
32.151 +case eval_ist_monom 0 0 (ParseC.parse_test @{context} "(3*a*b) ist_monom") 0 of
32.152 SOME ("3 * a * b ist_monom = True", _) => ()
32.153 | _ => error "polyminus.sml: 3*a*b ist_monom = True";
32.154
32.155 @@ -170,14 +170,14 @@
32.156 "----------- watch order_add_mult -------------------------------";
32.157 "----- with these simple variables it works...";
32.158 val ctxt = @{context};
32.159 -val t = TermC.parse_test ctxt "((a + d) + c) + b";
32.160 +val t = ParseC.parse_test ctxt "((a + d) + c) + b";
32.161 val SOME (t,_) = rewrite_set_ ctxt false order_add_mult t; UnparseC.term t;
32.162 if UnparseC.term t = "a + (b + (c + d))" then ()
32.163 else error "polyminus.sml 1 watch order_add_mult";
32.164
32.165 "----- the same stepwise...";
32.166 val od = ord_make_polynomial true
32.167 -val t = TermC.parse_test @{context} "((a + d) + c) + b";
32.168 +val t = ParseC.parse_test @{context} "((a + d) + c) + b";
32.169 "((a + d) + c) + b";
32.170 val SOME (t,_) = rewrite_ ctxt od Rule_Set.empty true @{thm add.commute} t; UnparseC.term t;
32.171 "b + ((a + d) + c)";
32.172 @@ -191,7 +191,7 @@
32.173 else error "polyminus.sml 2 watch order_add_mult";
32.174
32.175 "----- if parentheses are right, left_commute is (almost) sufficient...";
32.176 -val t = TermC.parse_test @{context} "a + (d + (c + b))";
32.177 +val t = ParseC.parse_test @{context} "a + (d + (c + b))";
32.178 "a + (d + (c + b))";
32.179 val SOME (t,_) = rewrite_ ctxt od Rule_Set.empty true @{thm add.left_commute} t;UnparseC.term t;
32.180 "a + (c + (d + b))";
32.181 @@ -202,14 +202,14 @@
32.182
32.183 "----- but we do not want the parentheses at right; thus: cond.rew.";
32.184 "WN0712707 complicated monomials do not yet work ...";
32.185 -val t = TermC.parse_test @{context} "((5*a + 4*d) + 3*c) + 2*b";
32.186 +val t = ParseC.parse_test @{context} "((5*a + 4*d) + 3*c) + 2*b";
32.187 val SOME (t,_) = rewrite_set_ ctxt false order_add_mult t; UnparseC.term t;
32.188 if UnparseC.term t = "2 * b + (3 * c + (4 * d + 5 * a))" then ()
32.189 else error "polyminus.sml: order_add_mult changed";
32.190
32.191 "----- here we see rew_sub going into subterm with ord.rew....";
32.192 val od = ord_make_polynomial false;
32.193 -val t = TermC.parse_test @{context} "b + a + c + d";
32.194 +val t = ParseC.parse_test @{context} "b + a + c + d";
32.195 val SOME (t,_) = rewrite_ ctxt od Rule_Set.empty false @{thm add.commute} t; UnparseC.term t;
32.196 val SOME (t,_) = rewrite_ ctxt od Rule_Set.empty false @{thm add.commute} t; UnparseC.term t;
32.197 (*@@@ rew_sub gosub: t = d + (b + a + c)
32.198 @@ -225,34 +225,34 @@
32.199 "12" < "3"; (*true !!!*)
32.200
32.201 " a kleiner b ==> (b + a) = (a + b)";
32.202 -TermC.parse_test @{context} "aaa";
32.203 -TermC.parse_test @{context} "222 * aaa";
32.204 +ParseC.parse_test @{context} "aaa";
32.205 +ParseC.parse_test @{context} "222 * aaa";
32.206
32.207 -case eval_kleiner 0 0 (TermC.parse_test @{context} "123 kleiner 32") 0 of
32.208 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "123 kleiner 32") 0 of
32.209 SOME ("123 kleiner 32 = False", _) => ()
32.210 | _ => error "polyminus.sml: 12 kleiner 9 = False";
32.211
32.212 -case eval_kleiner 0 0 (TermC.parse_test @{context} "a kleiner b") 0 of
32.213 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "a kleiner b") 0 of
32.214 SOME ("a kleiner b = True", _) => ()
32.215 | _ => error "polyminus.sml: a kleiner b = True";
32.216
32.217 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(10*g) kleiner f") 0 of
32.218 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(10*g) kleiner f") 0 of
32.219 SOME ("10 * g kleiner f = False", _) => ()
32.220 | _ => error "polyminus.sml: 10 * g kleiner f = False";
32.221
32.222 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(a \<up> 2) kleiner b") 0 of
32.223 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(a \<up> 2) kleiner b") 0 of
32.224 SOME ("a \<up> 2 kleiner b = True", _) => ()
32.225 | _ => error "polyminus.sml: a \<up> 2 kleiner b = True";
32.226
32.227 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(3*a \<up> 2) kleiner b") 0 of
32.228 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(3*a \<up> 2) kleiner b") 0 of
32.229 SOME ("3 * a \<up> 2 kleiner b = True", _) => ()
32.230 | _ => error "polyminus.sml: 3 * a \<up> 2 kleiner b = True";
32.231
32.232 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(a*b) kleiner c") 0 of
32.233 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(a*b) kleiner c") 0 of
32.234 SOME ("a * b kleiner c = True", _) => ()
32.235 | _ => error "polyminus.sml: a * b kleiner b = True";
32.236
32.237 -case eval_kleiner 0 0 (TermC.parse_test @{context} "(3*a*b) kleiner c") 0 of
32.238 +case eval_kleiner 0 0 (ParseC.parse_test @{context} "(3*a*b) kleiner c") 0 of
32.239 SOME ("3 * a * b kleiner c = True", _) => ()
32.240 | _ => error "polyminus.sml: 3 * a * b kleiner b = True";
32.241
32.242 @@ -260,52 +260,52 @@
32.243 val od = Rewrite_Ord.function_empty;
32.244
32.245 val asm_rls = erls_ordne_alphabetisch;
32.246 -val t = TermC.parse_test @{context} "b + a";
32.247 +val t = ParseC.parse_test @{context} "b + a";
32.248 val SOME (t,_) = rewrite_ ctxt od asm_rls false @{thm tausche_plus} t; UnparseC.term t;
32.249 if UnparseC.term t = "a + b" then ()
32.250 else error "polyminus.sml: ordne_alphabetisch1 b + a";
32.251
32.252 val asm_rls = Atools_erls;
32.253 -val t = TermC.parse_test @{context} "2*a + 3*a";
32.254 +val t = ParseC.parse_test @{context} "2*a + 3*a";
32.255 val SOME (t,_) = rewrite_ ctxt od asm_rls false @{thm real_num_collect} t; UnparseC.term t;
32.256
32.257 "======= test rewrite_, rewrite_set_";
32.258 (*Rewrite.trace_on := true; ..stopped Test_Isac.thy*)
32.259 val asm_rls = erls_ordne_alphabetisch;
32.260 -val t = TermC.parse_test @{context} "b + a";
32.261 +val t = ParseC.parse_test @{context} "b + a";
32.262 val SOME (t,_) = rewrite_set_ ctxt false ordne_alphabetisch t; UnparseC.term t;
32.263 if UnparseC.term t = "a + b" then ()
32.264 else error "polyminus.sml: ordne_alphabetisch a + b";
32.265
32.266 -val t = TermC.parse_test @{context} "2*b + a";
32.267 +val t = ParseC.parse_test @{context} "2*b + a";
32.268 val SOME (t,_) = rewrite_set_ ctxt false ordne_alphabetisch t; UnparseC.term t;
32.269 if UnparseC.term t = "a + 2 * b" then ()
32.270 else error "polyminus.sml: ordne_alphabetisch a + 2 * b";
32.271
32.272 -val t = TermC.parse_test @{context} "a + c + b";
32.273 +val t = ParseC.parse_test @{context} "a + c + b";
32.274 val SOME (t,_) = rewrite_set_ ctxt false ordne_alphabetisch t; UnparseC.term t;
32.275 if UnparseC.term t = "a + b + c" then ()
32.276 else error "polyminus.sml: ordne_alphabetisch a + b + c";
32.277
32.278 "======= rewrite goes into subterms";
32.279 -val t = TermC.parse_test @{context} "a + c + b + d ::real";
32.280 +val t = ParseC.parse_test @{context} "a + c + b + d ::real";
32.281 val SOME (t,_) = rewrite_ ctxt od asm_rls false @{thm tausche_plus_plus} t; UnparseC.term t;
32.282 if UnparseC.term t = "a + b + c + d" then ()
32.283 else error "polyminus.sml: ordne_alphabetisch1 a + b + c + d";
32.284
32.285 -val t = TermC.parse_test @{context} "a + c + d + b";
32.286 +val t = ParseC.parse_test @{context} "a + c + d + b";
32.287 val SOME (t,_) = rewrite_set_ ctxt false ordne_alphabetisch t; UnparseC.term t;
32.288 if UnparseC.term t = "a + b + c + d" then ()
32.289 else error "polyminus.sml: ordne_alphabetisch2 a + b + c + d";
32.290
32.291 "======= here we see rew_sub going into subterm with cond.rew....";
32.292 -val t = TermC.parse_test @{context} "b + a + c + d";
32.293 +val t = ParseC.parse_test @{context} "b + a + c + d";
32.294 val SOME (t,_) = rewrite_ ctxt od asm_rls false @{thm tausche_plus} t; UnparseC.term t;
32.295 if UnparseC.term t = "a + b + c + d" then ()
32.296 else error "polyminus.sml: ordne_alphabetisch3 a + b + c + d";
32.297
32.298 "======= compile rls for the most complicated terms";
32.299 -val t = TermC.parse_test @{context} "5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12";
32.300 +val t = ParseC.parse_test @{context} "5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12";
32.301 "5 * e + 6 * f - 8 * g - 9 - 7 * e - 4 * f + 10 * g + 12";
32.302 val SOME (t,_) = rewrite_set_ ctxt false ordne_alphabetisch t;
32.303 if UnparseC.term t = "- 9 + 12 + 5 * e - 7 * e + 6 * f - 4 * f - 8 * g + 10 * g"
32.304 @@ -316,7 +316,7 @@
32.305 "----------- build fasse_zusammen --------------------------------";
32.306 "----------- build fasse_zusammen --------------------------------";
32.307 "----------- build fasse_zusammen --------------------------------";
32.308 -val t = TermC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + 6 * f - 4 * f - 8 * g + 10 * g";
32.309 +val t = ParseC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + 6 * f - 4 * f - 8 * g + 10 * g";
32.310 val SOME (t,_) = rewrite_set_ ctxt false fasse_zusammen t;
32.311 if UnparseC.term t = "3 + - 2 * e + 2 * f + 2 * g" then ()
32.312 else error "polyminus.sml: fasse_zusammen finished";
32.313 @@ -324,7 +324,7 @@
32.314 "----------- build verschoenere ----------------------------------";
32.315 "----------- build verschoenere ----------------------------------";
32.316 "----------- build verschoenere ----------------------------------";
32.317 -val t = TermC.parse_test @{context} "3 + - 2 * e + 2 * f + 2 * g";
32.318 +val t = ParseC.parse_test @{context} "3 + - 2 * e + 2 * f + 2 * g";
32.319 val SOME (t,_) = rewrite_set_ ctxt false verschoenere t;
32.320 if UnparseC.term t = "3 - 2 * e + 2 * f + 2 * g" then ()
32.321 else error "polyminus.sml: verschoenere 3 + - 2 * e ...";
32.322 @@ -524,16 +524,16 @@
32.323 "----- 2 \<up> ";
32.324 (*Rewrite.trace_on := true; ..stopped Test_Isac.thy*)
32.325 val asm_rls = erls_ordne_alphabetisch;
32.326 -val t = TermC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
32.327 +val t = ParseC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
32.328 val SOME (t',_) =
32.329 rewrite_ ctxt Rewrite_Ord.function_empty asm_rls false @{thm tausche_minus} t;
32.330 UnparseC.term t'; "- 9 + 12 + 5 * e - 7 * e + (- 4 + 6) * f - 8 * g + 10 * g";
32.331
32.332 -val t = TermC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
32.333 +val t = ParseC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
32.334 val NONE =
32.335 rewrite_ ctxt Rewrite_Ord.function_empty asm_rls false @{thm tausche_minus_plus} t;
32.336
32.337 -val t = TermC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
32.338 +val t = ParseC.parse_test @{context} "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
32.339 val SOME (t',_) =
32.340 rewrite_set_ ctxt false ordne_alphabetisch t;
32.341 UnparseC.term t'; "- 9 + 12 + 5 * e - 7 * e - 8 * g + 10 * g + (- 4 + 6) * f";
32.342 @@ -598,7 +598,7 @@
32.343 "----------- pbl binom polynom vereinfachen p.39 -----------------";
32.344 val thy = @{theory};
32.345 val rls = klammern_ausmultiplizieren;
32.346 -val t = TermC.parse_test @{context} "(3 * a + 2) * (4 * a - 1::real)";
32.347 +val t = ParseC.parse_test @{context} "(3 * a + 2) * (4 * a - 1::real)";
32.348 val SOME (t,_) = rewrite_set_ ctxt false rls t; UnparseC.term t;
32.349 "3 * a * (4 * a) - 3 * a * 1 + (2 * (4 * a) - 2 * 1)";
32.350 val rls = discard_parentheses;
32.351 @@ -608,7 +608,7 @@
32.352 val SOME (t,_) = rewrite_set_ ctxt false rls t; UnparseC.term t;
32.353 "3 * 4 * a * a - 1 * 3 * a + (2 * 4 * a - 1 * 2)";
32.354 (*
32.355 -val t = TermC.parse_test @{context} "3 * a * 4 * a";
32.356 +val t = ParseC.parse_test @{context} "3 * a * 4 * a";
32.357 val rls = ordne_monome;
32.358 val SOME (t,_) = rewrite_set_ ctxt false rls t; UnparseC.term t;
32.359 *)
32.360 @@ -664,7 +664,7 @@
32.361
32.362 "----- go into details, if it seems not to work -----";
32.363 "--- does the predicate evaluate correctly ?";
32.364 -val t = TermC.parse_patt_test @{theory}
32.365 +val t = ParseC.parse_patt_test @{theory}
32.366 "matchsub (?a * (?b - ?c)) (8 * (a - q) + a - 2 * q + 3 * (a - 2 * (q::real)))";
32.367 val ma = eval_matchsub "" "Prog_Expr.matchsub" t ctxt;
32.368 case ma of
32.369 @@ -688,7 +688,7 @@
32.370 val SOME (t', _) = rewrite_set_ ctxt false where_rls t;
32.371
32.372 "--- does the respective where_rls rewrite the whole predicate ?";
32.373 -val t = TermC.parse_patt_test @{theory}
32.374 +val t = ParseC.parse_patt_test @{theory}
32.375 "Not (matchsub (?a * (?b + ?c)) (8 * (a - q) + a - 2 * q) | \
32.376 \ matchsub (?a * (?b - ?c)) (8 * (a - q) + a - 2 * q) | \
32.377 \ matchsub ((?b + ?c) * ?a) (8 * (a - q) + a - 2 * q) | \
33.1 --- a/test/Tools/isac/Knowledge/rateq.sml Sun Jan 29 14:31:56 2023 +0100
33.2 +++ b/test/Tools/isac/Knowledge/rateq.sml Mon Jan 30 09:47:18 2023 +0100
33.3 @@ -160,7 +160,7 @@
33.4 val Applicable.Yes (Check_elementwise' (curr_form, pred, (res, asms))) = check p''''' pt''''' m''''';
33.5 UnparseC.term curr_form = "[x = 1 / 5]";
33.6 pred = "Assumptions";
33.7 -res = TermC.parse_test @{context} "[]::bool list";
33.8 +res = ParseC.parse_test @{context} "[]::bool list";
33.9 asms = [];
33.10
33.11 val (p,_,f,nxt,_,pt) = me nxt''' p''' [] pt'''; (*<<<----- this caused the error*)
34.1 --- a/test/Tools/isac/Knowledge/rational-1.sml Sun Jan 29 14:31:56 2023 +0100
34.2 +++ b/test/Tools/isac/Knowledge/rational-1.sml Mon Jan 30 09:47:18 2023 +0100
34.3 @@ -24,26 +24,26 @@
34.4 "-------- fun poly_of_term ---------------------------------------------------------------------";
34.5 "-------- fun poly_of_term ---------------------------------------------------------------------";
34.6 val thy = @{theory Isac_Knowledge};
34.7 -val vs = TermC.vars_of (TermC.parse_test @{context} "12 * x \<up> 3 * y \<up> 4 * z \<up> 6");
34.8 +val vs = TermC.vars_of (ParseC.parse_test @{context} "12 * x \<up> 3 * y \<up> 4 * z \<up> 6");
34.9
34.10 -val t = TermC.parse_test @{context} "0 ::real";
34.11 +val t = ParseC.parse_test @{context} "0 ::real";
34.12 if poly_of_term vs t = SOME [(0, [0, 0, 0])]
34.13 then () else error "poly_of_term 0 changed";
34.14
34.15 -val t = TermC.parse_test @{context} "-3 + - 2 * x ::real";
34.16 +val t = ParseC.parse_test @{context} "-3 + - 2 * x ::real";
34.17 if poly_of_term vs t = SOME [(~3, [0, 0, 0]), (~2, [1, 0, 0])]
34.18 then () else error "poly_of_term uminus changed";
34.19
34.20 -if poly_of_term vs (TermC.parse_test @{context} "12::real") = SOME [(12, [0, 0, 0])]
34.21 +if poly_of_term vs (ParseC.parse_test @{context} "12::real") = SOME [(12, [0, 0, 0])]
34.22 then () else error "poly_of_term 1 changed";
34.23
34.24 -if poly_of_term vs (TermC.parse_test @{context} "x::real") = SOME [(1, [1, 0, 0])]
34.25 +if poly_of_term vs (ParseC.parse_test @{context} "x::real") = SOME [(1, [1, 0, 0])]
34.26 then () else error "poly_of_term 2 changed";
34.27
34.28 -if poly_of_term vs (TermC.parse_test @{context} "12 * x \<up> 3") = SOME [(12, [3, 0, 0])]
34.29 +if poly_of_term vs (ParseC.parse_test @{context} "12 * x \<up> 3") = SOME [(12, [3, 0, 0])]
34.30 then () else error "poly_of_term 3 changed";
34.31 "~~~~~ fun poly_of_term , args:"; val (vs, t) =
34.32 - (vs, (TermC.parse_test @{context} "12 * x \<up> 3"));
34.33 + (vs, (ParseC.parse_test @{context} "12 * x \<up> 3"));
34.34
34.35 monom_of_term vs (1, replicate (length vs) 0) t;(*poly malformed 1 with x \<up> 3*)
34.36 "~~~~~ fun monom_of_term , args:"; val (vs, (c, es), (Const (\<^const_name>\<open>times\<close>, _) $ m1 $ m2)) =
34.37 @@ -59,30 +59,30 @@
34.38 if (c, num |> HOLogic.dest_numeral |> list_update es (find_index (curry op = t) vs)) = (12, [3, 0, 0])
34.39 then () else error "monom_of_term (realpow): return value CHANGED";
34.40
34.41 -if poly_of_term vs (TermC.parse_test @{context} "12 * x \<up> 3 * y \<up> 4 * z \<up> 6") = SOME [(12, [3, 4, 6])]
34.42 +if poly_of_term vs (ParseC.parse_test @{context} "12 * x \<up> 3 * y \<up> 4 * z \<up> 6") = SOME [(12, [3, 4, 6])]
34.43 then () else error "poly_of_term 4 changed";
34.44
34.45 -if poly_of_term vs (TermC.parse_test @{context} "1 + 2 * x \<up> 3 * y \<up> 4 * z \<up> 6 + y") =
34.46 +if poly_of_term vs (ParseC.parse_test @{context} "1 + 2 * x \<up> 3 * y \<up> 4 * z \<up> 6 + y") =
34.47 SOME [(1, [0, 0, 0]), (1, [0, 1, 0]), (2, [3, 4, 6])]
34.48 then () else error "poly_of_term 5 changed";
34.49
34.50 (*poly_of_term is quite liberal:*)
34.51 (*the coefficient may be somewhere, the order of variables and the parentheses
34.52 within a monomial are arbitrary*)
34.53 -if poly_of_term vs (TermC.parse_test @{context} "y \<up> 4 * (x \<up> 3 * 12 * z \<up> 6)") = SOME [(12, [3, 4, 6])]
34.54 +if poly_of_term vs (ParseC.parse_test @{context} "y \<up> 4 * (x \<up> 3 * 12 * z \<up> 6)") = SOME [(12, [3, 4, 6])]
34.55 then () else error "poly_of_term 6 changed";
34.56
34.57 (*there may even be more than 1 coefficient:*)
34.58 -if poly_of_term vs (TermC.parse_test @{context} "2 * y \<up> 4 * (x \<up> 3 * 6 * z \<up> 6)") = SOME [(12, [3, 4, 6])]
34.59 +if poly_of_term vs (ParseC.parse_test @{context} "2 * y \<up> 4 * (x \<up> 3 * 6 * z \<up> 6)") = SOME [(12, [3, 4, 6])]
34.60 then () else error "poly_of_term 7 changed";
34.61
34.62 (*the order and the parentheses within monomials are arbitrary:*)
34.63 -if poly_of_term vs (TermC.parse_test @{context} "2 * x \<up> 3 * y \<up> 4 * z \<up> 6 + (7 * y \<up> 8 + 1)")
34.64 +if poly_of_term vs (ParseC.parse_test @{context} "2 * x \<up> 3 * y \<up> 4 * z \<up> 6 + (7 * y \<up> 8 + 1)")
34.65 = SOME [(1, [0, 0, 0]), (7, [0, 8, 0]), (2, [3, 4, 6])]
34.66 then () else error "poly_of_term 8 changed";
34.67
34.68 (*from --- rls norm_Rational downto fun gcd_poly ---*)
34.69 -val t = TermC.parse_test @{context} (*copy from above: "::real" is not required due to " \<up> "*)
34.70 +val t = ParseC.parse_test @{context} (*copy from above: "::real" is not required due to " \<up> "*)
34.71 ("(- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /" ^
34.72 "(- 18 + -9 * x + 2 * y \<up> 2 + x * y \<up> 2)");
34.73 "~~~~~ fun cancel_p_, args:"; val (t) = (t);
34.74 @@ -99,9 +99,9 @@
34.75 "-------- fun is_poly --------------------------------------------------------------------------";
34.76 "-------- fun is_poly --------------------------------------------------------------------------";
34.77 "-------- fun is_poly --------------------------------------------------------------------------";
34.78 -if is_poly (TermC.parse_test @{context} "2 * x \<up> 3 * y \<up> 4 * z \<up> 6 + 7 * y \<up> 8 + 1")
34.79 +if is_poly (ParseC.parse_test @{context} "2 * x \<up> 3 * y \<up> 4 * z \<up> 6 + 7 * y \<up> 8 + 1")
34.80 then () else error "is_poly 1 changed";
34.81 -if not (is_poly (TermC.parse_test @{context} "2 * (x \<up> 3 * y \<up> 4 * z \<up> 6 + 7) * y \<up> 8 + 1"))
34.82 +if not (is_poly (ParseC.parse_test @{context} "2 * (x \<up> 3 * y \<up> 4 * z \<up> 6 + 7) * y \<up> 8 + 1"))
34.83 then () else error "is_poly 2 changed";
34.84
34.85 "-------- fun is_ratpolyexp --------------------------------------------------------------------";
34.86 @@ -122,7 +122,7 @@
34.87 "-------- fun term_of_poly ---------------------------------------------------------------------";
34.88 "-------- fun term_of_poly ---------------------------------------------------------------------";
34.89 val expT = HOLogic.realT
34.90 -val Free (_, baseT) = (hd o vars o TermC.parse_test @{context}) "12 * x \<up> 3 * y \<up> 4 * z \<up> 6";
34.91 +val Free (_, baseT) = (hd o vars o ParseC.parse_test @{context}) "12 * x \<up> 3 * y \<up> 4 * z \<up> 6";
34.92 val p = [(1, [0, 0, 0]), (7, [0, 8, 0]), (2, [3, 4, 5])]
34.93 val vs = TermC.vars_of (the (parseNEW ctxt "12 * x \<up> 3 * y \<up> 4 * z \<up> 6"))
34.94 (*precondition for [(c, es),...]: legth es = length vs*)
34.95 @@ -137,7 +137,7 @@
34.96 val ctxt = Proof_Context.init_global thy
34.97
34.98 (*------- standard case: *)
34.99 -val t = TermC.parse_test @{context} "2 / 3 + 1 / 6 ::real";
34.100 +val t = ParseC.parse_test @{context} "2 / 3 + 1 / 6 ::real";
34.101 "~~~~~ fun add_fraction_p_ , args:"; val ((_: theory), t) = (thy, t);
34.102 val SOME ((n1, d1), (n2, d2)) =
34.103 (*case*) check_frac_sum t (*of*);
34.104 @@ -175,7 +175,7 @@
34.105
34.106 (*------- 0 / m + 0 / n
34.107 20 years old bug found here: *)
34.108 -val t = TermC.parse_test @{context} "0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 \<up> 3 + - 1 * q_0 / 24 * 0 \<up> 4)";
34.109 +val t = ParseC.parse_test @{context} "0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 \<up> 3 + - 1 * q_0 / 24 * 0 \<up> 4)";
34.110 val SOME (t', _) = rewrite_set_ ctxt true norm_Rational t;
34.111 (*
34.112 :
34.113 @@ -195,7 +195,7 @@
34.114 *)
34.115 if UnparseC.term t' = "0 = c_2" then () else error "norm_Rational CHANGED"; (*isa2*)
34.116
34.117 -val t = TermC.parse_test @{context} "0 / 12 + 0 / 24 ::real";
34.118 +val t = ParseC.parse_test @{context} "0 / 12 + 0 / 24 ::real";
34.119 add_fraction_p_ @{theory} t;
34.120 "~~~~~ fun add_fraction_p_ , args:"; val ((_: theory), t) = (thy, t);
34.121 val SOME ((n1, d1), (n2, d2)) =
34.122 @@ -268,16 +268,16 @@
34.123 "-------- complex examples: rls norm_Rational --------------------------------------------------";
34.124 "-------- complex examples: rls norm_Rational --------------------------------------------------";
34.125 "-------- complex examples: rls norm_Rational --------------------------------------------------";
34.126 -val t = TermC.parse_test @{context} "(3*x+5)/18 - x/2 - -(3*x - 2)/9 = 0";
34.127 +val t = ParseC.parse_test @{context} "(3*x+5)/18 - x/2 - -(3*x - 2)/9 = 0";
34.128 val SOME (t', _) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
34.129 if UnparseC.term t' = "1 / 18 = 0" then () else error "rational.sml 1";
34.130
34.131 -val t = TermC.parse_test @{context} "(17*x - 51)/9 - (-(13*x - 3)/6) + 11 - (9*x - 7)/4 = 0";
34.132 +val t = ParseC.parse_test @{context} "(17*x - 51)/9 - (-(13*x - 3)/6) + 11 - (9*x - 7)/4 = 0";
34.133 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
34.134 if UnparseC.term t' = "(237 + 65 * x) / 36 = 0" then ()
34.135 else error "rational.sml 2";
34.136
34.137 -val t = TermC.parse_test @{context} "(1/2 + (5*x)/2) \<up> 2 - ((13*x)/2 - 5/2) \<up> 2 - (6*x) \<up> 2 + 29";
34.138 +val t = ParseC.parse_test @{context} "(1/2 + (5*x)/2) \<up> 2 - ((13*x)/2 - 5/2) \<up> 2 - (6*x) \<up> 2 + 29";
34.139 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
34.140 if UnparseC.term t' = "23 + 35 * x + - 72 * x \<up> 2" then ()
34.141 else error "rational.sml 3";
34.142 @@ -286,20 +286,20 @@
34.143 "-------- complex examples cancellation from: Mathematik 1 Schalk ------------------------------";
34.144 "-------- complex examples cancellation from: Mathematik 1 Schalk ------------------------------";
34.145 (*Schalk I, p.60 Nr. 215c *)
34.146 -val t = TermC.parse_test @{context} "(a + b) \<up> 4 * (x - y) / ((x - y) \<up> 3 * (a + b) \<up> 2)";
34.147 +val t = ParseC.parse_test @{context} "(a + b) \<up> 4 * (x - y) / ((x - y) \<up> 3 * (a + b) \<up> 2)";
34.148 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
34.149 if UnparseC.term t = "(a \<up> 2 + 2 * a * b + b \<up> 2) / (x \<up> 2 + - 2 * x * y + y \<up> 2)"
34.150 then () else error "rational.sml: diff.behav. in norm_Rational_mg 7";
34.151
34.152 (*SRC Schalk I, p.66 Nr. 381b *)
34.153 -val t = TermC.parse_test @{context}
34.154 +val t = ParseC.parse_test @{context}
34.155 "(4*x \<up> 2 - 20*x + 25)/(2*x - 5) \<up> 3";
34.156 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
34.157 if UnparseC.term t = "1 / (- 5 + 2 * x)"
34.158 then () else error "rational.sml: diff.behav. in norm_Rational_mg 9";
34.159
34.160 (*Schalk I, p.60 Nr. 215c *)
34.161 -val t = TermC.parse_test @{context} "(a + b) \<up> 4 * (x - y) / ((x - y) \<up> 3 * (a + b) \<up> 2)";
34.162 +val t = ParseC.parse_test @{context} "(a + b) \<up> 4 * (x - y) / ((x - y) \<up> 3 * (a + b) \<up> 2)";
34.163 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
34.164 if UnparseC.term t = "(a \<up> 2 + 2 * a * b + b \<up> 2) / (x \<up> 2 + - 2 * x * y + y \<up> 2)"
34.165 then () else error "Schalk I, p.60 Nr. 215c: with Isabelle2002 cancellation incomplete, changed";
35.1 --- a/test/Tools/isac/Knowledge/rational-2.sml Sun Jan 29 14:31:56 2023 +0100
35.2 +++ b/test/Tools/isac/Knowledge/rational-2.sml Mon Jan 30 09:47:18 2023 +0100
35.3 @@ -44,7 +44,7 @@
35.4 "-------- integration lev.1 fun factout_p_ -----------------------------------";
35.5 "-------- integration lev.1 fun factout_p_ -----------------------------------";
35.6 "-------- integration lev.1 fun factout_p_ -----------------------------------";
35.7 -val t = TermC.parse_test @{context} "(x \<up> 2 + - 1*y \<up> 2) / (x \<up> 2 + - 1*x*y)"
35.8 +val t = ParseC.parse_test @{context} "(x \<up> 2 + - 1*y \<up> 2) / (x \<up> 2 + - 1*x*y)"
35.9 val SOME (t', asm) = factout_p_ thy t;
35.10 if UnparseC.term t' = "(x + y) * (x + - 1 * y) / (x * (x + - 1 * y))"
35.11 then () else error ("factout_p_ term 1 changed: " ^ UnparseC.term t')
35.12 @@ -52,10 +52,10 @@
35.13 if UnparseC.terms asm = "[\"x \<noteq> 0\", \"x + - 1 * y \<noteq> 0\"]"
35.14 then () else error "factout_p_ asm 1 changed"
35.15 ;
35.16 -val t = TermC.parse_test @{context} "nothing + to_cancel ::real";
35.17 +val t = ParseC.parse_test @{context} "nothing + to_cancel ::real";
35.18 if NONE = factout_p_ thy t then () else error "factout_p_ doesn't report non-applicable";
35.19 ;
35.20 -val t = TermC.parse_test @{context} "((3 * x \<up> 2 + 6 *x + 3) / (2*x + 2))";
35.21 +val t = ParseC.parse_test @{context} "((3 * x \<up> 2 + 6 *x + 3) / (2*x + 2))";
35.22 val SOME (t', asm) = factout_p_ thy t;
35.23 if UnparseC.term t' = "(3 + 3 * x) * (1 + x) / (2 * (1 + x))" andalso
35.24 UnparseC.terms asm = "[\"1 + x \<noteq> 0\"]"
35.25 @@ -64,15 +64,15 @@
35.26 "-------- integration lev.1 fun cancel_p_ ------------------------------------";
35.27 "-------- integration lev.1 fun cancel_p_ ------------------------------------";
35.28 "-------- integration lev.1 fun cancel_p_ ------------------------------------";
35.29 -val t = TermC.parse_test @{context} "(x \<up> 2 + - 1*y \<up> 2) / (x \<up> 2 + - 1*x*y)"
35.30 +val t = ParseC.parse_test @{context} "(x \<up> 2 + - 1*y \<up> 2) / (x \<up> 2 + - 1*x*y)"
35.31 val SOME (t', asm) = cancel_p_ thy t;
35.32 if (UnparseC.term t', UnparseC.terms asm) = ("(x + y) / x", "[\"x \<noteq> 0\"]")
35.33 then () else error ("cancel_p_ (t', asm) 1 changed: " ^ UnparseC.term t')
35.34 ;
35.35 -val t = TermC.parse_test @{context} "nothing + to_cancel ::real";
35.36 +val t = ParseC.parse_test @{context} "nothing + to_cancel ::real";
35.37 if NONE = cancel_p_ thy t then () else error "cancel_p_ doesn't report non-applicable";
35.38 ;
35.39 -val t = TermC.parse_test @{context} "((3 * x \<up> 2 + 6 *x + 3) / (2*x + 2))";
35.40 +val t = ParseC.parse_test @{context} "((3 * x \<up> 2 + 6 *x + 3) / (2*x + 2))";
35.41 val SOME (t', asm) = cancel_p_ thy t;
35.42 if UnparseC.term t' = "(3 + 3 * x) / 2" andalso UnparseC.terms asm = "[]"
35.43 then () else error "cancel_p_ 1 changed";
35.44 @@ -80,7 +80,7 @@
35.45 "-------- integration lev.1 fun common_nominator_p_ --------------------------";
35.46 "-------- integration lev.1 fun common_nominator_p_ --------------------------";
35.47 "-------- integration lev.1 fun common_nominator_p_ --------------------------";
35.48 -val t = TermC.parse_test @{context} ("y / (a*x + b*x + c*x) " ^
35.49 +val t = ParseC.parse_test @{context} ("y / (a*x + b*x + c*x) " ^
35.50 (* n1 d1 *)
35.51 "+ a / (x*y)");
35.52 (* n2 d2 *)
35.53 @@ -95,7 +95,7 @@
35.54 then () else error "common_nominator_p_ asm 1 changed"
35.55
35.56 "-------- example in mail Nipkow";
35.57 -val t = TermC.parse_test @{context} "x/(x \<up> 2 + - 1*y \<up> 2) + y/(x \<up> 2 + - 1*x*y)";
35.58 +val t = ParseC.parse_test @{context} "x/(x \<up> 2 + - 1*y \<up> 2) + y/(x \<up> 2 + - 1*x*y)";
35.59 val SOME (t', asm) = common_nominator_p_ thy t;
35.60 if UnparseC.term t' =
35.61 "x * x / ((x + - 1 * y) * ((x + y) * x)) +\ny * (x + y) / ((x + - 1 * y) * ((x + y) * x))"
35.62 @@ -105,10 +105,10 @@
35.63 then () else error "common_nominator_p_ asm 2 changed"
35.64
35.65 "-------- example: applicable tested by SML code";
35.66 -val t = TermC.parse_test @{context} "nothing / to_add";
35.67 +val t = ParseC.parse_test @{context} "nothing / to_add";
35.68 if NONE = common_nominator_p_ thy t then () else error "common_nominator_p_ term 3 changed";
35.69 ;
35.70 -val t = TermC.parse_test @{context} "((x + (- 1)) / (x + 1)) + ((x + 1) / (x + (- 1)))";
35.71 +val t = ParseC.parse_test @{context} "((x + (- 1)) / (x + 1)) + ((x + 1) / (x + (- 1)))";
35.72 val SOME (t', asm) = common_nominator_p_ thy t;
35.73 if UnparseC.term t' =
35.74 "(x + - 1) * (- 1 + x) / ((1 + x) * (- 1 + x)) +\n(x + 1) * (1 + x) / ((1 + x) * (- 1 + x))"
35.75 @@ -118,7 +118,7 @@
35.76 "-------- integration lev.1 fun add_fraction_p_ ------------------------------";
35.77 "-------- integration lev.1 fun add_fraction_p_ ------------------------------";
35.78 "-------- integration lev.1 fun add_fraction_p_ ------------------------------";
35.79 -val t = TermC.parse_test @{context} "((x + (- 1)) / (x + 1)) + ((x + 1) / (x + (- 1)))";
35.80 +val t = ParseC.parse_test @{context} "((x + (- 1)) / (x + 1)) + ((x + 1) / (x + (- 1)))";
35.81 val SOME (t', asm) = add_fraction_p_ thy t;
35.82 if UnparseC.term t' = "(2 + 2 * x \<up> 2) / (- 1 + x \<up> 2)"
35.83 then () else error "add_fraction_p_ 3 changed";
35.84 @@ -126,10 +126,10 @@
35.85 if UnparseC.terms asm = "[\"- 1 + x \<up> 2 \<noteq> 0\"]"
35.86 then () else error "add_fraction_p_ 3 changed";
35.87 ;
35.88 -val t = TermC.parse_test @{context} "nothing / to_add";
35.89 +val t = ParseC.parse_test @{context} "nothing / to_add";
35.90 if NONE = add_fraction_p_ thy t then () else error "add_fraction_p_ term 3 changed";
35.91 ;
35.92 -val t = TermC.parse_test @{context} "((x + (- 1)) / (x + 1)) + ((x + 1) / (x + (- 1)))";
35.93 +val t = ParseC.parse_test @{context} "((x + (- 1)) / (x + 1)) + ((x + 1) / (x + (- 1)))";
35.94 val SOME (t', asm) = add_fraction_p_ thy t;
35.95 if UnparseC.term t' = "(2 + 2 * x \<up> 2) / (- 1 + x \<up> 2)" andalso
35.96 UnparseC.terms asm = "[\"- 1 + x \<up> 2 \<noteq> 0\"]"
35.97 @@ -142,7 +142,7 @@
35.98 (which does not to work, because substitution is not done -- compare rew_sub!);
35.99 keep this sequence for the case, factout_p, cancel_p, common_nominator_p, add_fraction_p
35.100 (again) get prepat = [] changed to <>[]. *)
35.101 -val t = TermC.parse_test @{context} "(x \<up> 2 + - 1*y \<up> 2) / (x \<up> 2 + - 1*x*y)";
35.102 +val t = ParseC.parse_test @{context} "(x \<up> 2 + - 1*y \<up> 2) / (x \<up> 2 + - 1*x*y)";
35.103
35.104 (*rewrite_set_ @{theory Isac_Knowledge} true cancel t = NONE; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*)
35.105 "~~~~~ fun rewrite_set_, args:"; val (thy, bool, rls, term) = (thy, false, cancel_p, t);
35.106 @@ -219,13 +219,13 @@
35.107 "-------- fun rewrite_set_ cancel_p downto fun gcd_poly ----------------------";
35.108 "-------- fun rewrite_set_ cancel_p downto fun gcd_poly ----------------------";
35.109 "-------- fun rewrite_set_ cancel_p downto fun gcd_poly ----------------------";
35.110 -val t = TermC.parse_test @{context} "(12 * x * y) / (8 * y \<up> 2 )";
35.111 +val t = ParseC.parse_test @{context} "(12 * x * y) / (8 * y \<up> 2 )";
35.112 (* "-------- example 187a": exception Div raised...
35.113 val SOME (t', asm) = rewrite_set_ thy false cancel_p t;*)
35.114 -val t = TermC.parse_test @{context} "(8 * x \<up> 2 * y * z ) / (18 * x * y \<up> 2 * z )";
35.115 +val t = ParseC.parse_test @{context} "(8 * x \<up> 2 * y * z ) / (18 * x * y \<up> 2 * z )";
35.116 (* "-------- example 187b": doesn't terminate...
35.117 val SOME (t', asm) = rewrite_set_ thy false cancel_p t;*)
35.118 -val t = TermC.parse_test @{context} "(9 * x \<up> 5 * y \<up> 2 * z \<up> 4) / (15 * x \<up> 6 * y \<up> 3 * z )";
35.119 +val t = ParseC.parse_test @{context} "(9 * x \<up> 5 * y \<up> 2 * z \<up> 4) / (15 * x \<up> 6 * y \<up> 3 * z )";
35.120 (* "-------- example 187c": doesn't terminate...
35.121 val SOME (t', asm) = rewrite_set_ thy false cancel_p t;*)
35.122 "~~~~~ fun rewrite_set_, args:"; val (thy, bool, rls, term) = (@{theory Isac_Knowledge}, false, cancel_p, t);
35.123 @@ -274,14 +274,14 @@
35.124 "-------- rls norm_Rational downto fun gcd_poly ------------------------------";
35.125 "-------- rls norm_Rational downto fun gcd_poly ------------------------------";
35.126 "-------- rls norm_Rational downto fun gcd_poly ------------------------------";
35.127 -val t = TermC.parse_test @{context} "(x \<up> 2 - 4)*(3 - y) / ((y \<up> 2 - 9)*(2+x))";
35.128 +val t = ParseC.parse_test @{context} "(x \<up> 2 - 4)*(3 - y) / ((y \<up> 2 - 9)*(2+x))";
35.129 (* trace_rewrite stops with ...: (and then jEdit hangs)..
35.130 rewrite_set_ thy false norm_Rational t;
35.131 :
35.132 ### rls: cancel_p on: (- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /
35.133 (- 18 + -9 * x + 2 * y \<up> 2 + x * y \<up> 2)
35.134 *)
35.135 -val t = TermC.parse_test @{context} (*copy from above: "::real" is not required due to " \<up> "*)
35.136 +val t = ParseC.parse_test @{context} (*copy from above: "::real" is not required due to " \<up> "*)
35.137 ("(- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /" ^
35.138 "(- 18 + -9 * x + 2 * y \<up> 2 + x * y \<up> 2)");
35.139 (*cancel_p_ thy t;
35.140 @@ -307,7 +307,7 @@
35.141 "-------- rls norm_Rational downto fun add_fraction_p_ -----------------------";
35.142 val thy = @{theory Isac_Knowledge};
35.143 "----- SK060904- 2a non-termination of add_fraction_p_";
35.144 -val t = TermC.parse_test @{context} (" (a + b * x) / (a + - 1 * (b * x)) + " ^
35.145 +val t = ParseC.parse_test @{context} (" (a + b * x) / (a + - 1 * (b * x)) + " ^
35.146 " (- 1 * a + b * x) / (a + b * x) ");
35.147 (* rewrite_set_ thy false norm_Rational t
35.148 exception Div raised*)
35.149 @@ -429,7 +429,7 @@
35.150 (* Rewrite.trace_on:
35.151 add_fractions_p on: 3 = A / 2 + A / 4 + (B / 2 + - 1 * B / 2) --> 3 = A / 2 + A / 4 + 0 / 2 *)
35.152 (* |||||||||||||||||||||||||||| *)
35.153 -val t = TermC.parse_test @{context} (* ||||||||||||||||||||||||| *)
35.154 +val t = ParseC.parse_test @{context} (* ||||||||||||||||||||||||| *)
35.155 "AA / 4 + (BB / 2 + - 1 * BB / 2)";
35.156 "~~~~~ fun add_fraction_p_ , ad-hoc args:"; val (t) = (t);
35.157 val SOME ((n1, d1), (n2, d2)) = (*case*) check_frac_sum t (*of*);
35.158 @@ -456,26 +456,26 @@
35.159 "-------- rewrite_set_ cancel_p from: Mathematik 1 Schalk Reniets Verlag -----";
35.160 val thy = @{theory "Rational"};
35.161 "-------- WN";
35.162 -val t = TermC.parse_test @{context} "(2 + -3 * x) / 9";
35.163 +val t = ParseC.parse_test @{context} "(2 + -3 * x) / 9";
35.164 if NONE = rewrite_set_ ctxt false cancel_p t then ()
35.165 else error "rewrite_set_ cancel_p must return NONE, if the term cannot be cancelled";
35.166
35.167 "-------- example 186a";
35.168 -val t = TermC.parse_test @{context} "(14 * x * y) / (x * y)";
35.169 - is_expanded (TermC.parse_test @{context} "14 * x * y");
35.170 - is_expanded (TermC.parse_test @{context} "x * y");
35.171 +val t = ParseC.parse_test @{context} "(14 * x * y) / (x * y)";
35.172 + is_expanded (ParseC.parse_test @{context} "14 * x * y");
35.173 + is_expanded (ParseC.parse_test @{context} "x * y");
35.174 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.175 if (UnparseC.term t', UnparseC.terms asm) = ("14 / 1", "[]")
35.176 then () else error "rational.sml cancel Schalk 186a";
35.177
35.178 "-------- example 186b";
35.179 -val t = TermC.parse_test @{context} "(60 * a * b) / ( 15 * a * b )";
35.180 +val t = ParseC.parse_test @{context} "(60 * a * b) / ( 15 * a * b )";
35.181 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.182 if (UnparseC.term t', UnparseC.terms asm) = ("4 / 1", "[]")
35.183 then () else error "rational.sml cancel Schalk 186b";
35.184
35.185 "-------- example 186c";
35.186 -val t = TermC.parse_test @{context} "(144 * a \<up> 2 * b * c) / (12 * a * b * c)";
35.187 +val t = ParseC.parse_test @{context} "(144 * a \<up> 2 * b * c) / (12 * a * b * c)";
35.188 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.189 if (UnparseC.term t', UnparseC.terms asm) = ("12 * a / 1", "[]")
35.190 then () else error "rational.sml cancel Schalk 186c";
35.191 @@ -483,7 +483,7 @@
35.192 (* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! exception Div raised !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35.193 see --- fun rewrite_set_ downto fun gcd_poly ---
35.194 "-------- example 187a";
35.195 -val t = TermC.parse_test @{context} "(12 * x * y) / (8 * y \<up> 2 )";
35.196 +val t = ParseC.parse_test @{context} "(12 * x * y) / (8 * y \<up> 2 )";
35.197 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.198 if (UnparseC.term t', UnparseC.terms asm) = ("3 * x / (2 * y)", "[\"4 * y ~= 0\"]")
35.199 then () else error "rational.sml cancel Schalk 187a";
35.200 @@ -492,7 +492,7 @@
35.201 (* doesn't terminate !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35.202 see --- fun rewrite_set_ downto fun gcd_poly ---
35.203 "-------- example 187b";
35.204 -val t = TermC.parse_test @{context} "(8 * x \<up> 2 * y * z ) / (18 * x * y \<up> 2 * z )";
35.205 +val t = ParseC.parse_test @{context} "(8 * x \<up> 2 * y * z ) / (18 * x * y \<up> 2 * z )";
35.206 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.207 if (UnparseC.term t', UnparseC.terms asm) = ("4 * x / (9 * y)", "[\"2 * (z * (y * x)) ~= 0\"]")
35.208 then () else error "rational.sml cancel Schalk 187b";
35.209 @@ -501,7 +501,7 @@
35.210 (* doesn't terminate !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35.211 see --- fun rewrite_set_ downto fun gcd_poly ---
35.212 "-------- example 187c";
35.213 -val t = TermC.parse_test @{context} "(9 * x \<up> 5 * y \<up> 2 * z \<up> 4) / (15 * x \<up> 6 * y \<up> 3 * z )";
35.214 +val t = ParseC.parse_test @{context} "(9 * x \<up> 5 * y \<up> 2 * z \<up> 4) / (15 * x \<up> 6 * y \<up> 3 * z )";
35.215 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.216 if (UnparseC.term t', UnparseC.terms asm) =
35.217 ("3 * z \<up> 3 / (5 * (y * x))", "[\"3 * (z * (y \<up> 2 * x \<up> 5)) ~= 0\"]")
35.218 @@ -509,119 +509,119 @@
35.219 *)
35.220
35.221 "-------- example 188a";
35.222 -val t = TermC.parse_test @{context} "(-8 + 8 * x) / (-9 + 9 * x)";
35.223 - is_expanded (TermC.parse_test @{context} "8 * x + -8");
35.224 +val t = ParseC.parse_test @{context} "(-8 + 8 * x) / (-9 + 9 * x)";
35.225 + is_expanded (ParseC.parse_test @{context} "8 * x + -8");
35.226 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.227 if (UnparseC.term t', UnparseC.terms asm) = ("8 / 9", "[]")
35.228 then () else error "rational.sml cancel Schalk 188a";
35.229
35.230 -val t = TermC.parse_test @{context} "(8*((- 1) + x))/(9*((- 1) + x))";
35.231 +val t = ParseC.parse_test @{context} "(8*((- 1) + x))/(9*((- 1) + x))";
35.232 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
35.233 if (UnparseC.term t', UnparseC.terms asm) = ("8 / 9", "[]")
35.234 then () else error "rational.sml cancel Schalk make_polynomial 1";
35.235
35.236 "-------- example 188b";
35.237 -val t = TermC.parse_test @{context} "(- 15 + 5 * x) / (- 18 + 6 * x)";
35.238 +val t = ParseC.parse_test @{context} "(- 15 + 5 * x) / (- 18 + 6 * x)";
35.239 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.240 if (UnparseC.term t', UnparseC.terms asm) = ("5 / 6", "[]")
35.241 then () else error "rational.sml cancel Schalk 188b";
35.242
35.243 "-------- example 188c";
35.244 -val t = TermC.parse_test @{context} "(a + - 1 * b) / (b + - 1 * a)";
35.245 +val t = ParseC.parse_test @{context} "(a + - 1 * b) / (b + - 1 * a)";
35.246 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.247 if (UnparseC.term t', UnparseC.terms asm) = ("- 1 / 1", "[]")
35.248 then () else error "rational.sml cancel Schalk 188c";
35.249
35.250 -is_expanded (TermC.parse_test @{context} "a + - 1 * b") = true;
35.251 -val t = TermC.parse_test @{context} "((- 1)*(b + (- 1) * a))/(1*(b + (- 1) * a))";
35.252 +is_expanded (ParseC.parse_test @{context} "a + - 1 * b") = true;
35.253 +val t = ParseC.parse_test @{context} "((- 1)*(b + (- 1) * a))/(1*(b + (- 1) * a))";
35.254 val SOME (t', asm) = rewrite_set_ ctxt false make_polynomial t;
35.255 if (UnparseC.term t', UnparseC.terms asm) = ("(a + - 1 * b) / (- 1 * a + b)", "[]")
35.256 then () else error "rational.sml cancel Schalk make_polynomial 2";
35.257
35.258 "-------- example 190a";
35.259 -val t = TermC.parse_test @{context} "( 27 * a \<up> 3 + 9 * a \<up> 2 + 3 * a + 1 ) / ( 27 * a \<up> 3 + 18 * a \<up> 2 + 3 * a )";
35.260 +val t = ParseC.parse_test @{context} "( 27 * a \<up> 3 + 9 * a \<up> 2 + 3 * a + 1 ) / ( 27 * a \<up> 3 + 18 * a \<up> 2 + 3 * a )";
35.261 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.262 if (UnparseC.term t', UnparseC.terms asm) =
35.263 ("(1 + 9 * a \<up> 2) / (3 * a + 9 * a \<up> 2)", "[\"3 * a + 9 * a \<up> 2 \<noteq> 0\"]")
35.264 then () else error "rational.sml cancel Schalk 190a";
35.265
35.266 "-------- example 190c";
35.267 -val t = TermC.parse_test @{context} "((1 + 9 * a \<up> 2)*(1 + 3 * a))/((3 * a + 9 * a \<up> 2)*(1 + 3 * a))";
35.268 +val t = ParseC.parse_test @{context} "((1 + 9 * a \<up> 2)*(1 + 3 * a))/((3 * a + 9 * a \<up> 2)*(1 + 3 * a))";
35.269 val SOME (t', asm) = rewrite_set_ ctxt false make_polynomial t;
35.270 if (UnparseC.term t', UnparseC.terms asm) =
35.271 ("(1 + 3 * a + 9 * a \<up> 2 + 27 * a \<up> 3) /\n(3 * a + 18 * a \<up> 2 + 27 * a \<up> 3)", "[]")
35.272 then () else error "rational.sml make_polynomial Schalk 190c";
35.273
35.274 "-------- example 191a";
35.275 -val t = TermC.parse_test @{context} "( x \<up> 2 + - 1 * y \<up> 2 ) / ( x + y )";
35.276 - is_expanded (TermC.parse_test @{context} "x \<up> 2 + - 1 * y \<up> 2") = false; (*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*)
35.277 - is_expanded (TermC.parse_test @{context} "x + y") = true;
35.278 +val t = ParseC.parse_test @{context} "( x \<up> 2 + - 1 * y \<up> 2 ) / ( x + y )";
35.279 + is_expanded (ParseC.parse_test @{context} "x \<up> 2 + - 1 * y \<up> 2") = false; (*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*)
35.280 + is_expanded (ParseC.parse_test @{context} "x + y") = true;
35.281 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.282 if (UnparseC.term t', UnparseC.terms asm) = ("(x + - 1 * y) / 1", "[]")
35.283 then () else error "rational.sml make_polynomial Schalk 191a";
35.284
35.285 "-------- example 191b";
35.286 -val t = TermC.parse_test @{context} "((x + (- 1) * y)*(x + y))/((1)*(x + y))";
35.287 +val t = ParseC.parse_test @{context} "((x + (- 1) * y)*(x + y))/((1)*(x + y))";
35.288 val SOME (t', asm) = rewrite_set_ ctxt false make_polynomial t;
35.289 if (UnparseC.term t', UnparseC.terms asm) = ("(x \<up> 2 + - 1 * y \<up> 2) / (x + y)", "[]")
35.290 then () else error "rational.sml make_polynomial Schalk 191b";
35.291
35.292 "-------- example 191c";
35.293 -val t = TermC.parse_test @{context} "( 9 * x \<up> 2 + -30 * x + 25 ) / ( 9 * x \<up> 2 + - 25 )";
35.294 - is_expanded (TermC.parse_test @{context} "9 * x \<up> 2 + -30 * x + 25") = true;
35.295 - is_expanded (TermC.parse_test @{context} "25 + -30*x + 9*x \<up> 2") = true;
35.296 - is_expanded (TermC.parse_test @{context} "- 25 + 9*x \<up> 2") = true;
35.297 +val t = ParseC.parse_test @{context} "( 9 * x \<up> 2 + -30 * x + 25 ) / ( 9 * x \<up> 2 + - 25 )";
35.298 + is_expanded (ParseC.parse_test @{context} "9 * x \<up> 2 + -30 * x + 25") = true;
35.299 + is_expanded (ParseC.parse_test @{context} "25 + -30*x + 9*x \<up> 2") = true;
35.300 + is_expanded (ParseC.parse_test @{context} "- 25 + 9*x \<up> 2") = true;
35.301
35.302 -val t = TermC.parse_test @{context} "(((-5) + 3 * x)*((-5) + 3 * x))/((5 + 3 * x)*((-5) + 3 * x))";
35.303 +val t = ParseC.parse_test @{context} "(((-5) + 3 * x)*((-5) + 3 * x))/((5 + 3 * x)*((-5) + 3 * x))";
35.304 val SOME (t', asm) = rewrite_set_ ctxt false make_polynomial t;
35.305 if (UnparseC.term t', UnparseC.terms asm) = ("(25 + - 30 * x + 9 * x \<up> 2) / (- 25 + 9 * x \<up> 2)", "[]")
35.306 then () else error "rational.sml make_polynomial Schalk 191c";
35.307
35.308 "-------- example 192b";
35.309 -val t = TermC.parse_test @{context} "( 7 * x \<up> 3 + - 1 * x \<up> 2 * y ) / ( 7 * x * y \<up> 2 + - 1 * y \<up> 3 )";
35.310 +val t = ParseC.parse_test @{context} "( 7 * x \<up> 3 + - 1 * x \<up> 2 * y ) / ( 7 * x * y \<up> 2 + - 1 * y \<up> 3 )";
35.311 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.312 if (UnparseC.term t', UnparseC.terms asm) = ("x \<up> 2 / y \<up> 2", "[\"y \<up> 2 \<noteq> 0\"]")
35.313 then () else error "rational.sml cancel_p Schalk 192b";
35.314
35.315 -val t = TermC.parse_test @{context} "((x \<up> 2)*(7 * x + (- 1) * y))/((y \<up> 2)*(7 * x + (- 1) * y))";
35.316 +val t = ParseC.parse_test @{context} "((x \<up> 2)*(7 * x + (- 1) * y))/((y \<up> 2)*(7 * x + (- 1) * y))";
35.317 val SOME (t', asm) = rewrite_set_ ctxt false make_polynomial t;
35.318 if (UnparseC.term t', UnparseC.terms asm) =
35.319 ("(7 * x \<up> 3 + - 1 * x \<up> 2 * y) /\n(7 * x * y \<up> 2 + - 1 * y \<up> 3)", "[]")
35.320 then () else error "rational.sml make_polynomial Schalk 192b";
35.321
35.322 -val t = TermC.parse_test @{context} "((x \<up> 2)*(7 * x + (- 1) * y))/((y \<up> 2)*(7 * x + (- 1) * y))";
35.323 +val t = ParseC.parse_test @{context} "((x \<up> 2)*(7 * x + (- 1) * y))/((y \<up> 2)*(7 * x + (- 1) * y))";
35.324 val SOME (t', asm) = rewrite_set_ ctxt false make_polynomial t;
35.325 if (UnparseC.term t', UnparseC.terms asm) =
35.326 ("(7 * x \<up> 3 + - 1 * x \<up> 2 * y) /\n(7 * x * y \<up> 2 + - 1 * y \<up> 3)", "[]")
35.327 then () else error "rational.sml make_polynomial Schalk WN050929 not working";
35.328
35.329 "-------- example 193a";
35.330 -val t = TermC.parse_test @{context} "( x \<up> 2 + -6 * x + 9 ) / ( x \<up> 2 + -9 )";
35.331 +val t = ParseC.parse_test @{context} "( x \<up> 2 + -6 * x + 9 ) / ( x \<up> 2 + -9 )";
35.332 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.333 if (UnparseC.term t', UnparseC.terms asm) = ("(- 3 + x) / (3 + x)", "[\"3 + x \<noteq> 0\"]")
35.334 then () else error "rational.sml cancel_p Schalk 193a";
35.335
35.336 "-------- example 193b";
35.337 -val t = TermC.parse_test @{context} "( x \<up> 2 + -8 * x + 16 ) / ( 2 * x \<up> 2 + -32 )";
35.338 +val t = ParseC.parse_test @{context} "( x \<up> 2 + -8 * x + 16 ) / ( 2 * x \<up> 2 + -32 )";
35.339 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.340 if (UnparseC.term t', UnparseC.terms asm) = ("(- 4 + x) / (8 + 2 * x)", "[\"8 + 2 * x \<noteq> 0\"]")
35.341 then () else error "rational.sml cancel_p Schalk 193b";
35.342
35.343 "-------- example 193c";
35.344 -val t = TermC.parse_test @{context} "( 2 * x + -50 * x \<up> 3 ) / ( 25 * x \<up> 2 + - 10 * x + 1 )";
35.345 +val t = ParseC.parse_test @{context} "( 2 * x + -50 * x \<up> 3 ) / ( 25 * x \<up> 2 + - 10 * x + 1 )";
35.346 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.347 if (UnparseC.term t', UnparseC.terms asm) =
35.348 ("(2 * x + 10 * x \<up> 2) / (1 + - 5 * x)", "[\"1 + - 5 * x \<noteq> 0\"]")
35.349 then () else error "rational.sml cancel_p Schalk 193c";
35.350
35.351 (*WN: improved with new numerals*)
35.352 -val t = TermC.parse_test @{context} "(- 25 + 9*x \<up> 2)/(5 + 3*x)";
35.353 +val t = ParseC.parse_test @{context} "(- 25 + 9*x \<up> 2)/(5 + 3*x)";
35.354 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.355 if (UnparseC.term t', UnparseC.terms asm) = ("(- 5 + 3 * x) / 1", "[]")
35.356 then () else error "rational.sml cancel WN 1";
35.357
35.358 "-------- example heuberger";
35.359 -val t = TermC.parse_test @{context} ("(x \<up> 4 + x * y + x \<up> 3 * y + y \<up> 2) / " ^
35.360 +val t = ParseC.parse_test @{context} ("(x \<up> 4 + x * y + x \<up> 3 * y + y \<up> 2) / " ^
35.361 "(x + 5 * x \<up> 2 + y + 5 * x * y + x \<up> 2 * y \<up> 3 + x * y \<up> 4)");
35.362 val SOME (t', asm) = rewrite_set_ ctxt false cancel_p t;
35.363 if (UnparseC.term t', UnparseC.terms asm) =
35.364 @@ -636,7 +636,7 @@
35.365 "-------- integration lev.1 -- lev.5: cancel_p_ & add_fractions_p_ -----------";
35.366 "-------- integration lev.1 -- lev.5: cancel_p_ & add_fractions_p_ -----------";
35.367 "-------- integration lev.1 -- lev.5: cancel_p_ & add_fractions_p_ -----------";
35.368 -val t = TermC.parse_test @{context} ("123 = (a*x)/(b*x) + (c*x)/(d*x) + (e*x)/(f*x::real)");
35.369 +val t = ParseC.parse_test @{context} ("123 = (a*x)/(b*x) + (c*x)/(d*x) + (e*x)/(f*x::real)");
35.370 "-------- gcd_poly integration level 1: works on exact term";
35.371 if NONE = cancel_p_ thy t then () else error "cancel_p_ works on exact fraction";
35.372 if NONE = add_fraction_p_ thy t then () else error "add_fraction_p_ works on exact fraction";
35.373 @@ -701,7 +701,7 @@
35.374 "-------- reverse rewrite ----------------------------------------------------";
35.375 "-------- reverse rewrite ----------------------------------------------------";
35.376 (** the term for which reverse rewriting is demonstrated **)
35.377 -val t = TermC.parse_test @{context} "(9 + - 1 * x \<up> 2) / (9 + 6 * x + x \<up> 2)";
35.378 +val t = ParseC.parse_test @{context} "(9 + - 1 * x \<up> 2) / (9 + 6 * x + x \<up> 2)";
35.379 val Rrls {program = Rfuns {init_state = ini, locate_rule = loc,
35.380 next_rule = nex, normal_form = nor, ...},...} = cancel_p;
35.381
35.382 @@ -807,7 +807,7 @@
35.383 special cases.*)
35.384
35.385 (*the term for which reverse rewriting is demonstrated*)
35.386 -val t = TermC.parse_test @{context} "(9 + (- 1)*x \<up> 2) / (9 + ((-6)*x + x \<up> 2))";
35.387 +val t = ParseC.parse_test @{context} "(9 + (- 1)*x \<up> 2) / (9 + ((-6)*x + x \<up> 2))";
35.388 val Rrls {program=Rfuns {init_state=ini,locate_rule=loc,
35.389 next_rule=nex,normal_form=nor,...},...} = cancel_p;
35.390
35.391 @@ -846,46 +846,46 @@
35.392 "-------- examples: rls norm_Rational ----------------------------------------";
35.393 "-------- examples: rls norm_Rational ----------------------------------------";
35.394 "-------- examples: rls norm_Rational ----------------------------------------";
35.395 -val t = TermC.parse_test @{context} "Not (6*x is_atom)";
35.396 +val t = ParseC.parse_test @{context} "Not (6*x is_atom)";
35.397 val SOME (t',_) = rewrite_set_ ctxt false powers_erls t; UnparseC.term t';
35.398 "HOL.True";
35.399 -val t = TermC.parse_test @{context} "1 < 2";
35.400 +val t = ParseC.parse_test @{context} "1 < 2";
35.401 val SOME (t',_) = rewrite_set_ ctxt false powers_erls t; UnparseC.term t';
35.402 "HOL.True";
35.403
35.404 -val t = TermC.parse_test @{context} "(6*x) \<up> 2";
35.405 +val t = ParseC.parse_test @{context} "(6*x) \<up> 2";
35.406 val SOME (t',_) = rewrite_ ctxt Rewrite_Ord.function_empty powers_erls false @{thm realpow_def_atom} t;
35.407 if UnparseC.term t' = "6 * x * (6 * x) \<up> (2 + - 1)" then ()
35.408 else error "rational.sml powers_erls (6*x) \<up> 2";
35.409
35.410 -val t = TermC.parse_test @{context} "- 1 * (- 2 * (5 / 2 * (13 * x / 2)))";
35.411 +val t = ParseC.parse_test @{context} "- 1 * (- 2 * (5 / 2 * (13 * x / 2)))";
35.412 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.413 if UnparseC.term t' = "65 * x / 2" then () else error "rational.sml 4";
35.414
35.415 -val t = TermC.parse_test @{context} "1 - ((13*x)/2 - 5/2) \<up> 2";
35.416 +val t = ParseC.parse_test @{context} "1 - ((13*x)/2 - 5/2) \<up> 2";
35.417 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.418 if UnparseC.term t' = "(- 21 + 130 * x + - 169 * x \<up> 2) / 4" then ()
35.419 else error "rational.sml 5";
35.420
35.421 (*SRAM Schalk I, p.92 Nr. 609a*)
35.422 -val t = TermC.parse_test @{context} "2*(3 - x/5)/3 - 4*(1 - x/3) - x/3 - 2*(x/2 - 1/4)/27 +5/54";
35.423 +val t = ParseC.parse_test @{context} "2*(3 - x/5)/3 - 4*(1 - x/3) - x/3 - 2*(x/2 - 1/4)/27 +5/54";
35.424 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.425 if UnparseC.term t' = "(- 255 + 112 * x) / 135" then ()
35.426 else error "rational.sml 6";
35.427
35.428 (*SRAM Schalk I, p.92 Nr. 610c*)
35.429 -val t = TermC.parse_test @{context} "((x- 1)/(x+1) + 1) / ((x- 1)/(x+1) - (x+1)/(x- 1)) - 2";
35.430 +val t = ParseC.parse_test @{context} "((x- 1)/(x+1) + 1) / ((x- 1)/(x+1) - (x+1)/(x- 1)) - 2";
35.431 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.432 if UnparseC.term t' = "(3 + x) / - 2" then () else error "rational.sml 7";
35.433
35.434 (*SRAM Schalk I, p.92 Nr. 476a*)
35.435 -val t = TermC.parse_test @{context} "(x \<up> 2/(1 - x \<up> 2) + 1)/(x/(1 - x) + 1) * (1 + x)";
35.436 +val t = ParseC.parse_test @{context} "(x \<up> 2/(1 - x \<up> 2) + 1)/(x/(1 - x) + 1) * (1 + x)";
35.437 (*. a/b : c/d translated to a/b * d/c .*)
35.438 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.439 if UnparseC.term t' = "1" then () else error "rational.sml 8";
35.440
35.441 (*Schalk I, p.92 Nr. 472a*)
35.442 -val t = TermC.parse_test @{context} "((8*x \<up> 2 - 32*y \<up> 2)/(2*x + 4*y))/((4*x - 8*y)/(x + y))";
35.443 +val t = ParseC.parse_test @{context} "((8*x \<up> 2 - 32*y \<up> 2)/(2*x + 4*y))/((4*x - 8*y)/(x + y))";
35.444 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.445 if UnparseC.term t' = "x + y" then () else error "rational.sml p.92 Nr. 472a";
35.446
35.447 @@ -893,11 +893,11 @@
35.448
35.449 (*WN130910 add_fractions_p exception Div raised + history:
35.450 ### WN.2.6.03 from rlang.sml 56a
35.451 -val t = TermC.parse_test @{context} "(a + b * x) / (a + - 1 * (b * x)) + (- 1 * a + b * x) / (a + b * x) = 4 * (a * b) / (a \<up> 2 + - 1 * b \<up> 2)";
35.452 +val t = ParseC.parse_test @{context} "(a + b * x) / (a + - 1 * (b * x)) + (- 1 * a + b * x) / (a + b * x) = 4 * (a * b) / (a \<up> 2 + - 1 * b \<up> 2)";
35.453 val NONE = rewrite_set_ ctxt false add_fractions_p t;
35.454
35.455 THE ERROR ALREADY OCCURS IN THIS PART:
35.456 -val t = TermC.parse_test @{context} "(a + b * x) / (a + - 1 * (b * x)) + (- 1 * a + b * x) / (a + b * x)";
35.457 +val t = ParseC.parse_test @{context} "(a + b * x) / (a + - 1 * (b * x)) + (- 1 * a + b * x) / (a + b * x)";
35.458 val NONE = add_fraction_p_ ctxt t;
35.459
35.460 SEE Test_Some.thy: section {* add_fractions_p downto exception Div raised ===
35.461 @@ -907,13 +907,13 @@
35.462 "-------- rational numerals --------------------------------------------------";
35.463 "-------- rational numerals --------------------------------------------------";
35.464 (*SRA Schalk I, p.40 Nr. 164b *)
35.465 -val t = TermC.parse_test @{context} "(47/6 - 76/9 + 13/4)/(35/12)";
35.466 +val t = ParseC.parse_test @{context} "(47/6 - 76/9 + 13/4)/(35/12)";
35.467 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.468 if UnparseC.term t = "19 / 21" then ()
35.469 else error "rational.sml: diff.behav. in norm_Rational_mg 1";
35.470
35.471 (*SRA Schalk I, p.40 Nr. 166a *)
35.472 -val t = TermC.parse_test @{context} "((5/4)/(4+22/7) + 37/20)*(110/3 - 110/9 * 23/11)";
35.473 +val t = ParseC.parse_test @{context} "((5/4)/(4+22/7) + 37/20)*(110/3 - 110/9 * 23/11)";
35.474 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.475 if UnparseC.term t = "45 / 2" then ()
35.476 else error "rational.sml: diff.behav. in norm_Rational_mg 2";
35.477 @@ -922,55 +922,55 @@
35.478 "-------- examples cancellation from: Mathematik 1 Schalk --------------------";
35.479 "-------- examples cancellation from: Mathematik 1 Schalk --------------------";
35.480 (* e190c Stefan K.*)
35.481 -val t = TermC.parse_test @{context} "((1 + 9*a \<up> 2) * (1 + 3*a)) / ((3*a + 9*a \<up> 2) * (1 + 3*a))";
35.482 +val t = ParseC.parse_test @{context} "((1 + 9*a \<up> 2) * (1 + 3*a)) / ((3*a + 9*a \<up> 2) * (1 + 3*a))";
35.483 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.484 if UnparseC.term t = "(1 + 9 * a \<up> 2) / (3 * a + 9 * a \<up> 2)"
35.485 then () else error "rational.sml: diff.behav. in norm_Rational_mg 3";
35.486
35.487 (* e192b Stefan K.*)
35.488 -val t = TermC.parse_test @{context} "(x \<up> 2 * (7*x + (- 1)*y)) / (y \<up> 2 * (7*x + (- 1)*y))";
35.489 +val t = ParseC.parse_test @{context} "(x \<up> 2 * (7*x + (- 1)*y)) / (y \<up> 2 * (7*x + (- 1)*y))";
35.490 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.491 if UnparseC.term t = "x \<up> 2 / y \<up> 2"
35.492 then () else error "rational.sml: diff.behav. in norm_Rational_mg 4";
35.493
35.494 (*SRC Schalk I, p.66 Nr. 379c *)
35.495 -val t = TermC.parse_test @{context} "(a - b)/(b - a)";
35.496 +val t = ParseC.parse_test @{context} "(a - b)/(b - a)";
35.497 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.498 if UnparseC.term t = "- 1"
35.499 then () else error "rational.sml: diff.behav. in norm_Rational_mg 5";
35.500
35.501 (*SRC Schalk I, p.66 Nr. 380b *)
35.502 -val t = TermC.parse_test @{context} "15*(3*x + 3) * (4*x + 9) / (12*(2*x + 7) * (5*x + 5))";
35.503 +val t = ParseC.parse_test @{context} "15*(3*x + 3) * (4*x + 9) / (12*(2*x + 7) * (5*x + 5))";
35.504 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.505 if UnparseC.term t = "(27 + 12 * x) / (28 + 8 * x)"
35.506 then () else error "rational.sml: diff.behav. in norm_Rational_mg 6";
35.507
35.508 (* e190c Stefan K.*)
35.509 -val t = TermC.parse_test @{context} "((1 + 9*a \<up> 2) * (1 + 3*a)) / ((3*a + 9*a \<up> 2) * (1 + 3 * a))";
35.510 +val t = ParseC.parse_test @{context} "((1 + 9*a \<up> 2) * (1 + 3*a)) / ((3*a + 9*a \<up> 2) * (1 + 3 * a))";
35.511 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.512 if UnparseC.term t = "(1 + 9 * a \<up> 2) / (3 * a + 9 * a \<up> 2)"
35.513 then () else error "rational.sml: diff.behav. in norm_Rational_mg 3";
35.514
35.515 (* e192b Stefan K.*)
35.516 -val t = TermC.parse_test @{context} "(x \<up> 2 * (7*x + (- 1)*y)) / (y \<up> 2 * (7*x + (- 1)*y))";
35.517 +val t = ParseC.parse_test @{context} "(x \<up> 2 * (7*x + (- 1)*y)) / (y \<up> 2 * (7*x + (- 1)*y))";
35.518 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.519 if UnparseC.term t = "x \<up> 2 / y \<up> 2"
35.520 then () else error "rational.sml: diff.behav. in norm_Rational_mg 4";
35.521
35.522 (*SRC Schalk I, p.66 Nr. 379c *)
35.523 -val t = TermC.parse_test @{context} "(a - b) / (b - a)";
35.524 +val t = ParseC.parse_test @{context} "(a - b) / (b - a)";
35.525 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.526 if UnparseC.term t = "- 1"
35.527 then () else error "rational.sml: diff.behav. in norm_Rational_mg 5";
35.528
35.529 (*SRC Schalk I, p.66 Nr. 380b *)
35.530 -val t = TermC.parse_test @{context} "15*(3*x + 3) * (4*x + 9) / (12*(2*x + 7) * (5*x + 5))";
35.531 +val t = ParseC.parse_test @{context} "15*(3*x + 3) * (4*x + 9) / (12*(2*x + 7) * (5*x + 5))";
35.532 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.533 if UnparseC.term t = "(27 + 12 * x) / (28 + 8 * x)"
35.534 then () else error "rational.sml: diff.behav. in norm_Rational_mg 6";
35.535
35.536 (* extreme example from somewhere *)
35.537 -val t = TermC.parse_test @{context}
35.538 +val t = ParseC.parse_test @{context}
35.539 ("(a \<up> 4 * x + - 1*a \<up> 4 * y + 4*a \<up> 3 * b * x + -4*a \<up> 3 * b * y + " ^
35.540 "6*a \<up> 2 * b \<up> 2 * x + -6*a \<up> 2 * b \<up> 2 * y + 4*a * b \<up> 3 * x + -4*a * b \<up> 3 * y + " ^
35.541 "b \<up> 4 * x + - 1*b \<up> 4 * y) " ^
35.542 @@ -983,33 +983,33 @@
35.543
35.544 (*Schalk I, p.66 Nr. 381a *)
35.545 (* ATTENTION: here the rls is very slow. In Isabelle2002 this required 2 min *)
35.546 -val t = TermC.parse_test @{context} "18*(a + b) \<up> 3 * (a - b) \<up> 2 / (72*(a - b) \<up> 3 * (a + b) \<up> 2)";
35.547 +val t = ParseC.parse_test @{context} "18*(a + b) \<up> 3 * (a - b) \<up> 2 / (72*(a - b) \<up> 3 * (a + b) \<up> 2)";
35.548 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.549 if UnparseC.term t = "(a + b) / (4 * a + - 4 * b)"
35.550 then () else error "rational.sml: diff.behav. in norm_Rational_mg 8";
35.551
35.552 (*SRC Schalk I, p.66 Nr. 381b *)
35.553 -val t = TermC.parse_test @{context} "(4*x \<up> 2 - 20*x + 25) / (2*x - 5) \<up> 3";
35.554 +val t = ParseC.parse_test @{context} "(4*x \<up> 2 - 20*x + 25) / (2*x - 5) \<up> 3";
35.555 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.556 if UnparseC.term t = "1 / (- 5 + 2 * x)"
35.557 then () else error "rational.sml: diff.behav. in norm_Rational_mg 9";
35.558
35.559 (*SRC Schalk I, p.66 Nr. 381c *)
35.560 -val t = TermC.parse_test @{context} "(27*a \<up> 3 + 9*a \<up> 2+3*a+1) / (27*a \<up> 3 + 18*a \<up> 2+3*a)";
35.561 +val t = ParseC.parse_test @{context} "(27*a \<up> 3 + 9*a \<up> 2+3*a+1) / (27*a \<up> 3 + 18*a \<up> 2+3*a)";
35.562 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.563 if UnparseC.term t = "(1 + 9 * a \<up> 2) / (3 * a + 9 * a \<up> 2)"
35.564 then () else error "rational.sml: diff.behav. in norm_Rational_mg 10";
35.565
35.566 (*SRC Schalk I, p.66 Nr. 383a *)
35.567 -val t = TermC.parse_test @{context} "(5*a \<up> 2 - 5*a*b) / (a - b) \<up> 2";
35.568 +val t = ParseC.parse_test @{context} "(5*a \<up> 2 - 5*a*b) / (a - b) \<up> 2";
35.569 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.570 if UnparseC.term t = "- 5 * a / (- 1 * a + b)"
35.571 then () else error "rational.sml: diff.behav. in norm_Rational_mg 11";
35.572
35.573 "----- NOT TERMINATING ?: worked before 0707xx";
35.574 -val t = TermC.parse_test @{context} "(a \<up> 2 - 1)*(b + 1) / ((b \<up> 2 - 1)*(a+1))";
35.575 +val t = ParseC.parse_test @{context} "(a \<up> 2 - 1)*(b + 1) / ((b \<up> 2 - 1)*(a+1))";
35.576 (* WN130911 "exception Div raised" by
35.577 - cancel_p_ thy (TermC.parse_test @{context} ("(- 1 + - 1 * b + a \<up> 2 + a \<up> 2 * b) /" ^
35.578 + cancel_p_ thy (ParseC.parse_test @{context} ("(- 1 + - 1 * b + a \<up> 2 + a \<up> 2 * b) /" ^
35.579 "(- 1 + - 1 * a + b \<up> 2 + a * b \<up> 2)"))
35.580
35.581 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.582 @@ -1021,20 +1021,20 @@
35.583 "-------- examples common denominator from: Mathematik 1 Schalk --------------";
35.584 "-------- examples common denominator from: Mathematik 1 Schalk --------------";
35.585 (*SRA Schalk I, p.67 Nr. 403a *)
35.586 -val t = TermC.parse_test @{context} "4/x - 3/y - 1";
35.587 +val t = ParseC.parse_test @{context} "4/x - 3/y - 1";
35.588 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.589 if UnparseC.term t = "(- 3 * x + 4 * y + - 1 * x * y) / (x * y)"
35.590 then () else error "rational.sml: diff.behav. in norm_Rational_mg 12";
35.591
35.592 -val t = TermC.parse_test @{context} "(2*a+3*b)/(b*c) + (3*c+a)/(a*c) - (2*a \<up> 2+3*b*c)/(a*b*c)";
35.593 +val t = ParseC.parse_test @{context} "(2*a+3*b)/(b*c) + (3*c+a)/(a*c) - (2*a \<up> 2+3*b*c)/(a*b*c)";
35.594 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.595 if UnparseC.term t = "4 / c"
35.596 then () else error "rational.sml: diff.behav. in norm_Rational_mg 13";
35.597
35.598 (*SRA Schalk I, p.67 Nr. 410b *)
35.599 -val t = TermC.parse_test @{context} "1/(x+1) + 1/(x+2) - 2/(x+3)";
35.600 +val t = ParseC.parse_test @{context} "1/(x+1) + 1/(x+2) - 2/(x+3)";
35.601 (* WN130911 non-termination due to non-termination of
35.602 - cancel_p_ thy (TermC.parse_test @{context} "(5 + 3 * x) / (6 + 11 * x + 6 * x \<up> 2 + x \<up> 3)")
35.603 + cancel_p_ thy (ParseC.parse_test @{context} "(5 + 3 * x) / (6 + 11 * x + 6 * x \<up> 2 + x \<up> 3)")
35.604
35.605 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.606 if UnparseC.term t = "(5 + 3 * x) / (6 + 11 * x + 6 * x \<up> 2 + x \<up> 3)"
35.607 @@ -1042,22 +1042,22 @@
35.608 *)
35.609
35.610 (*SRA Schalk I, p.67 Nr. 413b *)
35.611 -val t = TermC.parse_test @{context} "(1 + x)/(1 - x) - (1 - x)/(1 + x) + 2*x/(1 - x \<up> 2)";
35.612 +val t = ParseC.parse_test @{context} "(1 + x)/(1 - x) - (1 - x)/(1 + x) + 2*x/(1 - x \<up> 2)";
35.613 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.614 if UnparseC.term t = "6 * x / (1 + - 1 * x \<up> 2)"
35.615 then () else error "rational.sml: diff.behav. in norm_Rational_mg 15";
35.616
35.617 (*SRA Schalk I, p.68 Nr. 414a *)
35.618 -val t = TermC.parse_test @{context} "(x + 2)/(x - 1) + (x - 3)/(x - 2) - (x + 1)/((x - 1)*(x - 2))";
35.619 +val t = ParseC.parse_test @{context} "(x + 2)/(x - 1) + (x - 3)/(x - 2) - (x + 1)/((x - 1)*(x - 2))";
35.620 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.621 if UnparseC.term t ="(- 2 + - 5 * x + 2 * x \<up> 2) / (2 + - 3 * x + x \<up> 2)"
35.622 then () else error "rational.sml: diff.behav. in norm_Rational_mg 16";
35.623
35.624 (*SRA Schalk I, p.68 Nr. 428b *)
35.625 -val t = TermC.parse_test @{context}
35.626 +val t = ParseC.parse_test @{context}
35.627 "1/(a - b) \<up> 2 + 1/(a + b) \<up> 2 - 2/(a \<up> 2 - b \<up> 2) - 4*(b \<up> 2 - 1)/(a \<up> 2 - b \<up> 2) \<up> 2";
35.628 (* WN130911 non-termination due to non-termination of
35.629 - cancel_p_ thy (TermC.parse_test @{context} "(4 + -4 * b \<up> 2) / (a \<up> 4 + - 2 * (a \<up> 2 * b \<up> 2) + b \<up> 4)")
35.630 + cancel_p_ thy (ParseC.parse_test @{context} "(4 + -4 * b \<up> 2) / (a \<up> 4 + - 2 * (a \<up> 2 * b \<up> 2) + b \<up> 4)")
35.631
35.632 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.633 if UnparseC.term t = "4 / (a \<up> 4 + - 2 * a \<up> 2 * b \<up> 2 + b \<up> 4)"
35.634 @@ -1065,14 +1065,14 @@
35.635 *)
35.636
35.637 (*SRA Schalk I, p.68 Nr. 430b *)
35.638 -val t = TermC.parse_test @{context}
35.639 +val t = ParseC.parse_test @{context}
35.640 "a \<up> 2/(a - 3*b) - 108*a*b \<up> 3/((a+3*b)*(a \<up> 2 - 9*b \<up> 2)) - 9*b \<up> 2*(a - 3*b)/(a+3*b) \<up> 2";
35.641 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.642 if UnparseC.term t = "a + 3 * b"
35.643 then () else error "rational.sml: diff.behav. in norm_Rational_mg 19";
35.644
35.645 (*SRA Schalk I, p.68 Nr. 432 *)
35.646 -val t = TermC.parse_test @{context}
35.647 +val t = ParseC.parse_test @{context}
35.648 ("(a \<up> 2 + a*b) / (a \<up> 2 - b \<up> 2) - (b \<up> 2 - a*b) / (b \<up> 2 - a \<up> 2) + " ^
35.649 "a \<up> 2*(a - b) / (a \<up> 3 - a \<up> 2*b) - 2*a*(a \<up> 2 - b \<up> 2) / (a \<up> 3 - a*b \<up> 2) - " ^
35.650 "2*b \<up> 2 / (a \<up> 2 - b \<up> 2)");
35.651 @@ -1081,7 +1081,7 @@
35.652 then () else error "rational.sml: diff.behav. in norm_Rational_mg 20";
35.653
35.654 (* some example *)
35.655 -val t = TermC.parse_test @{context} "3*a / (a*b) + x/y";
35.656 +val t = ParseC.parse_test @{context} "3*a / (a*b) + x/y";
35.657 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.658 if UnparseC.term t = "(3 * y + b * x) / (b * y)"
35.659 then () else error "rational.sml: diff.behav. in norm_Rational_mg 21";
35.660 @@ -1091,19 +1091,19 @@
35.661 "-------- examples multiply and cancel from: Mathematik 1 Schalk -------------";
35.662 "-------- examples multiply and cancel from: Mathematik 1 Schalk -------------";
35.663 (*------- SRM Schalk I, p.68 Nr. 436a *)
35.664 -val t = TermC.parse_test @{context} "3*(x+y) / (15*(x - y)) * 25*(x - y) \<up> 2 / (18*(x + y) \<up> 2)";
35.665 +val t = ParseC.parse_test @{context} "3*(x+y) / (15*(x - y)) * 25*(x - y) \<up> 2 / (18*(x + y) \<up> 2)";
35.666 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.667 if UnparseC.term t = "(- 5 * x + 5 * y) / (- 18 * x + - 18 * y)"
35.668 then () else error "rational.sml: diff.behav. in norm_Rational_mg 22";
35.669
35.670 (*------- SRM.test Schalk I, p.68 Nr. 436b *)
35.671 -val t = TermC.parse_test @{context} "5*a*(a - b) \<up> 2*(a + b) \<up> 3/(7*b*(a - b) \<up> 3) * 7*b/(a + b) \<up> 3";
35.672 +val t = ParseC.parse_test @{context} "5*a*(a - b) \<up> 2*(a + b) \<up> 3/(7*b*(a - b) \<up> 3) * 7*b/(a + b) \<up> 3";
35.673 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.674 if UnparseC.term t = "5 * a / (a + - 1 * b)"
35.675 then () else error "rational.sml: diff.behav. in norm_Rational_mg 23";
35.676
35.677 (*------- Schalk I, p.68 Nr. 437a *)
35.678 -val t = TermC.parse_test @{context} "(3*a - 4*b) / (4*c+3*e) * (3*a+4*b)/(9*a \<up> 2 - 16*b \<up> 2)";
35.679 +val t = ParseC.parse_test @{context} "(3*a - 4*b) / (4*c+3*e) * (3*a+4*b)/(9*a \<up> 2 - 16*b \<up> 2)";
35.680 (* raises an exception for unclear reasons:
35.681 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.682 :
35.683 @@ -1112,7 +1112,7 @@
35.684 exception Div raised
35.685
35.686 BUT
35.687 -val t = TermC.parse_test @{context}
35.688 +val t = ParseC.parse_test @{context}
35.689 ("(9 * a \<up> 2 + - 16 * b \<up> 2) / (4 * c + 3 * e) /" ^
35.690 "(9 * a \<up> 2 + - 16 * b \<up> 2)");
35.691 NONE = cancel_p_ thy t;
35.692 @@ -1122,14 +1122,14 @@
35.693 *)
35.694
35.695 "----- S.K. corrected non-termination 060904";
35.696 -val t = TermC.parse_test @{context} "(3*a - 4*b) * (3*a+4*b)/((4*c+3*e)*(9*a \<up> 2 - 16*b \<up> 2))";
35.697 +val t = ParseC.parse_test @{context} "(3*a - 4*b) * (3*a+4*b)/((4*c+3*e)*(9*a \<up> 2 - 16*b \<up> 2))";
35.698 val SOME (t, _) = rewrite_set_ ctxt false make_polynomial t;
35.699 if UnparseC.term t =
35.700 "(9 * a \<up> 2 + - 16 * b \<up> 2) /\n(36 * a \<up> 2 * c + 27 * a \<up> 2 * e + - 64 * b \<up> 2 * c +\n - 48 * b \<up> 2 * e)"
35.701 then () else error "rational.sml: S.K.8..corrected 060904-6";
35.702
35.703 "----- S.K. corrected non-termination of cancel_p_";
35.704 -val t'' = TermC.parse_test @{context} ("(9 * a \<up> 2 + - 16 * b \<up> 2) /" ^
35.705 +val t'' = ParseC.parse_test @{context} ("(9 * a \<up> 2 + - 16 * b \<up> 2) /" ^
35.706 "(36 * a \<up> 2 * c + (27 * a \<up> 2 * e + (-64 * b \<up> 2 * c + -48 * b \<up> 2 * e)))");
35.707 (* /--- DOES NOT TERMINATE AT TRANSITION isabisac15 --> Isabelle2017 --------------------------\
35.708 val SOME (t',_) = rewrite_set_ ctxt false cancel_p t'';
35.709 @@ -1138,7 +1138,7 @@
35.710 \--- DOES NOT TERMINATE AT TRANSITION isabisac15 --> Isabelle2017 --------------------------/*)
35.711
35.712 (*------- Schalk I, p.68 Nr. 437b*)
35.713 -val t = TermC.parse_test @{context} "(a + b)/(x \<up> 2 - y \<up> 2) * ((x - y) \<up> 2/(a \<up> 2 - b \<up> 2))";
35.714 +val t = ParseC.parse_test @{context} "(a + b)/(x \<up> 2 - y \<up> 2) * ((x - y) \<up> 2/(a \<up> 2 - b \<up> 2))";
35.715 (*val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.716 :
35.717 #### rls: cancel_p on: (a * x \<up> 2 + - 2 * (a * (x * y)) + a * y \<up> 2 + b * x \<up> 2 +
35.718 @@ -1150,25 +1150,25 @@
35.719 *)
35.720
35.721 (*------- SRM Schalk I, p.68 Nr. 438a *)
35.722 -val t = TermC.parse_test @{context} "x*y / (x*y - y \<up> 2) * (x \<up> 2 - x*y)";
35.723 +val t = ParseC.parse_test @{context} "x*y / (x*y - y \<up> 2) * (x \<up> 2 - x*y)";
35.724 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.725 if UnparseC.term t = "x \<up> 2"
35.726 then () else error "rational.sml: diff.behav. in norm_Rational_mg 24";
35.727
35.728 (*------- SRM Schalk I, p.68 Nr. 439b *)
35.729 -val t = TermC.parse_test @{context} "(4*x \<up> 2 + 4*x + 1) * ((x \<up> 2 - 2*x \<up> 3) / (4*x \<up> 2 + 2*x))";
35.730 +val t = ParseC.parse_test @{context} "(4*x \<up> 2 + 4*x + 1) * ((x \<up> 2 - 2*x \<up> 3) / (4*x \<up> 2 + 2*x))";
35.731 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.732 if UnparseC.term t = "(x + - 4 * x \<up> 3) / 2"
35.733 then () else error "rational.sml: diff.behav. in norm_Rational_mg 25";
35.734
35.735 (*------- SRM Schalk I, p.68 Nr. 440a *)
35.736 -val t = TermC.parse_test @{context} "(x \<up> 2 - 2*x) / (x \<up> 2 - 3*x) * (x - 3) \<up> 2 / (x \<up> 2 - 4)";
35.737 +val t = ParseC.parse_test @{context} "(x \<up> 2 - 2*x) / (x \<up> 2 - 3*x) * (x - 3) \<up> 2 / (x \<up> 2 - 4)";
35.738 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.739 if UnparseC.term t = "(- 3 + x) / (2 + x)"
35.740 then () else error "rational.sml: diff.behav. in norm_Rational_mg 26";
35.741
35.742 "----- Schalk I, p.68 Nr. 440b SK11 works since 0707xx";
35.743 -val t = TermC.parse_test @{context} "(a \<up> 3 - 9*a) / (a \<up> 3*b - a*b \<up> 3) * (a \<up> 2*b + a*b \<up> 2) / (a+3)";
35.744 +val t = ParseC.parse_test @{context} "(a \<up> 3 - 9*a) / (a \<up> 3*b - a*b \<up> 3) * (a \<up> 2*b + a*b \<up> 2) / (a+3)";
35.745 (* WN130911 non-termination for unclear reasons:
35.746 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.747
35.748 @@ -1179,7 +1179,7 @@
35.749 (a \<up> 3 * b + - 1 * (a * b \<up> 3)) /
35.750 (3 + a)
35.751 BUT THIS IS CORRECTLY RECOGNISED
35.752 -val t = TermC.parse_test @{context}
35.753 +val t = ParseC.parse_test @{context}
35.754 ("(-9 * (a \<up> 3 * b) + -9 * (a \<up> 2 * b \<up> 2) + a \<up> 5 * b + a \<up> 4 * b \<up> 2) /" ^
35.755 "(a \<up> 3 * b + - 1 * (a * b \<up> 3)) / (3 + (a::real))");
35.756 AS
35.757 @@ -1190,9 +1190,9 @@
35.758 *)
35.759
35.760 "----- SK12 works since 0707xx";
35.761 -val t = TermC.parse_test @{context} "(a \<up> 3 - 9*a) * (a \<up> 2*b+a*b \<up> 2) / ((a \<up> 3*b - a*b \<up> 3) * (a+3))";
35.762 +val t = ParseC.parse_test @{context} "(a \<up> 3 - 9*a) * (a \<up> 2*b+a*b \<up> 2) / ((a \<up> 3*b - a*b \<up> 3) * (a+3))";
35.763 (* WN130911 non-termination due to non-termination of
35.764 - cancel_p_ thy (TermC.parse_test @{context} "(4 + -4 * b \<up> 2) / (a \<up> 4 + - 2 * (a \<up> 2 * b \<up> 2) + b \<up> 4)")
35.765 + cancel_p_ thy (ParseC.parse_test @{context} "(4 + -4 * b \<up> 2) / (a \<up> 4 + - 2 * (a \<up> 2 * b \<up> 2) + b \<up> 4)")
35.766
35.767 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.768 if UnparseC.term t' = "(-3 * a + a \<up> 2) / (a + - 1 * b)" then ()
35.769 @@ -1203,53 +1203,53 @@
35.770 "-------- examples common denominator and multiplication from: Schalk --------";
35.771 "-------- examples common denominator and multiplication from: Schalk --------";
35.772 (*------- SRAM Schalk I, p.69 Nr. 441b *)
35.773 -val t = TermC.parse_test @{context} "(4*a/3 + 3*b \<up> 2/a \<up> 3 + b/(4*a))*(4*b/(3*a))";
35.774 +val t = ParseC.parse_test @{context} "(4*a/3 + 3*b \<up> 2/a \<up> 3 + b/(4*a))*(4*b/(3*a))";
35.775 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.776 if UnparseC.term t = "(36 * b \<up> 3 + 3 * a \<up> 2 * b \<up> 2 + 16 * a \<up> 4 * b) /\n(9 * a \<up> 4)"
35.777 then () else error "rational.sml: diff.behav. in norm_Rational_mg 28";
35.778
35.779 (*------- SRAM Schalk I, p.69 Nr. 442b *)
35.780 -val t = TermC.parse_test @{context} ("(15*a \<up> 2/x \<up> 3 - 5*b \<up> 4/x \<up> 2 + 25*c \<up> 2/x) * " ^
35.781 +val t = ParseC.parse_test @{context} ("(15*a \<up> 2/x \<up> 3 - 5*b \<up> 4/x \<up> 2 + 25*c \<up> 2/x) * " ^
35.782 "(x \<up> 3/(5*a*b \<up> 3*c \<up> 3)) + 1/c \<up> 3 * (b*x/a - 3*a/b \<up> 3)");
35.783 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.784 if UnparseC.term t = "5 * x \<up> 2 / (a * b \<up> 3 * c)"
35.785 then () else error "rational.sml: diff.behav. in norm_Rational_mg 29";
35.786
35.787 (*------- SRAM Schalk I, p.69 Nr. 443b *)
35.788 -val t = TermC.parse_test @{context} "(a/2 + b/3) * (b/3 - a/2)";
35.789 +val t = ParseC.parse_test @{context} "(a/2 + b/3) * (b/3 - a/2)";
35.790 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.791 if UnparseC.term t = "(- 9 * a \<up> 2 + 4 * b \<up> 2) / 36"
35.792 then () else error "rational.sml: diff.behav. in norm_Rational_mg 30";
35.793
35.794 (*------- SRAM Schalk I, p.69 Nr. 445b *)
35.795 -val t = TermC.parse_test @{context} "(a \<up> 2/9 + 2*a/(3*b) + 4/b \<up> 2)*(a/3 - 2/b) + 8/b \<up> 3";
35.796 +val t = ParseC.parse_test @{context} "(a \<up> 2/9 + 2*a/(3*b) + 4/b \<up> 2)*(a/3 - 2/b) + 8/b \<up> 3";
35.797 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.798 if UnparseC.term t = "a \<up> 3 / 27"
35.799 then () else error "rational.sml: diff.behav. in norm_Rational_mg 31";
35.800
35.801 (*------- SRAM Schalk I, p.69 Nr. 446b *)
35.802 -val t = TermC.parse_test @{context} "(x/(5*x + 4*y) - y/(5*x - 4*y) + 1)*(25*x \<up> 2 - 16*y \<up> 2)";
35.803 +val t = ParseC.parse_test @{context} "(x/(5*x + 4*y) - y/(5*x - 4*y) + 1)*(25*x \<up> 2 - 16*y \<up> 2)";
35.804 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.805 if UnparseC.term t = (*"30 * x \<up> 2 + -9 * x * y + - 20 * y \<up> 2" ..isabisac15 | Isabelle2017..*)
35.806 "(- 30 * x \<up> 2 + 9 * x * y + 20 * y \<up> 2) / - 1"
35.807 then () else error "rational.sml: diff.behav. in norm_Rational_mg 32";
35.808
35.809 (*------- SRAM Schalk I, p.69 Nr. 449a *)(*Achtung: rechnet ca 8 Sekunden*)
35.810 -val t = TermC.parse_test @{context}
35.811 +val t = ParseC.parse_test @{context}
35.812 "(2*x \<up> 2/(3*y)+x/y \<up> 2)*(4*x \<up> 4/(9*y \<up> 2)+x \<up> 2/y \<up> 4)*(2*x \<up> 2/(3*y) - x/y \<up> 2)";
35.813 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.814 if UnparseC.term t = "(- 81 * x \<up> 4 + 16 * x \<up> 8 * y \<up> 4) / (81 * y \<up> 8)"
35.815 then () else error "rational.sml: diff.behav. in norm_Rational_mg 33";
35.816
35.817 (*------- SRAM Schalk I, p.69 Nr. 450a *)
35.818 -val t = TermC.parse_test @{context}
35.819 +val t = ParseC.parse_test @{context}
35.820 "(4*x/(3*y)+2*y/(3*x)) \<up> 2 - (2*y/(3*x) - 2*x/y)*(2*y/(3*x)+2*x/y)";
35.821 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.822 if UnparseC.term t = "(52 * x \<up> 2 + 16 * y \<up> 2) / (9 * y \<up> 2)"
35.823 then () else error "rational.sml: diff.behav. in norm_Rational_mg 34";
35.824
35.825 (*------- SRAM Schalk I, p.69 Nr. 442b --- abgewandelt*)
35.826 -val t = TermC.parse_test @{context}
35.827 +val t = ParseC.parse_test @{context}
35.828 ("(15*a \<up> 4/(a*x \<up> 3) - 5*a*((b \<up> 4 - 5*c \<up> 2*x) / x \<up> 2)) * " ^
35.829 "(x \<up> 3/(5*a*b \<up> 3*c \<up> 3)) + a/c \<up> 3 * (x*(b/a) - 3*b*(a/b \<up> 4))");
35.830 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.831 @@ -1261,21 +1261,21 @@
35.832 "-------- examples double fractions from: Mathematik 1 Schalk ----------------";
35.833 "-------- examples double fractions from: Mathematik 1 Schalk ----------------";
35.834 "----- SRD Schalk I, p.69 Nr. 454b";
35.835 -val t = TermC.parse_test @{context} "((2 - x)/(2*a)) / (2*a/(x - 2))";
35.836 +val t = ParseC.parse_test @{context} "((2 - x)/(2*a)) / (2*a/(x - 2))";
35.837 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.838 if UnparseC.term t = "(- 4 + 4 * x + - 1 * x \<up> 2) / (4 * a \<up> 2)"
35.839 then () else error "rational.sml: diff.behav. in norm_Rational_mg 35";
35.840
35.841 "----- SRD Schalk I, p.69 Nr. 455a";
35.842 -val t = TermC.parse_test @{context} "(a \<up> 2 + 1)/(a \<up> 2 - 1) / ((a+1)/(a - 1))";
35.843 +val t = ParseC.parse_test @{context} "(a \<up> 2 + 1)/(a \<up> 2 - 1) / ((a+1)/(a - 1))";
35.844 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.845 if UnparseC.term t = "(1 + a \<up> 2) / (1 + 2 * a + a \<up> 2)" then ()
35.846 else error "rational.sml: diff.behav. in norm_Rational_mg 36";
35.847
35.848 "----- Schalk I, p.69 Nr. 455b";
35.849 -val t = TermC.parse_test @{context} "(x \<up> 2 - 4)/(y \<up> 2 - 9)/((2+x)/(3 - y))";
35.850 +val t = ParseC.parse_test @{context} "(x \<up> 2 - 4)/(y \<up> 2 - 9)/((2+x)/(3 - y))";
35.851 (* WN130911 non-termination due to non-termination of
35.852 - cancel_p_ thy (TermC.parse_test @{context} ("(- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /" ^
35.853 + cancel_p_ thy (ParseC.parse_test @{context} ("(- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /" ^
35.854 "(- 18 + -9 * x + 2 * y \<up> 2 + x * y \<up> 2)"))
35.855
35.856 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.857 @@ -1284,9 +1284,9 @@
35.858 *)
35.859
35.860 "----- SK060904- 1a non-termination of cancel_p_ ?: worked before 0707xx";
35.861 -val t = TermC.parse_test @{context} "(x \<up> 2 - 4)*(3 - y) / ((y \<up> 2 - 9)*(2+x))";
35.862 +val t = ParseC.parse_test @{context} "(x \<up> 2 - 4)*(3 - y) / ((y \<up> 2 - 9)*(2+x))";
35.863 (* WN130911 non-termination due to non-termination of
35.864 - cancel_p_ thy (TermC.parse_test @{context} ("(- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /" ^
35.865 + cancel_p_ thy (ParseC.parse_test @{context} ("(- 12 + 4 * y + 3 * x \<up> 2 + - 1 * (x \<up> 2 * y)) /" ^
35.866 "(- 18 + -9 * x + 2 * y \<up> 2 + x * y \<up> 2)"))
35.867
35.868 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.869 @@ -1295,25 +1295,25 @@
35.870 *)
35.871
35.872 "----- ?: worked before 0707xx";
35.873 -val t = TermC.parse_test @{context} "(3 + - 1 * y) / (-9 + y \<up> 2)";
35.874 +val t = ParseC.parse_test @{context} "(3 + - 1 * y) / (-9 + y \<up> 2)";
35.875 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.876 if UnparseC.term t = "- 1 / (3 + y)"
35.877 then () else error "rational.sml: - 1 / (3 + y) norm_Rational";
35.878
35.879 "----- SRD Schalk I, p.69 Nr. 456b";
35.880 -val t = TermC.parse_test @{context} "(b \<up> 3 - b \<up> 2) / (b \<up> 2+b) / (b \<up> 2 - 1)";
35.881 +val t = ParseC.parse_test @{context} "(b \<up> 3 - b \<up> 2) / (b \<up> 2+b) / (b \<up> 2 - 1)";
35.882 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.883 if UnparseC.term t = "b / (1 + 2 * b + b \<up> 2)"
35.884 then () else error "rational.sml: diff.behav. in norm_Rational_mg 38";
35.885
35.886 "----- SRD Schalk I, p.69 Nr. 457b";
35.887 -val t = TermC.parse_test @{context} "(16*a \<up> 2 - 9*b \<up> 2)/(2*a+3*a*b) / ((4*a+3*b)/(4*a \<up> 2 - 9*a \<up> 2*b \<up> 2))";
35.888 +val t = ParseC.parse_test @{context} "(16*a \<up> 2 - 9*b \<up> 2)/(2*a+3*a*b) / ((4*a+3*b)/(4*a \<up> 2 - 9*a \<up> 2*b \<up> 2))";
35.889 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.890 if UnparseC.term t = "8 * a \<up> 2 + - 6 * a * b + - 12 * a \<up> 2 * b + 9 * a * b \<up> 2"
35.891 then () else error "rational.sml: diff.behav. in norm_Rational_mg 39";
35.892
35.893 "----- Schalk I, p.69 Nr. 458b works since 0707";
35.894 -val t = TermC.parse_test @{context} "(2*a \<up> 2*x - a \<up> 2) / (a*x - b*x) / (b \<up> 2*(2*x - 1) / (x*(a - b)))";
35.895 +val t = ParseC.parse_test @{context} "(2*a \<up> 2*x - a \<up> 2) / (a*x - b*x) / (b \<up> 2*(2*x - 1) / (x*(a - b)))";
35.896 (*val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.897 :
35.898 ### rls: cancel_p on: (- 1 * a \<up> 2 + 2 * (a \<up> 2 * x)) / (a * x + - 1 * (b * x)) /
35.899 @@ -1321,7 +1321,7 @@
35.900 exception Div raised
35.901
35.902 BUT
35.903 -val t = TermC.parse_test @{context}
35.904 +val t = ParseC.parse_test @{context}
35.905 ("(- 1 * a \<up> 2 + 2 * (a \<up> 2 * x)) / (a * x + - 1 * (b * x)) /" ^
35.906 "((- 1 * b \<up> 2 + 2 * (b \<up> 2 * x)) / (a * x + - 1 * (b * x)))");
35.907 NONE = cancel_p_ thy t;
35.908 @@ -1331,18 +1331,18 @@
35.909 *)
35.910
35.911 "----- SRD Schalk I, p.69 Nr. 459b";
35.912 -val t = TermC.parse_test @{context} "(a \<up> 2 - b \<up> 2)/(a*b) / (4*(a+b) \<up> 2/a)";
35.913 +val t = ParseC.parse_test @{context} "(a \<up> 2 - b \<up> 2)/(a*b) / (4*(a+b) \<up> 2/a)";
35.914 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.915 if UnparseC.term t = "(a + - 1 * b) / (4 * a * b + 4 * b \<up> 2)" then ()
35.916 else error "rational.sml: diff.behav. in norm_Rational_mg 41";
35.917
35.918 "----- Schalk I, p.69 Nr. 460b nonterm.SK";
35.919 -val t = TermC.parse_test @{context} "(9*(x \<up> 2 - 8*x + 16) / (4*(y \<up> 2 - 2*y + 1))) / ((3*x - 12) / (16*y - 16))";
35.920 +val t = ParseC.parse_test @{context} "(9*(x \<up> 2 - 8*x + 16) / (4*(y \<up> 2 - 2*y + 1))) / ((3*x - 12) / (16*y - 16))";
35.921 (*val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.922 exception Div raised
35.923
35.924 BUT
35.925 -val t = TermC.parse_test @{context}
35.926 +val t = ParseC.parse_test @{context}
35.927 ("(144 + -72 * x + 9 * x \<up> 2) / (4 + -8 * y + 4 * y \<up> 2) /" ^
35.928 "((- 12 + 3 * x) / (- 16 + 16 * y))");
35.929 NONE = cancel_p_ thy t;
35.930 @@ -1352,40 +1352,40 @@
35.931 *)
35.932
35.933 "----- some variant of the above; was non-terminating before";
35.934 -val t = TermC.parse_test @{context} "9*(x \<up> 2 - 8*x+16)*(16*y - 16)/(4*(y \<up> 2 - 2*y+1)*(3*x - 12))";
35.935 +val t = ParseC.parse_test @{context} "9*(x \<up> 2 - 8*x+16)*(16*y - 16)/(4*(y \<up> 2 - 2*y+1)*(3*x - 12))";
35.936 val SOME (t , _) = rewrite_set_ ctxt false norm_Rational t;
35.937 if UnparseC.term t = "(48 + - 12 * x) / (1 + - 1 * y)"
35.938 then () else error "some variant of the above; was non-terminating before";
35.939
35.940 "----- SRD Schalk I, p.70 Nr. 472a";
35.941 -val t = TermC.parse_test @{context} ("((8*x \<up> 2 - 32*y \<up> 2) / (2*x + 4*y)) / ((4*x - 8*y) / (x + y))");
35.942 +val t = ParseC.parse_test @{context} ("((8*x \<up> 2 - 32*y \<up> 2) / (2*x + 4*y)) / ((4*x - 8*y) / (x + y))");
35.943 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.944 if UnparseC.term t = "x + y"
35.945 then () else error "rational.sml: diff.behav. in norm_Rational_mg 43";
35.946
35.947 "----- Schalk I, p.70 Nr. 478b ----- Rechenzeit: 5 sec";
35.948 -val t = TermC.parse_test @{context} ("(a - (a*b + b \<up> 2)/(a+b))/(b+(a - b)/(1+(a+b)/(a - b))) / " ^
35.949 +val t = ParseC.parse_test @{context} ("(a - (a*b + b \<up> 2)/(a+b))/(b+(a - b)/(1+(a+b)/(a - b))) / " ^
35.950 "((a - a \<up> 2/(a+b))/(a+(a*b)/(a - b)))");
35.951 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.952 if UnparseC.term t = "(2 * a \<up> 3 + 2 * a \<up> 2 * b) / (a \<up> 2 * b + b \<up> 3)"
35.953 then () else error "rational.sml: diff.behav. in norm_Rational_mg 51";
35.954
35.955 (*SRD Schalk I, p.69 Nr. 461a *)
35.956 -val t = TermC.parse_test @{context} "(2/(x+3) + 2/(x - 3)) / (8*x/(x \<up> 2 - 9))";
35.957 +val t = ParseC.parse_test @{context} "(2/(x+3) + 2/(x - 3)) / (8*x/(x \<up> 2 - 9))";
35.958 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.959 if UnparseC.term t = "1 / 2"
35.960 then () else error "rational.sml: diff.behav. in norm_Rational_mg 44";
35.961
35.962 (*SRD Schalk I, p.69 Nr. 464b *)
35.963 -val t = TermC.parse_test @{context} "(a - a/(a - 2)) / (a + a/(a - 2))";
35.964 +val t = ParseC.parse_test @{context} "(a - a/(a - 2)) / (a + a/(a - 2))";
35.965 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.966 if UnparseC.term t = "(- 3 + a) / (- 1 + a)"
35.967 then () else error "rational.sml: diff.behav. in norm_Rational_mg 45";
35.968
35.969 (*SRD Schalk I, p.69 Nr. 465b *)
35.970 -val t = TermC.parse_test @{context} "((x+3*y)/9 + (4*y \<up> 2 - 9*z \<up> 2)/(16*x)) / (x/9 + y/6 + z/4)";
35.971 +val t = ParseC.parse_test @{context} "((x+3*y)/9 + (4*y \<up> 2 - 9*z \<up> 2)/(16*x)) / (x/9 + y/6 + z/4)";
35.972 (* WN130911 non-termination due to non-termination of
35.973 - cancel_p_ thy (TermC.parse_test @{context}
35.974 + cancel_p_ thy (ParseC.parse_test @{context}
35.975 ("("(576 * x \<up> 2 + 1728 * (x * y) + 1296 * y \<up> 2 + - 2916 * z \<up> 2) /" ^
35.976 "(576 * x \<up> 2 + 864 * (x * y) + 1296 * (x * z))"))
35.977
35.978 @@ -1395,13 +1395,13 @@
35.979 *)
35.980
35.981 (*SRD Schalk I, p.69 Nr. 466b *)
35.982 -val t = TermC.parse_test @{context} "((1 - 7*(x - 2)/(x \<up> 2 - 4)) / (6/(x+2))) / (3/(x+5)+30/(x \<up> 2 - 25))";
35.983 +val t = ParseC.parse_test @{context} "((1 - 7*(x - 2)/(x \<up> 2 - 4)) / (6/(x+2))) / (3/(x+5)+30/(x \<up> 2 - 25))";
35.984 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.985 if UnparseC.term t = "(25 + - 10 * x + x \<up> 2) / 18"
35.986 then () else error "rational.sml: diff.behav. in norm_Rational_mg 47";
35.987
35.988 (*SRD Schalk I, p.70 Nr. 469 *)
35.989 -val t = TermC.parse_test @{context} ("3*b \<up> 2 / (4*a \<up> 2 - 8*a*b + 4*b \<up> 2) / " ^
35.990 +val t = ParseC.parse_test @{context} ("3*b \<up> 2 / (4*a \<up> 2 - 8*a*b + 4*b \<up> 2) / " ^
35.991 "(a / (a \<up> 2*b - b \<up> 3) + (a - b) / (4*a*b \<up> 2 + 4*b \<up> 3) - 1 / (4*b \<up> 2))");
35.992 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.993 if UnparseC.term t = "- 3 * b \<up> 3 / (- 2 * a + 2 * b)"
35.994 @@ -1558,13 +1558,13 @@
35.995 "-------- investigate rulesets for cancel_p ----------------------------------";
35.996 "-------- investigate rulesets for cancel_p ----------------------------------";
35.997 val thy = @{theory "Rational"};
35.998 -val t = TermC.parse_test @{context} "(a \<up> 2 + - 1*b \<up> 2) / (a \<up> 2 + - 2*a*b + b \<up> 2)";
35.999 -val tt = TermC.parse_test @{context} "(1 * a + 1 * b) * (1 * a + - 1 * b)"(*numerator only*);
35.1000 +val t = ParseC.parse_test @{context} "(a \<up> 2 + - 1*b \<up> 2) / (a \<up> 2 + - 2*a*b + b \<up> 2)";
35.1001 +val tt = ParseC.parse_test @{context} "(1 * a + 1 * b) * (1 * a + - 1 * b)"(*numerator only*);
35.1002
35.1003 "----- with rewrite_set_";
35.1004 val SOME (tt',asm) = rewrite_set_ ctxt false make_polynomial tt;
35.1005 if UnparseC.term tt'= "a \<up> 2 + - 1 * b \<up> 2" then () else error "rls chancel_p 1";
35.1006 -val tt = TermC.parse_test @{context} "((1 * a + - 1 * b) * (1 * a + - 1 * b))"(*denominator only*);
35.1007 +val tt = ParseC.parse_test @{context} "((1 * a + - 1 * b) * (1 * a + - 1 * b))"(*denominator only*);
35.1008 val SOME (tt',asm) = rewrite_set_ ctxt false make_polynomial tt;
35.1009 if UnparseC.term tt' = "a \<up> 2 + - 2 * a * b + b \<up> 2" then () else error "rls chancel_p 2";
35.1010
35.1011 @@ -1585,12 +1585,12 @@
35.1012 (*default_print_depth 99;*) map ((UnparseC.term_in_ctxt ctxt) o #1 o #3) der; (*default_print_depth 3;*)
35.1013
35.1014 val der = Derive.do_one ctxt Atools_erls rules ro NONE
35.1015 - (TermC.parse_test @{context} "(1 * a + 1 * b) * (1 * a + - 1 * b)");
35.1016 + (ParseC.parse_test @{context} "(1 * a + 1 * b) * (1 * a + - 1 * b)");
35.1017 (*default_print_depth 99;*) writeln (Derive.deriv2str ctxt der); (*default_print_depth 3;*)
35.1018
35.1019 val {rules, rew_ord=(_,ro),...} = Rule_Set.rep (get_rls @{context} "rev_rew_p");
35.1020 val der = Derive.do_one ctxt Atools_erls rules ro NONE
35.1021 - (TermC.parse_test @{context} "(1 * a + - 1 * b) * (1 * a + - 1 * b)");
35.1022 + (ParseC.parse_test @{context} "(1 * a + - 1 * b) * (1 * a + - 1 * b)");
35.1023 (*default_print_depth 99;*) writeln (Derive.deriv2str ctxt der); (*default_print_depth 3;*)
35.1024 (*default_print_depth 99;*) map ((UnparseC.term_in_ctxt ctxt) o #1) der; (*default_print_depth 3;*)
35.1025 (*WN060829 ...postponed*)
35.1026 @@ -1638,21 +1638,21 @@
35.1027 "-------- WN1309xx non-terminating rls norm_Rational -------------------------";
35.1028 "-------- WN1309xx non-terminating rls norm_Rational -------------------------";
35.1029 (*------- Schalk I, p.70 Nr. 480b; a/b : c/d translated to a/b * d/c*)
35.1030 -val t = TermC.parse_test @{context}
35.1031 +val t = ParseC.parse_test @{context}
35.1032 ("((12*x*y / (9*x \<up> 2 - y \<up> 2)) / (1 / (3*x - y) \<up> 2 - 1 / (3*x + y) \<up> 2)) * " ^
35.1033 "((1/(x - 5*y) \<up> 2 - 1/(x + 5*y) \<up> 2) / (20*x*y / (x \<up> 2 - 25*y \<up> 2)))");
35.1034
35.1035 (*1st factor separately simplified *)
35.1036 -val t = TermC.parse_test @{context} "((12*x*y / (9*x \<up> 2 - y \<up> 2)) / (1 / (3*x - y) \<up> 2 - 1 / (3*x + y) \<up> 2))";
35.1037 +val t = ParseC.parse_test @{context} "((12*x*y / (9*x \<up> 2 - y \<up> 2)) / (1 / (3*x - y) \<up> 2 - 1 / (3*x + y) \<up> 2))";
35.1038 val SOME (t', _) = rewrite_set_ ctxt false norm_Rational t;
35.1039 if UnparseC.term t' = "(- 9 * x \<up> 2 + y \<up> 2) / - 1" then () else error "Nr. 480b lhs changed";
35.1040 (*2nd factor separately simplified *)
35.1041 -val t = TermC.parse_test @{context} "((1/(x - 5*y) \<up> 2 - 1/(x + 5*y) \<up> 2) / (20*x*y / (x \<up> 2 - 25*y \<up> 2)))";
35.1042 +val t = ParseC.parse_test @{context} "((1/(x - 5*y) \<up> 2 - 1/(x + 5*y) \<up> 2) / (20*x*y / (x \<up> 2 - 25*y \<up> 2)))";
35.1043 val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t; UnparseC.term t';
35.1044 if UnparseC.term t' = "- 1 / (- 1 * x \<up> 2 + 25 * y \<up> 2)" then () else error "Nr. 480b rhs changed";
35.1045
35.1046 "-------- Schalk I, p.70 Nr. 477a: terms are exploding ?!?";
35.1047 -val t = TermC.parse_test @{context} ("b*y/(b - 2*y)/((b \<up> 2 - y \<up> 2)/(b+2*y)) /" ^
35.1048 +val t = ParseC.parse_test @{context} ("b*y/(b - 2*y)/((b \<up> 2 - y \<up> 2)/(b+2*y)) /" ^
35.1049 "(b \<up> 2*y + b*y \<up> 2) * (a+x) \<up> 2 / ((b \<up> 2 - 4*y \<up> 2) * (a+2*x) \<up> 2)");
35.1050 (*val SOME (t',_) = rewrite_set_ ctxt false norm_Rational t;
35.1051 :
35.1052 @@ -1667,7 +1667,7 @@
35.1053 exception Div raised
35.1054
35.1055 BUT
35.1056 -val t = TermC.parse_test @{context}
35.1057 +val t = ParseC.parse_test @{context}
35.1058 ("(a \<up> 2 * (b * y) + 2 * (a * (b * (x * y))) + b * (x \<up> 2 * y)) /" ^
35.1059 "(b + - 2 * y) /" ^
35.1060 "((b \<up> 2 + - 1 * y \<up> 2) / (b + 2 * y)) /" ^
35.1061 @@ -1680,7 +1680,7 @@
35.1062 *)
35.1063
35.1064 (*------- Schalk I, p.70 Nr. 476b in 2003 this worked using 10 sec. *)
35.1065 -val t = TermC.parse_test @{context}
35.1066 +val t = ParseC.parse_test @{context}
35.1067 ("((a \<up> 2 - b \<up> 2)/(2*a*b) + 2*a*b/(a \<up> 2 - b \<up> 2)) / ((a \<up> 2 + b \<up> 2)/(2*a*b) + 1) / " ^
35.1068 "((a \<up> 2 + b \<up> 2) \<up> 2 / (a + b) \<up> 2)");
35.1069 (* Rewrite.trace_on := true; (*true false*)
35.1070 @@ -1704,7 +1704,7 @@
35.1071 *)
35.1072
35.1073 "-------- Schalk I, p.70 Nr. 480a: terms are exploding ?!?";
35.1074 -val t = TermC.parse_test @{context} ("(1/x + 1/y + 1/z) / (1/x - 1/y - 1/z) / " ^
35.1075 +val t = ParseC.parse_test @{context} ("(1/x + 1/y + 1/z) / (1/x - 1/y - 1/z) / " ^
35.1076 "(2*x \<up> 2 / (x \<up> 2 - z \<up> 2) / (x / (x + z) + x / (x - z)))");
35.1077 (* Rewrite.trace_on := true; (*true false*)
35.1078 rewrite_set_ ctxt false norm_Rational t;
35.1079 @@ -1722,14 +1722,14 @@
35.1080 *)
35.1081
35.1082 "-------- Schalk I, p.60 Nr. 215d: terms are exploding, internal loop does not terminate";
35.1083 -val t = TermC.parse_test @{context} "(a-b) \<up> 3 * (x+y) \<up> 4 / ((x+y) \<up> 2 * (a-b) \<up> 5)";
35.1084 +val t = ParseC.parse_test @{context} "(a-b) \<up> 3 * (x+y) \<up> 4 / ((x+y) \<up> 2 * (a-b) \<up> 5)";
35.1085 (* Kein Wunder, denn Z???ler und Nenner extra als Polynom dargestellt ergibt:
35.1086
35.1087 -val t = TermC.parse_test @{context} "(a-b) \<up> 3 * (x+y) \<up> 4";
35.1088 +val t = ParseC.parse_test @{context} "(a-b) \<up> 3 * (x+y) \<up> 4";
35.1089 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.1090 UnparseC.term t;
35.1091 "a \<up> 3 * x \<up> 4 + 4 * a \<up> 3 * x \<up> 3 * y +6 * a \<up> 3 * x \<up> 2 * y \<up> 2 +4 * a \<up> 3 * x * y \<up> 3 +a \<up> 3 * y \<up> 4 +-3 * a \<up> 2 * b * x \<up> 4 +- 12 * a \<up> 2 * b * x \<up> 3 * y +- 18 * a \<up> 2 * b * x \<up> 2 * y \<up> 2 +- 12 * a \<up> 2 * b * x * y \<up> 3 +-3 * a \<up> 2 * b * y \<up> 4 +3 * a * b \<up> 2 * x \<up> 4 +12 * a * b \<up> 2 * x \<up> 3 * y +18 * a * b \<up> 2 * x \<up> 2 * y \<up> 2 +12 * a * b \<up> 2 * x * y \<up> 3 +3 * a * b \<up> 2 * y \<up> 4 +- 1 * b \<up> 3 * x \<up> 4 +-4 * b \<up> 3 * x \<up> 3 * y +-6 * b \<up> 3 * x \<up> 2 * y \<up> 2 +-4 * b \<up> 3 * x * y \<up> 3 +- 1 * b \<up> 3 * y \<up> 4";
35.1092 -val t = TermC.parse_test @{context} "((x+y) \<up> 2 * (a-b) \<up> 5)";
35.1093 +val t = ParseC.parse_test @{context} "((x+y) \<up> 2 * (a-b) \<up> 5)";
35.1094 val SOME (t, _) = rewrite_set_ ctxt false norm_Rational t;
35.1095 UnparseC.term t;
35.1096 "a \<up> 5 * x \<up> 2 + 2 * a \<up> 5 * x * y + a \<up> 5 * y \<up> 2 +-5 * a \<up> 4 * b * x \<up> 2 +- 10 * a \<up> 4 * b * x * y +-5 * a \<up> 4 * b * y \<up> 2 +10 * a \<up> 3 * b \<up> 2 * x \<up> 2 +20 * a \<up> 3 * b \<up> 2 * x * y +10 * a \<up> 3 * b \<up> 2 * y \<up> 2 +- 10 * a \<up> 2 * b \<up> 3 * x \<up> 2 +- 20 * a \<up> 2 * b \<up> 3 * x * y +- 10 * a \<up> 2 * b \<up> 3 * y \<up> 2 +5 * a * b \<up> 4 * x \<up> 2 +10 * a * b \<up> 4 * x * y +5 * a * b \<up> 4 * y \<up> 2 +- 1 * b \<up> 5 * x \<up> 2 +- 2 * b \<up> 5 * x * y +- 1 * b \<up> 5 * y \<up> 2";
35.1097 @@ -1737,7 +1737,7 @@
35.1098 anscheinend macht dem Rechner das Krzen diese Bruches keinen Spass mehr ...*)
35.1099
35.1100 "-------- Schalk I, p.70 Nr. 480b: terms are exploding, Rewrite.trace_on stops at";
35.1101 -val t = TermC.parse_test @{context} ("((12*x*y/(9*x \<up> 2 - y \<up> 2))/" ^
35.1102 +val t = ParseC.parse_test @{context} ("((12*x*y/(9*x \<up> 2 - y \<up> 2))/" ^
35.1103 "(1/(3*x - y) \<up> 2 - 1/(3*x + y) \<up> 2)) *" ^
35.1104 "(1/(x - 5*y) \<up> 2 - 1/(x + 5*y) \<up> 2)/" ^
35.1105 "(20*x*y/(x \<up> 2 - 25*y \<up> 2))");
36.1 --- a/test/Tools/isac/Knowledge/rlang.sml Sun Jan 29 14:31:56 2023 +0100
36.2 +++ b/test/Tools/isac/Knowledge/rlang.sml Mon Jan 30 09:47:18 2023 +0100
36.3 @@ -193,8 +193,8 @@
36.4 [ (bdv, v) ] make_ratpoly_in t;
36.5 if UnparseC.term t' = "3 / 5 * x" then () else error "rlang.sml: 1";
36.6
36.7 -val t = TermC.parse_test @{context} "(3*x+5)/18 - x/2 - -(3*x - 2)/9 = 0";
36.8 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
36.9 +val t = ParseC.parse_test @{context} "(3*x+5)/18 - x/2 - -(3*x - 2)/9 = 0";
36.10 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
36.11 val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
36.12 if UnparseC.term t' = "1 / 18 = 0" then () else error "rlang.sml: 2";
36.13 (*WN---^ *)
36.14 @@ -226,8 +226,8 @@
36.15
36.16
36.17 (*WN---v *)
36.18 -val t = TermC.parse_test @{context} "(17*x - 51)/9 - (-(13*x - 3)/6) + 11 - (9*x - 7)/4 = 0";
36.19 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
36.20 +val t = ParseC.parse_test @{context} "(17*x - 51)/9 - (-(13*x - 3)/6) + 11 - (9*x - 7)/4 = 0";
36.21 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
36.22 val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
36.23 UnparseC.term t';
36.24 if UnparseC.term t' = "79 / 12 + 65 / 36 * x = 0" then ()
36.25 @@ -338,14 +338,14 @@
36.26 | _ => error "rlang.sml: diff.behav. in Schalk I s.87 Bsp 44a [x = 1]";
36.27
36.28 (*WN---v *)
36.29 -val t = TermC.parse_test @{context} "(1/2 + (5*x)/2) \<up> 2 - ((13*x)/2 - 5/2) \<up> 2 - (6*x) \<up> 2 + 29";
36.30 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
36.31 +val t = ParseC.parse_test @{context} "(1/2 + (5*x)/2) \<up> 2 - ((13*x)/2 - 5/2) \<up> 2 - (6*x) \<up> 2 + 29";
36.32 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
36.33 val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
36.34 if UnparseC.term t' = "23 + 35 * x + -72 * x \<up> 2" then ()
36.35 else error "rlang.sml: 4";
36.36
36.37 -val t = TermC.parse_test @{context} "(1/2 + (5*x)/2) \<up> 2 - ((13*x)/2 - 5/2) \<up> 2 + (6*x) \<up> 2 - 29";
36.38 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
36.39 +val t = ParseC.parse_test @{context} "(1/2 + (5*x)/2) \<up> 2 - ((13*x)/2 - 5/2) \<up> 2 + (6*x) \<up> 2 - 29";
36.40 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
36.41 val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
36.42 if UnparseC.term t' = "-35 + 35 * x" then ()
36.43 else error "rlang.sml: 4.1";
36.44 @@ -486,7 +486,7 @@
36.45 "[v = (u * v0 + v0 * w + - 1 * f * w) / f]")) => ()
36.46 | _ => error "rlang.sml: diff.behav. in Schalk I s.89 Bsp 90a (1) [v=...]";
36.47 if Ctree.get_assumptions pt p =
36.48 - [TermC.parse_test @{context}"(u * v0 + v0 * w + - 1 * f * w) / f + w ~= 0"] then ()
36.49 + [ParseC.parse_test @{context}"(u * v0 + v0 * w + - 1 * f * w) / f + w ~= 0"] then ()
36.50 else error "rlang.sml: diff.behav. in I s.89 Bsp 90a (1) [v=...] asm";
36.51
36.52
36.53 @@ -530,8 +530,8 @@
36.54 case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[w = (u * v0 + - 1 * f * v) / (f + - 1 * v0)]")) => ()
36.55 | _ => error "rlang.sml: diff.behav. in Schalk I Bsp 90a(2)";
36.56 if Ctree.get_assumptions pt p =
36.57 -[TermC.parse_test @{context}"v + (u * v0 + - 1 * f * v) / (f + - 1 * v0) ~= 0",
36.58 - TermC.parse_test @{context}"f + - 1 * v0 ~= 0"]
36.59 +[ParseC.parse_test @{context}"v + (u * v0 + - 1 * f * v) / (f + - 1 * v0) ~= 0",
36.60 + ParseC.parse_test @{context}"f + - 1 * v0 ~= 0"]
36.61 then writeln "asm should be simplified ???"
36.62 else error "rlang.sml: diff.behav. in Schalk I Bsp 90a(2) asm";
36.63
36.64 @@ -571,9 +571,9 @@
36.65 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
36.66 case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[R1 = R * R2 / (R2 + - 1 * R)]")) => ()
36.67 | _ => error "rlang.sml: diff.behav. in 98a(1) [R1 = ...]";
36.68 -if Ctree.get_assumptions pt p = [TermC.parse_test @{context}"R * R2 * R2 ~= (R2 + - 1 * R) * 0",
36.69 - TermC.parse_test @{context}"R2 + - 1 * R ~= 0",
36.70 - TermC.parse_test @{context}"R2 + - 1 * R ~= 0"]
36.71 +if Ctree.get_assumptions pt p = [ParseC.parse_test @{context}"R * R2 * R2 ~= (R2 + - 1 * R) * 0",
36.72 + ParseC.parse_test @{context}"R2 + - 1 * R ~= 0",
36.73 + ParseC.parse_test @{context}"R2 + - 1 * R ~= 0"]
36.74 then writeln "asm should be simplified"
36.75 else error "rlang.sml: diff.behav. in 98a(1) asm";
36.76
36.77 @@ -602,7 +602,7 @@
36.78 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
36.79 case f of Form' (Test_Out.FormKF (_,_,0,_,"[p = y \<up> 2 / (2 * x)]")) => ()
36.80 | _ => error "rlang.sml: diff.behav. in Schalk I s.89 Bsp 104a (1) [p = y^2/(2*x)]";
36.81 -if Ctree.get_assumptions pt p = [TermC.parse_test @{context}"- 2 * x ~= 0"]
36.82 +if Ctree.get_assumptions pt p = [ParseC.parse_test @{context}"- 2 * x ~= 0"]
36.83 then writeln"should be x ~= 0\nshould be x ~= 0\nshould be x ~= 0\n"
36.84 else error "rlang.sml: diff.behav. in I s.89 Bsp 104a(1) asm";
36.85
36.86 @@ -632,8 +632,8 @@
36.87 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
36.88 case f of Form' (Test_Out.FormKF (_,_,0,_,"[y = sqrt (2 * p * x), y = - 1 * sqrt (2 * p * x)]")) => ()
36.89 | _ => error "rlang.sml: diff.behav. Schalk I s.89 Bsp 104a(2) [x = ]";
36.90 -if Ctree.get_assumptions pt p = [TermC.parse_test @{context}"0 <= - 1 * (- 2 * p * x)",
36.91 - TermC.parse_test @{context}"0 <= - 1 * (- 2 * p * x)"]
36.92 +if Ctree.get_assumptions pt p = [ParseC.parse_test @{context}"0 <= - 1 * (- 2 * p * x)",
36.93 + ParseC.parse_test @{context}"0 <= - 1 * (- 2 * p * x)"]
36.94 then writeln "asm should be simplified\nshould be simplified"
36.95 else error "rlang.sml: diff.behav. in I s.89 Bsp 104a(2) asm";
36.96
36.97 @@ -678,10 +678,10 @@
36.98 | _ => error "rlang.sml: diff.behav. in Schalk I s.89 Bsp 118a(2) [x = ]";
36.99 val asms = Ctree.get_assumptions pt p;
36.100 if asms =
36.101 - [TermC.parse_test @{context}"0 * b \<up> 2 <= - 1 * (a \<up> 2 * y \<up> 2 + - 1 * a \<up> 2 * b \<up> 2)",
36.102 - TermC.parse_test @{context}"b \<up> 2 ~= 0",
36.103 - TermC.parse_test @{context}"0 * b \<up> 2 <= - 1 * (a \<up> 2 * y \<up> 2 + - 1 * a \<up> 2 * b \<up> 2)",
36.104 - TermC.parse_test @{context}"b \<up> 2 ~= 0"] then writeln"should be simplified MG"
36.105 + [ParseC.parse_test @{context}"0 * b \<up> 2 <= - 1 * (a \<up> 2 * y \<up> 2 + - 1 * a \<up> 2 * b \<up> 2)",
36.106 + ParseC.parse_test @{context}"b \<up> 2 ~= 0",
36.107 + ParseC.parse_test @{context}"0 * b \<up> 2 <= - 1 * (a \<up> 2 * y \<up> 2 + - 1 * a \<up> 2 * b \<up> 2)",
36.108 + ParseC.parse_test @{context}"b \<up> 2 ~= 0"] then writeln"should be simplified MG"
36.109 else error "rlang.sml: diff.behav. in Schalk I s.89 Bsp 118a(2) asms";
36.110
36.111 (*----------------- Schalk I s.102 Bsp 268(1) ------------------------*)
36.112 @@ -709,7 +709,7 @@
36.113 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
36.114 case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[x2 =\n (- 2 * A + x1 * y2 + x3 * y1 + - 1 * x1 * y3 + - 1 * x3 * y2) /\n (y1 + - 1 * y3)]")) => ()
36.115 | _ => error "rlang.sml: diff.behav. Schalk I s.102 Bsp 268(1) [x2=...]";
36.116 -if Ctree.get_assumptions pt p = [TermC.parse_test @{context}"y1 / 2 + - 1 * y3 / 2 ~= 0"] then ()
36.117 +if Ctree.get_assumptions pt p = [ParseC.parse_test @{context}"y1 / 2 + - 1 * y3 / 2 ~= 0"] then ()
36.118 else error "rlang.sml: diff.behav. in I s.102 Bsp 268(1) asm";
36.119
36.120 (*-------------------- Schalk II ----------------------------*)
36.121 @@ -824,11 +824,11 @@
36.122 \0 <= 1 / 9]"
36.123 (*WN050916 before correction 'rewrite__set_ called with 'Rule_Set.Empty' for ..'
36.124 thus: maybe the rls for the asms is Rule_Set.Empty ??:
36.125 - [(TermC.parse_test @{context}"0 <= (25 * (1 / 9) + - 1 * (16 + 49 * (1 / 9))) * -56", []),
36.126 - (TermC.parse_test @{context}"9 ~= 0", []),
36.127 - (TermC.parse_test @{context}"0 <= (-5 + 7 * sqrt (1 / 9) + 1) * 5", []),
36.128 - (TermC.parse_test @{context}"9 ~= 0", []),
36.129 - (TermC.parse_test @{context}"0 <= (25 * (1 / 9) + - 1 * (16 + 49 * (1 / 9))) * -56", [])]*)
36.130 + [(ParseC.parse_test @{context}"0 <= (25 * (1 / 9) + - 1 * (16 + 49 * (1 / 9))) * -56", []),
36.131 + (ParseC.parse_test @{context}"9 ~= 0", []),
36.132 + (ParseC.parse_test @{context}"0 <= (-5 + 7 * sqrt (1 / 9) + 1) * 5", []),
36.133 + (ParseC.parse_test @{context}"9 ~= 0", []),
36.134 + (ParseC.parse_test @{context}"0 <= (25 * (1 / 9) + - 1 * (16 + 49 * (1 / 9))) * -56", [])]*)
36.135 then "should get True * False!!!"
36.136 else error "rlang.sml: diff.behav. in II 68a asms";
36.137
36.138 @@ -1329,7 +1329,7 @@
36.139 a * b / (a \<up> 2 + - 1 * b \<up> 2)"
36.140
36.141
36.142 -val t = TermC.parse_test @{context}"(a + b * x) / (a + - 1 * (b * x)) + - 1 * (a + - 1 * (b * x)) / (a + b * x) =\n4 * a * b / (a \<up> 2 + - 1 * b \<up> 2)";
36.143 +val t = ParseC.parse_test @{context}"(a + b * x) / (a + - 1 * (b * x)) + - 1 * (a + - 1 * (b * x)) / (a + b * x) =\n4 * a * b / (a \<up> 2 + - 1 * b \<up> 2)";
36.144 Rewrite.trace_on := false; (*true false*)
36.145 val SOME (t',asm) = rewrite_set_ thy false norm_Rational t;
36.146 UnparseC.term t';
36.147 @@ -1496,14 +1496,14 @@
36.148 "[x = (- 2 * a + 4 * b + sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4,\n x =\n (- 2 * a + 4 * b + - 1 * sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4]")) then writeln "simplify MG"
36.149 else error "rlang.sml: diff.behav. in II 62b [x=...]";
36.150 val asms = Ctree.get_assumptions pt p;
36.151 -if asms = [TermC.parse_test @{context}"0 <= ((- 2 * a + 4 * b + sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 + a) \<up> 2 + ((- 2 * a + 4 * b + sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 - 2 * b) \<up> 2",
36.152 - TermC.parse_test @{context}"0 <= a + 2 * b",
36.153 - TermC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2",
36.154 - TermC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2",
36.155 - TermC.parse_test @{context}"0 <= ((- 2 * a + 4 * b + - 1 * sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 + a) \<up> 2 + ((- 2 * a + 4 * b + - 1 * sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 - 2 * b) \<up> 2",
36.156 - TermC.parse_test @{context}"0 <= a + 2 * b",
36.157 - TermC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2",
36.158 - TermC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2"]
36.159 +if asms = [ParseC.parse_test @{context}"0 <= ((- 2 * a + 4 * b + sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 + a) \<up> 2 + ((- 2 * a + 4 * b + sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 - 2 * b) \<up> 2",
36.160 + ParseC.parse_test @{context}"0 <= a + 2 * b",
36.161 + ParseC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2",
36.162 + ParseC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2",
36.163 + ParseC.parse_test @{context}"0 <= ((- 2 * a + 4 * b + - 1 * sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 + a) \<up> 2 + ((- 2 * a + 4 * b + - 1 * sqrt (16 * a * b + 16 * b \<up> 2 + 4 * a \<up> 2)) / 4 - 2 * b) \<up> 2",
36.164 + ParseC.parse_test @{context}"0 <= a + 2 * b",
36.165 + ParseC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2",
36.166 + ParseC.parse_test @{context}"8 * (-4 * a * b) <= (-4 * b + 2 * a) \<up> 2"]
36.167 then writeln "should be simplified MG"
36.168 else error "rlang.sml: diff.behav. in II 62b asms";
36.169
36.170 @@ -1523,8 +1523,8 @@
36.171 (*
36.172 val f = Form' (Test_Out.FormKF (~1,EdUndef,1,Nundef,"(2 * x + 1) * x \<up> 2 = 0"))
36.173 normiert nicht ... korr.WN:
36.174 -val t = TermC.parse_test @{context} "(2*x+1)*x \<up> 2 = 0";
36.175 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
36.176 +val t = ParseC.parse_test @{context} "(2*x+1)*x \<up> 2 = 0";
36.177 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
36.178 val SOME (t',_) = rewrite_set_inst_ thy false subst make_ratpoly_in t;
36.179 if UnparseC.term t' = "x \<up> 2 + 2 * x \<up> 3 = 0" then ()
36.180 else error "rlang.sml: 7";
36.181 @@ -1547,7 +1547,7 @@
36.182
36.183 (*------------------------------vvv-Rewrite_Set "rat_eliminate"---------
36.184 > Rewrite.trace_on:=true; (*true false*)
36.185 -> val t = TermC.parse_test @{context}
36.186 +> val t = ParseC.parse_test @{context}
36.187 "(3 + - 1 * x + 1 * x \<up> 2) / (9 * x + -6 * x \<up> 2 + 1 * x \<up> 3) = 1 / x";
36.188 > val SOME (t',asm) =
36.189 rewrite_ thy dummy_ord rateq_erls true rat_mult_denominator_both t;
36.190 @@ -1595,8 +1595,8 @@
36.191 then writeln"simplify result\nsimplify result\nsimplify result"
36.192 else error "rlang.sml: diff.behav. in Pythagoras";
36.193 val asms = Ctree.get_assumptions pt p;
36.194 -(*if asms = [TermC.parse_test @{context}"0 <= -4 * (b \<up> 2 / 4 + -4 * r \<up> 2 / 4)",
36.195 - TermC.parse_test @{context}"0 <= -4 * (b \<up> 2 / 4 + -4 * r \<up> 2 / 4)"]*)
36.196 +(*if asms = [ParseC.parse_test @{context}"0 <= -4 * (b \<up> 2 / 4 + -4 * r \<up> 2 / 4)",
36.197 + ParseC.parse_test @{context}"0 <= -4 * (b \<up> 2 / 4 + -4 * r \<up> 2 / 4)"]*)
36.198 if UnparseC.terms (*WN1104changed*) asms =
36.199 "[0 <= -4 * (b \<up> 2 / 4 + - 1 * r \<up> 2 / 1),\
36.200 \0 <= -4 * (b \<up> 2 / 4 + - 1 * r \<up> 2 / 1)]"
37.1 --- a/test/Tools/isac/Knowledge/root.sml Sun Jan 29 14:31:56 2023 +0100
37.2 +++ b/test/Tools/isac/Knowledge/root.sml Mon Jan 30 09:47:18 2023 +0100
37.3 @@ -15,14 +15,14 @@
37.4 "----------- rls Root_erls ------------------------------";
37.5 "----------- rls Root_erls ------------------------------";
37.6 "----------- rls Root_erls ------------------------------";
37.7 -val t = TermC.parse_test @{context} "sqrt 1";
37.8 +val t = ParseC.parse_test @{context} "sqrt 1";
37.9 val SOME (t',_) = rewrite_set_ ctxt false Root_erls t;
37.10 if UnparseC.term t' = "1" then () else error "root.sml: diff.behav. sqrt 1";
37.11
37.12 -val t = TermC.parse_test @{context} "sqrt (- 1)";
37.13 +val t = ParseC.parse_test @{context} "sqrt (- 1)";
37.14 val NONE = rewrite_set_ ctxt false Root_erls t;
37.15
37.16 -val t = TermC.parse_test @{context} "sqrt 0";
37.17 +val t = ParseC.parse_test @{context} "sqrt 0";
37.18 val SOME (t',_) = rewrite_set_ ctxt false Root_erls t;
37.19 if UnparseC.term t' = "0" then () else error "root.sml: diff.behav. sqrt 1";
37.20
38.1 --- a/test/Tools/isac/Knowledge/rooteq.sml Sun Jan 29 14:31:56 2023 +0100
38.2 +++ b/test/Tools/isac/Knowledge/rooteq.sml Mon Jan 30 09:47:18 2023 +0100
38.3 @@ -136,7 +136,7 @@
38.4 | _ => error "rooteq.sml: diff.behav. [x = 1 / 25]";
38.5 if UnparseC.terms (*WN1104changed*) (Ctree.get_assumptions pt p) = "[0 <= 1 / 25]"
38.6 (*WN050916 before correction 'rewrite__set_ called with 'Rule_Set.Empty' for ..:
38.7 - [(TermC.parse_test @{context}"25 ~= 0",[])] *)
38.8 + [(ParseC.parse_test @{context}"25 ~= 0",[])] *)
38.9 then writeln "should be True\n\
38.10 \should be True\n\
38.11 \should be True\n"
38.12 @@ -204,7 +204,7 @@
38.13 val (p,_,f,nxt,_,pt) = me nxt p [1] pt;val (p,_,f,nxt,_,pt) = me nxt p [1] pt;
38.14 case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[x = 4]")) => ()
38.15 | _ => error "rooteq.sml: diff.behav. [x = 4]";
38.16 -if Ctree.get_assumptions pt p = [TermC.parse_test @{context}"0 <= 12 * sqrt 2 * 4"]
38.17 +if Ctree.get_assumptions pt p = [ParseC.parse_test @{context}"0 <= 12 * sqrt 2 * 4"]
38.18 then writeln "should be True\nshould be True\nshould be True\n\
38.19 \should be True\nshould be True\nshould be True\n"
38.20 else error "rooteq.sml: diff.behav. with 0 <= 12 * sqrt 2 * 4";
39.1 --- a/test/Tools/isac/Knowledge/rootrateq.sml Sun Jan 29 14:31:56 2023 +0100
39.2 +++ b/test/Tools/isac/Knowledge/rootrateq.sml Mon Jan 30 09:47:18 2023 +0100
39.3 @@ -114,8 +114,8 @@
39.4 "check_elementwise: no set 1 = 2 + - 2 * sqrt x"*)
39.5
39.6 (*---- 2nd try: we investigate the script ["RootEq", "solve_sq_root_equation"] found via pbl*)
39.7 -val t = TermC.parse_test @{context} "((lhs e_e) is_sqrtTerm_in v_v) | ((rhs e_e) is_sqrtTerm_in v_v)";
39.8 -val t = TermC.parse_test @{context} ("((lhs (1 = 2 * (1 + - 1 * sqrt x))) is_sqrtTerm_in x) |" ^
39.9 +val t = ParseC.parse_test @{context} "((lhs e_e) is_sqrtTerm_in v_v) | ((rhs e_e) is_sqrtTerm_in v_v)";
39.10 +val t = ParseC.parse_test @{context} ("((lhs (1 = 2 * (1 + - 1 * sqrt x))) is_sqrtTerm_in x) |" ^
39.11 " ((rhs (1 = 2 * (1 + - 1 * sqrt x))) is_sqrtTerm_in x)");
39.12 val SOME (t, _) = rewrite_set_ thy true rooteq_srls t;
39.13 UnparseC.term t = "True | True"; (*...was same in 2002 (NOT "True"); so program seems to take
40.1 --- a/test/Tools/isac/Knowledge/system.sml Sun Jan 29 14:31:56 2023 +0100
40.2 +++ b/test/Tools/isac/Knowledge/system.sml Mon Jan 30 09:47:18 2023 +0100
40.3 @@ -19,14 +19,14 @@
40.4 "----------- normalise system ------------------------------------";
40.5 "----------- normalise system ------------------------------------";
40.6 "----------- normalise system ------------------------------------";
40.7 -val t = TermC.parse_test @{context} "[0 = c*0 + - 1*q_0*(0 \<up> 2 / 2) + c_2,\
40.8 +val t = ParseC.parse_test @{context} "[0 = c*0 + - 1*q_0*(0 \<up> 2 / 2) + c_2,\
40.9 \ 0 = c*L + - 1*q_0*(L \<up> 2 / 2) + c_2]";
40.10 val SOME (t,_) = rewrite_set_ thy false norm_Poly t;
40.11 if UnparseC.term t =
40.12 "[0 = - 1 * q_0 * (0 / 2) + c_2, 0 = L * c + - 1 * q_0 * (L \<up> 2 / 2) + c_2]"
40.13 then () else error "system.sml, diff.behav. in norm_Poly";
40.14
40.15 -val t = TermC.parse_test @{context} "[0 = c*0 + - 1*q_0*(0 \<up> 2 / 2) + c_2,\
40.16 +val t = ParseC.parse_test @{context} "[0 = c*0 + - 1*q_0*(0 \<up> 2 / 2) + c_2,\
40.17 \ 0 = c*L + - 1*q_0*(L \<up> 2 / 2) + c_2]";
40.18 val SOME (t,_) = rewrite_set_ thy false norm_Rational t;
40.19 if UnparseC.term t =
40.20 @@ -34,7 +34,7 @@
40.21 then () else error "system.sml, diff.behav. in norm_Rational";
40.22
40.23
40.24 -val t = TermC.parse_test @{context} "nth_ 1 [0 = c*0 + - 1*q_0*(0 \<up> 2 / 2) + c_2,\
40.25 +val t = ParseC.parse_test @{context} "nth_ 1 [0 = c*0 + - 1*q_0*(0 \<up> 2 / 2) + c_2,\
40.26 \ 0 = c*L + - 1*q_0*(L \<up> 2 / 2) + c_2]";
40.27 val SOME (t,_) = rewrite_set_ thy false prog_expr t;
40.28 if UnparseC.term t = "0 = c * 0 + - 1 * q_0 * (0 \<up> 2 / 2) + c_2"
41.1 --- a/test/Tools/isac/Knowledge/wn.sml Sun Jan 29 14:31:56 2023 +0100
41.2 +++ b/test/Tools/isac/Knowledge/wn.sml Mon Jan 30 09:47:18 2023 +0100
41.3 @@ -4,7 +4,7 @@
41.4 various test dependent on IsacKnowledge/ outside Test.thy, Test.ML*)
41.5
41.6
41.7 - val t = TermC.parse_test @{context} "solve (a*x + b = c, x)";
41.8 + val t = ParseC.parse_test @{context} "solve (a*x + b = c, x)";
41.9 TermC.atom_trace_detail @{context} t;
41.10 (*
41.11 "\n*** -------------"
42.1 --- a/test/Tools/isac/MathEngBasic/ctree.sml Sun Jan 29 14:31:56 2023 +0100
42.2 +++ b/test/Tools/isac/MathEngBasic/ctree.sml Mon Jan 30 09:47:18 2023 +0100
42.3 @@ -103,7 +103,7 @@
42.4 "ctree.sml-------------- cut_tree new (from ctree above)----------";
42.5 val (pt', cuts) = cut_tree pt ([1],Frm);
42.6 "ctree.sml-------------- cappend on complete ctree from above ----";
42.7 -val (pt', cuts) = cappend_form pt [1] (Istate.empty, ContextC.empty) (TermC.parse_test @{context} "Inform[1]");
42.8 +val (pt', cuts) = cappend_form pt [1] (Istate.empty, ContextC.empty) (ParseC.parse_test @{context} "Inform[1]");
42.9 "----------------------------------------------------------------/";
42.10
42.11 val (p,_,f,nxt,_,pt) = me nxt p [1] pt(*cappend_form: pos =[1]*);
42.12 @@ -420,7 +420,7 @@
42.13 "-------------- cappend (from ctree above)------------------------";
42.14 "-------------- cappend (from ctree above)------------------------";
42.15 "-------------- cappend (from ctree above)------------------------";
42.16 -val (pt',cuts) = cappend_form pt [3,2,1] Istate.empty (TermC.parse_test @{context} "newnew");
42.17 +val (pt',cuts) = cappend_form pt [3,2,1] Istate.empty (ParseC.parse_test @{context} "newnew");
42.18 if cuts = [([3, 2, 1], Res),
42.19 ([3, 2, 2], Res),
42.20 ([3, 2], Res),
42.21 @@ -433,8 +433,8 @@
42.22 UnparseC.term (fst (get_obj g_result pt' [3,2,1])) = "??.empty"
42.23 then () else error "ctree.sml: diff:behav. in cappend 1";
42.24
42.25 -val (pt',cuts) = cappend_atomic pt [3,2,1] Istate.empty (TermC.parse_test @{context} "newform")
42.26 - (Tac "test") (TermC.parse_test @{context} "newresult",[]) Complete;
42.27 +val (pt',cuts) = cappend_atomic pt [3,2,1] Istate.empty (ParseC.parse_test @{context} "newform")
42.28 + (Tac "test") (ParseC.parse_test @{context} "newresult",[]) Complete;
42.29 if cuts = [([3, 2, 1], Res), (*?????????????*)
42.30 ([3, 2, 2], Res),
42.31 ([3, 2], Res),
42.32 @@ -472,7 +472,7 @@
42.33
42.34 (*val (p,_,f,nxt,_,pt) = me nxt p [1] pt(**)cappend_form: pos =[1]*);
42.35 val p = ([1], Frm);
42.36 -val (pt,cuts) = cappend_form pt (fst p) Istate.empty (TermC.parse_test @{context} "x + 1 = 2");
42.37 +val (pt,cuts) = cappend_form pt (fst p) Istate.empty (ParseC.parse_test @{context} "x + 1 = 2");
42.38 val form = get_obj g_form pt (fst p);
42.39 val (res,_) = get_obj g_result pt (fst p);
42.40 if UnparseC.term form = "x + 1 = 2" andalso res = TermC.empty then () else
42.41 @@ -483,8 +483,8 @@
42.42 (*val (p,_,f,nxt,_,pt) = me nxt p [1] pt(**)cappend_atomic: pos =[1]*);
42.43 val p = ([1], Res);
42.44 val (pt,cuts) =
42.45 - cappend_atomic pt (fst p) Istate.empty (TermC.parse_test @{context} "x + 1 = 2")
42.46 - Empty_Tac (TermC.parse_test @{context} "x + 1 + - 1 * 2 = 0",[]) Incomplete;
42.47 + cappend_atomic pt (fst p) Istate.empty (ParseC.parse_test @{context} "x + 1 = 2")
42.48 + Empty_Tac (ParseC.parse_test @{context} "x + 1 + - 1 * 2 = 0",[]) Incomplete;
42.49 val form = get_obj g_form pt (fst p);
42.50 val (res,_) = get_obj g_result pt (fst p);
42.51 if UnparseC.term form = "x + 1 = 2" andalso UnparseC.term res = "x + 1 + - 1 * 2 = 0"
42.52 @@ -495,8 +495,8 @@
42.53 (*val (p,_,f,nxt,_,pt) = me nxt p [1] pt(**)cappend_atomic: pos =[2]*);
42.54 val p = ([2], Res);
42.55 val (pt,cuts) =
42.56 - cappend_atomic pt (fst p) Istate.empty (TermC.parse_test @{context} "x + 1 + - 1 * 2 = 0")
42.57 - Empty_Tac (TermC.parse_test @{context} "- 1 + x = 0",[]) Incomplete;
42.58 + cappend_atomic pt (fst p) Istate.empty (ParseC.parse_test @{context} "x + 1 + - 1 * 2 = 0")
42.59 + Empty_Tac (ParseC.parse_test @{context} "- 1 + x = 0",[]) Incomplete;
42.60 val form = get_obj g_form pt (fst p);
42.61 val (res,_) = get_obj g_result pt (fst p);
42.62 if UnparseC.term form = "x + 1 + - 1 * 2 = 0" andalso UnparseC.term res = "- 1 + x = 0"
42.63 @@ -517,7 +517,7 @@
42.64
42.65 (*val (p,_,f,nxt,_,pt) = me nxt p [1] pt(**)cappend_form: pos =[3,1]*);
42.66 val p = ([3, 1], Frm);
42.67 -val (pt,cuts) = cappend_form pt (fst p) Istate.empty (TermC.parse_test @{context} "- 1 + x = 0");
42.68 +val (pt,cuts) = cappend_form pt (fst p) Istate.empty (ParseC.parse_test @{context} "- 1 + x = 0");
42.69 val form = get_obj g_form pt (fst p);
42.70 val (res,_) = get_obj g_result pt (fst p);
42.71 if UnparseC.term form = "- 1 + x = 0" andalso res = TermC.empty then () else
42.72 @@ -528,8 +528,8 @@
42.73 (*val (p,_,f,nxt,_,pt) = me nxt p [1] pt;(**)cappend_atomic: pos =[3,1]*)
42.74 val p = ([3, 1], Res);
42.75 val (pt,cuts) =
42.76 - cappend_atomic pt (fst p) Istate.empty (TermC.parse_test @{context} "- 1 + x = 0")
42.77 - Empty_Tac (TermC.parse_test @{context} "x = 0 + - 1 * - 1",[]) Incomplete;
42.78 + cappend_atomic pt (fst p) Istate.empty (ParseC.parse_test @{context} "- 1 + x = 0")
42.79 + Empty_Tac (ParseC.parse_test @{context} "x = 0 + - 1 * - 1",[]) Incomplete;
42.80 val form = get_obj g_form pt (fst p);
42.81 val (res,_) = get_obj g_result pt (fst p);
42.82 if UnparseC.term form = "- 1 + x = 0" andalso UnparseC.term res = "x = 0 + - 1 * - 1" then()
42.83 @@ -1161,8 +1161,8 @@
42.84 "---(2) on S(606)..S(608)--------";
42.85 (*========== inhibit exn AK110726 ==============================================
42.86 (* ERROR: Can't unify istate to istate * Proof.context *)
42.87 -val (pt', cuts) = cappend_atomic pt [1] Istate.empty (TermC.parse_test @{context} "Inform[1]")
42.88 - (Tac "test") (TermC.parse_test @{context} "Inres[1]",[]) Complete;
42.89 +val (pt', cuts) = cappend_atomic pt [1] Istate.empty (ParseC.parse_test @{context} "Inform[1]")
42.90 + (Tac "test") (ParseC.parse_test @{context} "Inres[1]",[]) Complete;
42.91
42.92 (*default_print_depth 99;*)
42.93 cuts;
42.94 @@ -1183,8 +1183,8 @@
42.95 Test_Tool.show_pt pt';
42.96 "---(3) on S(606)..S(608)--------";
42.97 Test_Tool.show_pt pt;
42.98 -val (pt', cuts) = cappend_atomic pt [2] Istate.empty (TermC.parse_test @{context} "Inform[2]")
42.99 - (Tac "test") (TermC.parse_test @{context} "Inres[2]",[]) Complete;
42.100 +val (pt', cuts) = cappend_atomic pt [2] Istate.empty (ParseC.parse_test @{context} "Inform[2]")
42.101 + (Tac "test") (ParseC.parse_test @{context} "Inres[2]",[]) Complete;
42.102 (*default_print_depth 99;*)
42.103 cuts;
42.104 (*default_print_depth 3;*)
42.105 @@ -1221,7 +1221,7 @@
42.106
42.107 "---(4) on S(606)..S(608)--------";
42.108 val (pt', cuts) = cappend_problem pt [3] Istate.empty ([],References.empty)
42.109 - ([],References.empty, TermC.parse_test @{context} "Inhead[3]", ContextC.empty);
42.110 + ([],References.empty, ParseC.parse_test @{context} "Inhead[3]", ContextC.empty);
42.111 (*default_print_depth 99;*)
42.112 cuts;
42.113 (*default_print_depth 3;*)
42.114 @@ -1246,8 +1246,8 @@
42.115 *)
42.116
42.117 "---(6- 1) on S(606)..S(608)--------";
42.118 -val (pt', cuts) = cappend_atomic pt [3,1] Istate.empty (TermC.parse_test @{context} "Inform[3,1]")
42.119 - (Tac "test") (TermC.parse_test @{context} "Inres[3,1]",[]) Complete;
42.120 +val (pt', cuts) = cappend_atomic pt [3,1] Istate.empty (ParseC.parse_test @{context} "Inform[3,1]")
42.121 + (Tac "test") (ParseC.parse_test @{context} "Inres[3,1]",[]) Complete;
42.122 (*default_print_depth 99;*)
42.123 cuts;
42.124 (*default_print_depth 3;*)
42.125 @@ -1272,8 +1272,8 @@
42.126 error "ctree.sml: diff:behav. in complete pt: append_atomic[3,1] Inform";
42.127
42.128 "---(6) on S(606)..S(608)--------";
42.129 -val (pt', cuts) = cappend_atomic pt [3,2] Istate.empty (TermC.parse_test @{context} "Inform[3,2]")
42.130 - (Tac "test") (TermC.parse_test @{context} "Inres[3,2]",[]) Complete;
42.131 +val (pt', cuts) = cappend_atomic pt [3,2] Istate.empty (ParseC.parse_test @{context} "Inform[3,2]")
42.132 + (Tac "test") (ParseC.parse_test @{context} "Inres[3,2]",[]) Complete;
42.133 (*default_print_depth 99;*)
42.134 cuts;
42.135 (*default_print_depth 3;*)
42.136 @@ -1297,8 +1297,8 @@
42.137
42.138 "---(6++) on S(606)..S(608)--------";
42.139 (**)
42.140 -val (pt', cuts) = cappend_atomic pt [3,2,1] Istate.empty (TermC.parse_test @{context} "Inform[3,2,1]")
42.141 - (Tac "test") (TermC.parse_test @{context} "Inres[3,2,1]",[]) Complete;
42.142 +val (pt', cuts) = cappend_atomic pt [3,2,1] Istate.empty (ParseC.parse_test @{context} "Inform[3,2,1]")
42.143 + (Tac "test") (ParseC.parse_test @{context} "Inres[3,2,1]",[]) Complete;
42.144 (*default_print_depth 99;*)
42.145 cuts;
42.146 (*default_print_depth 1;*)
43.1 --- a/test/Tools/isac/MathEngBasic/mstools.sml Sun Jan 29 14:31:56 2023 +0100
43.2 +++ b/test/Tools/isac/MathEngBasic/mstools.sml Mon Jan 30 09:47:18 2023 +0100
43.3 @@ -19,38 +19,38 @@
43.4 "----------- fun Input_Descript.join -- fun Input_Descript.split -------------------------------";
43.5 "----------- fun Input_Descript.join -- fun Input_Descript.split -------------------------------";
43.6 "----------- fun Input_Descript.join -- fun Input_Descript.split -------------------------------";
43.7 -(*val t = TermC.parse_test @{context} "maximum A";
43.8 +(*val t = ParseC.parse_test @{context} "maximum A";
43.9 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.10 val it = "maximum A" : cterm
43.11 -> val t = TermC.parse_test @{context} "fixedValues [r=Arbfix]";
43.12 +> val t = ParseC.parse_test @{context} "fixedValues [r=Arbfix]";
43.13 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.14 "fixedValues [r = Arbfix]"
43.15 -> val t = TermC.parse_test @{context} "valuesFor [a]";
43.16 +> val t = ParseC.parse_test @{context} "valuesFor [a]";
43.17 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.18 "valuesFor [a]"
43.19 -> val t = TermC.parse_test @{context} "valuesFor [a,b]";
43.20 +> val t = ParseC.parse_test @{context} "valuesFor [a,b]";
43.21 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.22 "valuesFor [a, b]"
43.23 -> val t = TermC.parse_test @{context} "relations [A=a*b, (a/2) \<up> 2 + (b/2) \<up> 2 = r \<up> 2]";
43.24 +> val t = ParseC.parse_test @{context} "relations [A=a*b, (a/2) \<up> 2 + (b/2) \<up> 2 = r \<up> 2]";
43.25 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.26 relations [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2]"
43.27 -> val t = TermC.parse_test @{context} "boundVariable a";
43.28 +> val t = ParseC.parse_test @{context} "boundVariable a";
43.29 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.30 "boundVariable a"
43.31 -> val t = TermC.parse_test @{context} "interval {x::real. 0 <= x & x <= 2*r}";
43.32 +> val t = ParseC.parse_test @{context} "interval {x::real. 0 <= x & x <= 2*r}";
43.33 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.34 "interval {x. 0 <= x & x <= 2 * r}"
43.35
43.36 -> val t = TermC.parse_test @{context} "equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))";
43.37 +> val t = ParseC.parse_test @{context} "equality (sqrt(9+4*x)=sqrt x + sqrt(5+x))";
43.38 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.39 "equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x))"
43.40 -> val t = TermC.parse_test @{context} "solveFor x";
43.41 +> val t = ParseC.parse_test @{context} "solveFor x";
43.42 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.43 "solveFor x"
43.44 -> val t = TermC.parse_test @{context} "errorBound (eps=0)";
43.45 +> val t = ParseC.parse_test @{context} "errorBound (eps=0)";
43.46 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.47 "errorBound (eps = 0)"
43.48 -> val t = TermC.parse_test @{context} "solutions L";
43.49 +> val t = ParseC.parse_test @{context} "solutions L";
43.50 > val (d,ts) = Input_Descript.split thy t; Input_Descript.join thy (d,ts);
43.51 "solutions L"
43.52
43.53 @@ -104,7 +104,7 @@
43.54 "----------- fun pbl_ids -----------------------------------------------------------------------";
43.55 "----------- fun pbl_ids -----------------------------------------------------------------------";
43.56 (*
43.57 -val t as t1 $ t2 = TermC.parse_test @{context} "antiDerivativeName M_b";
43.58 +val t as t1 $ t2 = ParseC.parse_test @{context} "antiDerivativeName M_b";
43.59 pbl_ids ctxt t1 t2;
43.60
43.61 val t = (Thm.term_of o the o (TermC.parse thy)) "fixedValues [r=Arbfix]";
44.1 --- a/test/Tools/isac/MathEngBasic/rewrite.sml Sun Jan 29 14:31:56 2023 +0100
44.2 +++ b/test/Tools/isac/MathEngBasic/rewrite.sml Mon Jan 30 09:47:18 2023 +0100
44.3 @@ -245,8 +245,8 @@
44.4 "----------- step through 'fun rewrite_terms_' ------------------------------------------------";
44.5 "----- step 0: args for rewrite_terms_, local fun";
44.6 val (thy, ord, asm_rls, equs, t) =
44.7 - (@{theory "Biegelinie"}, Rewrite_Ord.function_empty, Rule_Set.Empty, [TermC.parse_test @{context} "x = 0"],
44.8 - TermC.parse_test @{context} "M_b x = -1 * q_0 * x \<up> 2 / 2 + x * c + c_2");
44.9 + (@{theory "Biegelinie"}, Rewrite_Ord.function_empty, Rule_Set.Empty, [ParseC.parse_test @{context} "x = 0"],
44.10 + ParseC.parse_test @{context} "M_b x = -1 * q_0 * x \<up> 2 / 2 + x * c + c_2");
44.11 "----- step 1: args for rew_";
44.12 val ((t', asm'), (rules as r::rs), t) = ((TermC.empty, []), equs, t);
44.13 "----- step 2: rew_sub";
44.14 @@ -259,15 +259,15 @@
44.15 if UnparseC.term t' = "M_b 0 = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c + c_2" then ()
44.16 else error "rewrite.sml rewrite_terms_ [x = 0]";
44.17
44.18 -val equs = [TermC.parse_test @{context} "M_b 0 = 0"];
44.19 -val t = TermC.parse_test @{context} "M_b 0 = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c + c_2";
44.20 +val equs = [ParseC.parse_test @{context} "M_b 0 = 0"];
44.21 +val t = ParseC.parse_test @{context} "M_b 0 = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c + c_2";
44.22 val SOME (t', _) = rewrite_terms_ ctxt Rewrite_Ord.function_empty Rule_Set.Empty equs t;
44.23 writeln "---------- rewrite_terms_ 2---------------------------";
44.24 if UnparseC.term t' = "0 = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c + c_2" then ()
44.25 else error "rewrite.sml rewrite_terms_ [M_b 0 = 0]";
44.26
44.27 -val equs = [TermC.parse_test @{context} "x = 0", TermC.parse_test @{context}"M_b 0 = 0"];
44.28 -val t = TermC.parse_test @{context} "M_b x = - 1 * q_0 * x \<up> 2 / 2 + x * c + c_2";
44.29 +val equs = [ParseC.parse_test @{context} "x = 0", ParseC.parse_test @{context}"M_b 0 = 0"];
44.30 +val t = ParseC.parse_test @{context} "M_b x = - 1 * q_0 * x \<up> 2 / 2 + x * c + c_2";
44.31 val SOME (t', _) = rewrite_terms_ ctxt Rewrite_Ord.function_empty Rule_Set.Empty equs t;
44.32 writeln "---------- rewrite_terms_ 3---------------------------";
44.33 if UnparseC.term t' = "0 = - 1 * q_0 * 0 \<up> 2 / 2 + 0 * c + c_2" then ()
44.34 @@ -278,11 +278,11 @@
44.35 "----------- rewrite_inst_ bdvs ----------------------------------------------------------------";
44.36 "----------- rewrite_inst_ bdvs ----------------------------------------------------------------";
44.37 (*see smltest/Scripts/term_G.sml: inst_bdv 2*)
44.38 -val t = TermC.parse_test @{context}"-1 * (q_0 * L \<up> 2) / 2 + (L * c_3 + c_4) = 0";
44.39 -val bdvs = [(TermC.parse_test @{context}"bdv_1",TermC.parse_test @{context}"c"),
44.40 - (TermC.parse_test @{context}"bdv_2",TermC.parse_test @{context}"c_2"),
44.41 - (TermC.parse_test @{context}"bdv_3",TermC.parse_test @{context}"c_3"),
44.42 - (TermC.parse_test @{context}"bdv_4",TermC.parse_test @{context}"c_4")];
44.43 +val t = ParseC.parse_test @{context}"-1 * (q_0 * L \<up> 2) / 2 + (L * c_3 + c_4) = 0";
44.44 +val bdvs = [(ParseC.parse_test @{context}"bdv_1",ParseC.parse_test @{context}"c"),
44.45 + (ParseC.parse_test @{context}"bdv_2",ParseC.parse_test @{context}"c_2"),
44.46 + (ParseC.parse_test @{context}"bdv_3",ParseC.parse_test @{context}"c_3"),
44.47 + (ParseC.parse_test @{context}"bdv_4",ParseC.parse_test @{context}"c_4")];
44.48 (*------------ outcommented WN071210, after inclusion into ROOT.ML
44.49 val SOME (t,_) =
44.50 rewrite_inst_ thy e_rew_ord
44.51 @@ -317,7 +317,7 @@
44.52 (or not: hen the Rrls not applied);
44.53 if pre1 and pre2 evaluate to @{term True} in this environment,
44.54 then the Rrls is applied. *)
44.55 -val t = TermC.parse_test @{context} "(a + b) / c ::real";
44.56 +val t = ParseC.parse_test @{context} "(a + b) / c ::real";
44.57 val pat = TermC.parse_patt thy "?r / ?s ::real";
44.58 val pres = [TermC.parse_patt thy "?r is_expanded", TermC.parse_patt thy "?s is_expanded"];
44.59 val prepat = [(pres, pat)];
44.60 @@ -335,7 +335,7 @@
44.61 "===== Rational.thy: add_fractions_p ===";
44.62 (* if each pat* TermC.matches with the current term, the Rrls is applied
44.63 (there are no preconditions to be checked, they are @{term True}) *)
44.64 -val t = TermC.parse_test @{context} "a / b + 1 / 2";
44.65 +val t = ParseC.parse_test @{context} "a / b + 1 / 2";
44.66 val pat = TermC.parse_patt thy "?r / ?s + ?u / ?v";
44.67 val pres = [@{term True}];
44.68 val prepat = [(pres, pat)];
44.69 @@ -349,7 +349,7 @@
44.70 "===== Poly.thy: order_mult_ ===";
44.71 (* ?p matched with the current term gives an environment,
44.72 which evaluates (the instantiated) "p is_multUnordered" to true*)
44.73 -val t = TermC.parse_test @{context} "x \<up> 2 * x";
44.74 +val t = ParseC.parse_test @{context} "x \<up> 2 * x";
44.75 val pat = TermC.parse_patt thy "?p :: real"
44.76 val pres = [TermC.parse_patt thy "?p is_multUnordered"];
44.77 val prepat = [(pres, pat)];
44.78 @@ -369,10 +369,10 @@
44.79 "----------- fun app_rev, Rrls, ----------------------------------------------------------------";
44.80 "----------- fun app_rev, Rrls, ----------------------------------------------------------------";
44.81 "----------- fun app_rev, Rrls, ----------------------------------------------------------------";
44.82 -val t = TermC.parse_test @{context} "x \<up> 2 * x";
44.83 +val t = ParseC.parse_test @{context} "x \<up> 2 * x";
44.84
44.85 if is_multUnordered t then () else error "rewrite.sml diff. is_multUnordered 2";
44.86 -val tm = TermC.parse_test @{context} "(x \<up> 2 * x) is_multUnordered";
44.87 +val tm = ParseC.parse_test @{context} "(x \<up> 2 * x) is_multUnordered";
44.88
44.89 (*+*)case eval_is_multUnordered "testid" "" tm ctxt of
44.90 (*+*) SOME
44.91 @@ -453,7 +453,7 @@
44.92 tracing "=== poly.sml: scan_ chk prepat end";
44.93
44.94 "----- chk ---";
44.95 -(*reestablish...*) val t = TermC.parse_test @{context} "x \<up> 2 * x";
44.96 +(*reestablish...*) val t = ParseC.parse_test @{context} "x \<up> 2 * x";
44.97 val [(pres, pat)] = prepat;
44.98 val subst: Type.tyenv * Envir.tenv =
44.99 Pattern.match thy (pat, t)
44.100 @@ -465,7 +465,7 @@
44.101 if UnparseC.terms asms = "[\"x \<up> 2 * x is_multUnordered\"]" then ()
44.102 else error "rewrite.sml: diff. is_multUnordered, asms";
44.103 val (thy, i, asms, bdv, rls) =
44.104 - (thy, (i+1), [TermC.parse_test @{context} "(x \<up> 2 * x) is_multUnordered"],
44.105 + (thy, (i+1), [ParseC.parse_test @{context} "(x \<up> 2 * x) is_multUnordered"],
44.106 [] : Subst.T, asm_rls);
44.107 case eval__true ctxt i asms bdv rls of
44.108 ([], true) => ()
44.109 @@ -477,7 +477,7 @@
44.110 val thm = @{thm div_by_1};
44.111 val prop = Thm.prop_of thm;
44.112 TermC.atom_trace_detail @{context} prop; (*Type 'a*)
44.113 -val t = TermC.parse_test @{context} "(2*x)/1"; (*Type real*)
44.114 +val t = ParseC.parse_test @{context} "(2*x)/1"; (*Type real*)
44.115
44.116 val (thy, ro, er, inst) =
44.117 (@{theory "Isac_Knowledge"}, tless_true, eval_rls, [(@{term "bdv::real"}, @{term "x::real"})]);
44.118 @@ -680,7 +680,7 @@
44.119 (* norm_equation is defined in Test.thy, other rls see Knowledg/**)
44.120 val thy = @{theory};
44.121 val rls = norm_equation;
44.122 -val term = TermC.parse_test @{context} "x + 1 = 2";
44.123 +val term = ParseC.parse_test @{context} "x + 1 = 2";
44.124
44.125 (**)val SOME (t, asm) = rewrite_set_ ctxt false rls term;
44.126 (** )##### try thm: "root_ge0"
45.1 --- a/test/Tools/isac/OLDTESTS/interface-xml.sml Sun Jan 29 14:31:56 2023 +0100
45.2 +++ b/test/Tools/isac/OLDTESTS/interface-xml.sml Mon Jan 30 09:47:18 2023 +0100
45.3 @@ -3,10 +3,10 @@
45.4 *)
45.5
45.6 (*see javatest.isac.util.TermC.parse.TestXMLParserDigest#testParseRefFormula*)
45.7 -refformulaOK2xml 1 ([1],Frm) (Form (TermC.parse_test @{context} "x+1=2"));
45.8 +refformulaOK2xml 1 ([1],Frm) (Form (ParseC.parse_test @{context} "x+1=2"));
45.9 (*see javatest.isac.util.TermC.parse.TestXMLParserDigest#testParseRefCalcHead*)
45.10 refformulaOK2xml 1 ([1],Pbl) (ModSpec Specification_Def.empty);
45.11
45.12 -getintervalOK 1 [(([2],Res), TermC.parse_test @{context} "x = 4"),
45.13 - (([3],Pbl), TermC.parse_test @{context} "e_headline"),
45.14 - (([3,1],Frm), TermC.parse_test @{context} "-1+x=0")];
45.15 +getintervalOK 1 [(([2],Res), ParseC.parse_test @{context} "x = 4"),
45.16 + (([3],Pbl), ParseC.parse_test @{context} "e_headline"),
45.17 + (([3,1],Frm), ParseC.parse_test @{context} "-1+x=0")];
46.1 --- a/test/Tools/isac/OLDTESTS/root-equ.sml Sun Jan 29 14:31:56 2023 +0100
46.2 +++ b/test/Tools/isac/OLDTESTS/root-equ.sml Mon Jan 30 09:47:18 2023 +0100
46.3 @@ -186,7 +186,7 @@
46.4 val rls = Test_simplify;
46.5 val (t,_) = the (rewrite_set_ thy false rls t);
46.6 val rls = isolate_bdv;
46.7 -val subst = [(TermC.parse_test @{context} "bdv", TermC.parse_test @{context} "x")];
46.8 +val subst = [(ParseC.parse_test @{context} "bdv", ParseC.parse_test @{context} "x")];
46.9 val (t,_) = the (rewrite_set_inst_ thy false subst rls t);
46.10 val rls = Test_simplify;
46.11 val (t,_) = the (rewrite_set_ thy false rls t);
46.12 @@ -247,7 +247,7 @@
46.13 " _________________ rewrite + cappend _________________ ";
46.14 " _________________ rewrite + cappend _________________ ";
46.15 val thy' = "Test";
46.16 -val ct = TermC.parse_test @{context}"sqrt(9+4*x)=sqrt x + sqrt(5+x)";
46.17 +val ct = ParseC.parse_test @{context}"sqrt(9+4*x)=sqrt x + sqrt(5+x)";
46.18 val ctl = ["sqrt(9+4*x)=sqrt x + sqrt(5+x)", "x::real", "0"];
46.19 val oris = O_Model.init thy ctl
46.20 ((#model o Problem.from_store)
46.21 @@ -290,70 +290,70 @@
46.22 val pos = (lev_on o lev_dn) pos;
46.23 val thm = ("square_equation_left", ""); val ctold = ct;
46.24 val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") true thm (UnparseC.term ct));
46.25 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac (fst thm)) (TermC.parse_test @{context} ct,[])Complete;
46.26 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac (fst thm)) (ParseC.parse_test @{context} ct,[])Complete;
46.27 (*val pt = union_asm pt [] (map (rpair []) asm);*)
46.28
46.29 val pos = lev_on pos;
46.30 -val rls = ("Test_simplify"); val ctold = TermC.parse_test @{context} ct;
46.31 +val rls = ("Test_simplify"); val ctold = ParseC.parse_test @{context} ct;
46.32 val (ct,_) = the (rewrite_set thy' false rls ct);
46.33 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.34 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.35
46.36 val pos = lev_on pos;
46.37 -val rls = ("rearrange_assoc"); val ctold = TermC.parse_test @{context} ct;
46.38 +val rls = ("rearrange_assoc"); val ctold = ParseC.parse_test @{context} ct;
46.39 val (ct,_) = the (rewrite_set thy' false rls ct);
46.40 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.41 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.42
46.43 val pos = lev_on pos;
46.44 -val rls = ("isolate_root"); val ctold = TermC.parse_test @{context} ct;
46.45 +val rls = ("isolate_root"); val ctold = ParseC.parse_test @{context} ct;
46.46 val (ct,_) = the (rewrite_set thy' false rls ct);
46.47 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.48 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.49
46.50 val pos = lev_on pos;
46.51 -val rls = ("Test_simplify"); val ctold = TermC.parse_test @{context} ct;
46.52 +val rls = ("Test_simplify"); val ctold = ParseC.parse_test @{context} ct;
46.53 val (ct,_) = the (rewrite_set thy' false rls ct);
46.54 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.55 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.56
46.57 val pos = lev_on pos;
46.58 -val thm = ("square_equation_left", ""); val ctold = TermC.parse_test @{context} ct;
46.59 +val thm = ("square_equation_left", ""); val ctold = ParseC.parse_test @{context} ct;
46.60 val (ct,asm) = the (rewrite thy' "tless_true" "tval_rls" true thm ct);
46.61 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.62 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.63 (*val pt = union_asm pt [] (map (rpair []) asm);*)
46.64
46.65 val pos = lev_up pos;
46.66 -val (pt,_) = append_result pt pos Istate.empty (TermC.parse_test @{context} ct,[]) Complete;
46.67 +val (pt,_) = append_result pt pos Istate.empty (ParseC.parse_test @{context} ct,[]) Complete;
46.68
46.69 val pos = lev_on pos;
46.70 -val rls = ("Test_simplify"); val ctold = TermC.parse_test @{context} ct;
46.71 +val rls = ("Test_simplify"); val ctold = ParseC.parse_test @{context} ct;
46.72 val (ct,_) = the (rewrite_set thy' false rls ct);
46.73 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.74 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.75
46.76 val pos = lev_on pos;
46.77 -val rls = ("norm_equation"); val ctold = TermC.parse_test @{context} ct;
46.78 +val rls = ("norm_equation"); val ctold = ParseC.parse_test @{context} ct;
46.79 val (ct,_) = the (rewrite_set thy' false rls ct);
46.80 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.81 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.82
46.83 val pos = lev_on pos;
46.84 -val rls = ("Test_simplify"); val ctold = TermC.parse_test @{context} ct;
46.85 +val rls = ("Test_simplify"); val ctold = ParseC.parse_test @{context} ct;
46.86 val (ct,_) = the (rewrite_set thy' false rls ct);
46.87 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.88 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.89
46.90 (* --- see comments in interface_ME_ISA/instantiate''
46.91 val rlsdat' = instantiate_rls' thy' [("bdv", "x")] ("isolate_bdv");
46.92 val (ct,_) = the (rewrite_set thy' false
46.93 ("#isolate_bdv",rlsdat') ct); *)
46.94 val pos = lev_on pos;
46.95 -val rls = ("isolate_bdv"); val ctold = TermC.parse_test @{context} ct;
46.96 +val rls = ("isolate_bdv"); val ctold = ParseC.parse_test @{context} ct;
46.97 val (ct,_) = the (rewrite_set_inst thy' false
46.98 [("bdv", "x")] rls ct);
46.99 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.100 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.101
46.102 val pos = lev_on pos;
46.103 -val rls = ("Test_simplify"); val ctold = TermC.parse_test @{context} ct;
46.104 +val rls = ("Test_simplify"); val ctold = ParseC.parse_test @{context} ct;
46.105 val (ct,_) = the (rewrite_set thy' false rls ct);
46.106 -val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (TermC.parse_test @{context} ct,[]) Complete;
46.107 +val (pt,_) = cappend_atomic pt pos loc ctold (Tac rls) (ParseC.parse_test @{context} ct,[]) Complete;
46.108
46.109 val pos = lev_up pos;
46.110 -val (pt,pos) = append_result pt pos Istate.empty (TermC.parse_test @{context} ct,[]) Complete;
46.111 +val (pt,pos) = append_result pt pos Istate.empty (ParseC.parse_test @{context} ct,[]) Complete;
46.112 Ctree.get_assumptions pt ([],Res);
46.113
46.114 writeln (pr_ctree ctxt pr_short pt);
46.115 @@ -529,7 +529,7 @@
46.116 val (p,_,f,nxt,_,pt) = me nxt p c pt;
46.117
46.118 (*.9.6.03
46.119 - val t = TermC.parse_test @{context} "sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)";
46.120 + val t = ParseC.parse_test @{context} "sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)";
46.121 val SOME (t',asm) = rewrite_set_ thy false rls t;
46.122 UnparseC.term t';
46.123 Rewrite.trace_on:=false; (*true false*)
47.1 --- a/test/Tools/isac/OLDTESTS/script.sml Sun Jan 29 14:31:56 2023 +0100
47.2 +++ b/test/Tools/isac/OLDTESTS/script.sml Mon Jan 30 09:47:18 2023 +0100
47.3 @@ -271,7 +271,7 @@
47.4 ([],(User', [], [], TermC.empty, TermC.empty,Sundef))]:ets;
47.5 val l0 = [];
47.6 " --------------- 1. ---------------------------------------------";
47.7 -val (pt,_) = cappend_atomic pt[1]Istate.empty TermC.empty(Rewrite("test", ""))(TermC.parse_test @{context} ct,[])Complete;
47.8 +val (pt,_) = cappend_atomic pt[1]Istate.empty TermC.empty(Rewrite("test", ""))(ParseC.parse_test @{context} ct,[])Complete;
47.9 (*12.10.03:*** Unknown theorem(s) "rroot_square_inv"
47.10 val Applicable.Yes m' = Step.check (Rewrite("rroot_square_inv", "")) (pt, p);
47.11 *)
48.1 --- a/test/Tools/isac/ProgLang/auto_prog.sml Sun Jan 29 14:31:56 2023 +0100
48.2 +++ b/test/Tools/isac/ProgLang/auto_prog.sml Mon Jan 30 09:47:18 2023 +0100
48.3 @@ -51,9 +51,9 @@
48.4 if UnparseC.terms (formal_args auto_script) = "[\"t_t\", \"v\"]"
48.5 then () else error "formal_args of auto-gen.script changed";
48.6
48.7 - Istate.init_detail ctxt (Rewrite_Set_Inst (["(''bdv'', x)"], "integration_rules")) (TermC.parse_test @{context} "someTermWithBdv");
48.8 + Istate.init_detail ctxt (Rewrite_Set_Inst (["(''bdv'', x)"], "integration_rules")) (ParseC.parse_test @{context} "someTermWithBdv");
48.9 "~~~~~ fun init_detail , args:"; val ((Tactic.Rewrite_Set_Inst (subs, rls)), t)
48.10 - = ((Rewrite_Set_Inst (["(''bdv'', x)"], "integration_rules")), TermC.parse_test @{context} "someTermWithBdv");
48.11 + = ((Rewrite_Set_Inst (["(''bdv'', x)"], "integration_rules")), ParseC.parse_test @{context} "someTermWithBdv");
48.12 val v = case Tactic.subst_adapt_to_type ctxt subs of
48.13 (_, v) :: _ => v;
48.14 (*case*) get_rls ctxt rls (*of*);
49.1 --- a/test/Tools/isac/ProgLang/evaluate.sml Sun Jan 29 14:31:56 2023 +0100
49.2 +++ b/test/Tools/isac/ProgLang/evaluate.sml Mon Jan 30 09:47:18 2023 +0100
49.3 @@ -47,7 +47,7 @@
49.4 "----------- fun calculate_ --------------------------------------------------------------------";
49.5 "----------- fun calculate_ --------------------------------------------------------------------";
49.6 (* fun rewrite__set_ \<longrightarrow> fun rew_once works the same way *)
49.7 -val t = TermC.parse_test @{context} "((1+2)*4/3) \<up> 2";
49.8 +val t = ParseC.parse_test @{context} "((1+2)*4/3) \<up> 2";
49.9 val thy = @{theory};
49.10 val ctxt = Proof_Context.init_global @{theory}
49.11 val times = ("Groups.times_class.times", Calc_Binop.numeric "#mult_") : string * Eval.ml_fun;
49.12 @@ -145,7 +145,7 @@
49.13 rewrite_set_ ctxt false tval_rls t;
49.14 (*val it = SOME (Const (\<^const_name>\<open>True\<close>, "bool"),[]) ... works*)
49.15
49.16 - val t = TermC.parse_test @{context} "2 * x is_num";
49.17 + val t = ParseC.parse_test @{context} "2 * x is_num";
49.18 val NONE = eval_is_num "" "" t (@{theory "Isac_Knowledge"});
49.19
49.20
49.21 @@ -320,7 +320,7 @@
49.22 val (thy, op_, ef, arg) =
49.23 (thy, "EqSystem.occur_exactly_in",
49.24 get_calc (@{theory "EqSystem"} |> Proof_Context.init_global) "occur_exactly_in" |> snd |> snd,
49.25 - TermC.parse_test @{context}
49.26 + ParseC.parse_test @{context}
49.27 "[] from [c, c_2, c_3, c_4] occur_exactly_in - 1 * (q_0 * L \<up> 2) / 2"
49.28 );
49.29 val SOME (str, simpl) = get_pair ctxt op_ ef arg;
49.30 @@ -332,7 +332,7 @@
49.31 "----------- calculate (2 * x is_num) -------------------";
49.32 "----------- calculate (2 * x is_num) -------------------";
49.33 "----------- calculate (2 * x is_num) -------------------";
49.34 -val t = TermC.parse_test @{context} "(2::real) * x is_num";
49.35 +val t = ParseC.parse_test @{context} "(2::real) * x is_num";
49.36
49.37 val SOME (str, t') = eval_is_num "" "Prog_Expr.is_num" t @{theory Test};
49.38 if UnparseC.term t' = "(2 * x is_num) = False" then ()
49.39 @@ -471,7 +471,7 @@
49.40 "----------- fun adhoc_thm \<longrightarrow> exception TYPE --------------------------------------------------";
49.41 "----------- fun adhoc_thm \<longrightarrow> exception TYPE --------------------------------------------------";
49.42 "----------- fun adhoc_thm \<longrightarrow> exception TYPE --------------------------------------------------";
49.43 -val t = TermC.parse_test @{context} "sqrt 4";
49.44 +val t = ParseC.parse_test @{context} "sqrt 4";
49.45 Eval.adhoc_thm @{context} ("NthRoot.sqrt", eval_sqrt "#sqrt_") t;
49.46
49.47 "~~~~~ fun adhoc_thm , args:"; val (thy, (op_, eval_fn), ct) =
50.1 --- a/test/Tools/isac/ProgLang/listC.sml Sun Jan 29 14:31:56 2023 +0100
50.2 +++ b/test/Tools/isac/ProgLang/listC.sml Mon Jan 30 09:47:18 2023 +0100
50.3 @@ -47,7 +47,7 @@
50.4 val ctxt = Proof_Context.init_global @{theory}
50.5 val prog_expr = get_rls @{context} "prog_expr"
50.6
50.7 -val t = TermC.parse_test @{context} "NTH 1 [a,b,c,d,e]";
50.8 +val t = ParseC.parse_test @{context} "NTH 1 [a,b,c,d,e]";
50.9 TermC.atom_trace_detail @{context} t;
50.10 val thm = Thm.prop_of @{thm NTH_NIL};
50.11 TermC.atom_trace_detail @{context} thm;
50.12 @@ -55,8 +55,8 @@
50.13 if UnparseC.term t' = "a" then ()
50.14 else error "NTH 1 [a,b,c,d,e] = a ..changed";
50.15
50.16 -val t = TermC.parse_test @{context} "NTH 3 [a,b,c,d,e]";
50.17 -case TermC.parse_test @{context} "NTH 3 [a,b,c,d,e]" of
50.18 +val t = ParseC.parse_test @{context} "NTH 3 [a,b,c,d,e]";
50.19 +case ParseC.parse_test @{context} "NTH 3 [a,b,c,d,e]" of
50.20 Const (\<^const_name>\<open>NTH\<close>, _) $ (Const (\<^const_name>\<open>numeral\<close>, _) $ (Const (\<^const_name>\<open>num.Bit1\<close>, _) $ Const (\<^const_name>\<open>num.One\<close>, _))) $
50.21 (Const (\<^const_name>\<open>Cons\<close>, _) $ Free ("a", _) $
50.22 (Const (\<^const_name>\<open>Cons\<close>, _) $ Free ("b", _) $
50.23 @@ -71,7 +71,7 @@
50.24 else error "NTH 3 [a,b,c,d,e] = NTH (3 + - 1) [b, c, d, e] ..changed";
50.25
50.26 (* now the argument "(3 + - 1)" etc needs to be evaluated in the assumption of NTH_CONS *)
50.27 -val t = TermC.parse_test @{context} "NTH 3 [a,b,c,d,e]";
50.28 +val t = ParseC.parse_test @{context} "NTH 3 [a,b,c,d,e]";
50.29 TermC.atom_trace_detail @{context} t;
50.30
50.31 val SOME (t', _) = rewrite_set_ ctxt false prog_expr t;
50.32 @@ -84,7 +84,7 @@
50.33 val prog_expr = get_rls @{context} "prog_expr"
50.34
50.35 val thy = @{theory ListC};
50.36 -val t = TermC.parse_test @{context} "Length [1, 1, 1]";
50.37 +val t = ParseC.parse_test @{context} "Length [1, 1, 1]";
50.38 val SOME (t, asm) = rewrite_ ctxt tless_true tval_rls false @{thm LENGTH_CONS} t;
50.39 UnparseC.term t = "1 + Length [1, 1]";
50.40 val SOME (t, asm) = rewrite_ ctxt tless_true tval_rls false @{thm LENGTH_CONS} t;
50.41 @@ -97,12 +97,12 @@
50.42 if UnparseC.term t = "1 + (1 + (1 + 0))" then ()
50.43 else error "Length [1, 1, 1] = 1 + (1 + (1 + 0)) ..changed";
50.44
50.45 -val t = TermC.parse_test @{context} "Length [1, 1, 1]";
50.46 +val t = ParseC.parse_test @{context} "Length [1, 1, 1]";
50.47 val SOME (t, asm) = rewrite_set_ ctxt false prog_expr t;
50.48 if UnparseC.term t = "3" then ()
50.49 else error "Length [1, 1, 1] = 3 ..prog_expr changed";
50.50
50.51 -val t = TermC.parse_test @{context} "Length [1, 1, 1]";
50.52 +val t = ParseC.parse_test @{context} "Length [1, 1, 1]";
50.53 val t = eval_prog_expr ctxt prog_expr t;
50.54 case t of
50.55 Const (\<^const_name>\<open>numeral\<close>, _) $ (Const (\<^const_name>\<open>num.Bit1\<close>, _) $ Const (\<^const_name>\<open>num.One\<close>, _)) => ()
51.1 --- a/test/Tools/isac/ProgLang/prog_expr.sml Sun Jan 29 14:31:56 2023 +0100
51.2 +++ b/test/Tools/isac/ProgLang/prog_expr.sml Mon Jan 30 09:47:18 2023 +0100
51.3 @@ -58,7 +58,7 @@
51.4 "-------- fun eval_is_even ---------------------------------------------------------------------";
51.5 "-------- fun eval_is_even ---------------------------------------------------------------------";
51.6 "-------- fun eval_is_even ---------------------------------------------------------------------";
51.7 -val t = TermC.parse_test @{context} "2 is_even";
51.8 +val t = ParseC.parse_test @{context} "2 is_even";
51.9 eval_is_even "aaa" "Prog_Expr.is_even" t "ccc";
51.10 "~~~~~ fun eval_is_even , args:"; val ((thmid:string), "Prog_Expr.is_even", (t as (Const _ $ arg)), _) =
51.11 ("aaa", "Prog_Expr.is_even", t, "ccc");
51.12 @@ -71,14 +71,14 @@
51.13 if UnparseC.term t' = "(2 is_even) = True" then () else error "(2 is_even) = True CHANGED";
51.14
51.15
51.16 -val t = TermC.parse_test @{context} "3 is_even";
51.17 +val t = ParseC.parse_test @{context} "3 is_even";
51.18 case eval_is_even "aaa" "Prog_Expr.is_even" t "ccc" of
51.19 SOME (str, t') =>
51.20 if str = "aaa_" andalso UnparseC.term t' = "(3 is_even) = False" then ()
51.21 else error "eval_is_even (3 is_even) CHANGED 1"
51.22 | NONE => error "eval_is_even (3 is_even) CHANGED 2";
51.23
51.24 -val t = TermC.parse_test @{context} "a ::real";
51.25 +val t = ParseC.parse_test @{context} "a ::real";
51.26 val NONE =
51.27 eval_is_even "aaa" "Prog_Expr.is_even" t "ccc";
51.28 case eval_is_even "aaa" "Prog_Expr.is_even" t "ccc" of
51.29 @@ -95,27 +95,27 @@
51.30 SOME (Const (\<^const_name>\<open>True\<close>, _), []) => ()
51.31 | _ => error "2 is_num CHANGED";
51.32
51.33 -val t = TermC.parse_test @{context} "2 * x is_num";
51.34 +val t = ParseC.parse_test @{context} "2 * x is_num";
51.35 val SOME (str, t') = eval_is_num "" "Prog_Expr.is_num" t (@{theory "Isac_Knowledge"});
51.36 if UnparseC.term t' = "(2 * x is_num) = False" then ()
51.37 else error "(2 * x is_num) = False CHANGED";
51.38
51.39 -val t = TermC.parse_test @{context} "- 2 is_num";
51.40 +val t = ParseC.parse_test @{context} "- 2 is_num";
51.41 val SOME (str, t') = eval_is_num "" "Prog_Expr.is_num" t (@{theory "Isac_Knowledge"});
51.42 if UnparseC.term t' = "(- 2 is_num) = True" then ()
51.43 else error "(- 2 is_num) = False CHANGED";
51.44
51.45 -val t = TermC.parse_test @{context} "- 1 is_num";
51.46 +val t = ParseC.parse_test @{context} "- 1 is_num";
51.47 val SOME (str, t') = eval_is_num "" "Prog_Expr.is_num" t (@{theory "Isac_Knowledge"});
51.48 if UnparseC.term t' = "(- 1 is_num) = True" then ()
51.49 else error "(- 1 is_num) = False CHANGED";
51.50
51.51 -val t = TermC.parse_test @{context} "0 is_num";
51.52 +val t = ParseC.parse_test @{context} "0 is_num";
51.53 val SOME (str, t') = eval_is_num "" "Prog_Expr.is_num" t (@{theory "Isac_Knowledge"});
51.54 if UnparseC.term t' = "(0 is_num) = True" then ()
51.55 else error "(0 is_num) = False CHANGED";
51.56
51.57 -val t = TermC.parse_test @{context} "AA is_num";
51.58 +val t = ParseC.parse_test @{context} "AA is_num";
51.59 val SOME (str, t') = eval_is_num "" "Prog_Expr.is_num" t (@{theory "Isac_Knowledge"});
51.60 if UnparseC.term t' = "(AA is_num) = False" then ()
51.61 else error "(0 is_num) = False CHANGED";
51.62 @@ -204,20 +204,20 @@
51.63 val thy = @{theory}
51.64 val ctxt = (ThyC.id_to_ctxt "Isac_Knowledge")
51.65
51.66 -val t = TermC.parse_test @{context} "x = 0";
51.67 +val t = ParseC.parse_test @{context} "x = 0";
51.68 val NONE(*= indetermined*) = eval_equal "equal_" \<^const_name>\<open>HOL.eq\<close> t ctxt;
51.69
51.70 -val t = TermC.parse_test @{context} "(x + 1) = (x + 1)";
51.71 +val t = ParseC.parse_test @{context} "(x + 1) = (x + 1)";
51.72 val (Const _(*op0,t0*) $ t1 $ t2 ) = t
51.73 val SOME ("equal_(x + 1)_(x + 1)", t') = eval_equal "equal_" \<^const_name>\<open>HOL.eq\<close> t ctxt;
51.74 if UnparseC.term t' = "(x + 1 = x + 1) = True" then () else error "(x + 1) = (x + 1) CHANGED";
51.75
51.76 -val t as Const _ $ v $ c = TermC.parse_test @{context} "1 = 0";
51.77 +val t as Const _ $ v $ c = ParseC.parse_test @{context} "1 = 0";
51.78 val false = variable_constant_pair (v, c);
51.79 val SOME ("equal_(1)_(0)", t') = eval_equal "equal_" \<^const_name>\<open>HOL.eq\<close> t ctxt;
51.80 if UnparseC.term t' = "(1 = 0) = False" then () else error "1 = 0 CHANGED";
51.81
51.82 -val t = TermC.parse_test @{context} "0 = 0";
51.83 +val t = ParseC.parse_test @{context} "0 = 0";
51.84 val SOME ("equal_(0)_(0)", t') = eval_equal "equal_" \<^const_name>\<open>HOL.eq\<close> t ctxt;
51.85 if UnparseC.term t' = "(0 = 0) = True" then () else error "0 = 0 CHANGED";
51.86
51.87 @@ -228,7 +228,7 @@
51.88 val t = @{term "x::real"};
51.89 if occurs_in t t then "OK" else error "occurs_in x x -> f ..changed";
51.90
51.91 -val t = TermC.parse_test @{context} "x occurs_in x";
51.92 +val t = ParseC.parse_test @{context} "x occurs_in x";
51.93 val SOME (str, t') = eval_occurs_in 0 "Prog_Expr.occurs_in" t 0;
51.94 if UnparseC.term t' = "x occurs_in x = True" then ()
51.95 else error "x occurs_in x = True ..changed";
51.96 @@ -337,7 +337,7 @@
51.97 "---------fun eval_argument_of -----------------------------------------------------------------";
51.98 "---------fun eval_argument_of -----------------------------------------------------------------";
51.99 "---------fun eval_argument_of -----------------------------------------------------------------";
51.100 -val t = TermC.parse_test @{context} "argument_in (M_b x)";
51.101 +val t = ParseC.parse_test @{context} "argument_in (M_b x)";
51.102 val SOME (str, t') = eval_argument_in "0" "Prog_Expr.argument_in" t 0;
51.103 if UnparseC.term t' = "(argument_in M_b x) = x" then ()
51.104 else error "atools.sml:(argument_in M_b x) = x ???";
51.105 @@ -450,10 +450,10 @@
51.106 "-------- fun matchsub -------------------------------------------------------------------------";
51.107 "-------- fun matchsub -------------------------------------------------------------------------";
51.108 "-------- fun matchsub -------------------------------------------------------------------------";
51.109 -if matchsub thy (TermC.parse_test @{context} "(a + (b + c))") (TermC.parse_patt_test @{theory} "?x + (?y + ?z)")
51.110 +if matchsub thy (ParseC.parse_test @{context} "(a + (b + c))") (ParseC.parse_patt_test @{theory} "?x + (?y + ?z)")
51.111 then () else error "tools.sml matchsub a + (b + c)";
51.112
51.113 -if matchsub thy (TermC.parse_test @{context} "(a + (b + c)) + d") (TermC.parse_patt_test @{theory} "?x + (?y + ?z)")
51.114 +if matchsub thy (ParseC.parse_test @{context} "(a + (b + c)) + d") (ParseC.parse_patt_test @{theory} "?x + (?y + ?z)")
51.115 then () else error "tools.sml matchsub (a + (b + c)) + d";
51.116
51.117
51.118 @@ -465,9 +465,9 @@
51.119 | _ => error "TermC.UniversalList changed 1";
51.120 case or2list @{term False} of Const (\<^const_name>\<open>Nil\<close>, _) => ()
51.121 | _ => error "TermC.UniversalList changed 2";
51.122 -val t = (TermC.parse_test @{context} "x=3");
51.123 +val t = (ParseC.parse_test @{context} "x=3");
51.124 if UnparseC.term (or2list t) = "[x = 3]" then ()
51.125 else error "or2list changed";
51.126 -val t = (TermC.parse_test @{context} "x=3 | x=-3 | x=0");
51.127 +val t = (ParseC.parse_test @{context} "x=3 | x=-3 | x=0");
51.128 if UnparseC.term (or2list t) = "[x = 3, x = - 3, x = 0]" then ()
51.129 else error "HOL.eq ? HOL.disj ? changed";
52.1 --- a/test/Tools/isac/Specify/m-match.sml Sun Jan 29 14:31:56 2023 +0100
52.2 +++ b/test/Tools/isac/Specify/m-match.sml Mon Jan 30 09:47:18 2023 +0100
52.3 @@ -60,7 +60,7 @@
52.4 Free (dI',_) $
52.5 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.6 (*...copied from LItool.tac_from_prog*)
52.7 - TermC.parse_test @{context} (
52.8 + ParseC.parse_test @{context} (
52.9 "SubProblem (EqSystemX, [LINEAR, system], [no_met]) " ^
52.10 " [BOOL_LIST [c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]," ^
52.11 " REAL_LIST [c, c_2]]");
52.12 @@ -85,7 +85,7 @@
52.13 Free (dI',_) $
52.14 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.15 (*...copied from LItool.tac_from_prog*)
52.16 - TermC.parse_test @{context} (
52.17 + ParseC.parse_test @{context} (
52.18 "SubProblem (EqSystemX, [LINEAR, system], [no_met]) " ^
52.19 " [BOOL_LIST [c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]," ^
52.20 " REAL_LIST [c, c_2], BOOL_LIST ss''']");
52.21 @@ -111,7 +111,7 @@
52.22 Free (dI',_) $
52.23 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.24 (*...copied from LItool.tac_from_prog*)
52.25 - TermC.parse_test @{context} (
52.26 + ParseC.parse_test @{context} (
52.27 "SubProblem (EqSystemX, [LINEAR, system], [no_met]) " ^
52.28 " [REAL_LIST [c, c_2]]");
52.29 val ags = isalist2list ags';
52.30 @@ -151,7 +151,7 @@
52.31 Free (dI',_) $
52.32 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.33 (*...copied from LItool.tac_from_prog*)
52.34 - TermC.parse_test @{context} (
52.35 + ParseC.parse_test @{context} (
52.36 "SubProblem (EqSystemX, [LINEAR, system], [no_met]) " ^
52.37 " [BOOL_LIST [c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]," ^
52.38 " REAL_LIST [c, c_2]]");
52.39 @@ -176,7 +176,7 @@
52.40 Free (dI',_) $
52.41 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.42 (*...copied from LItool.tac_from_prog*)
52.43 - TermC.parse_test @{context} (
52.44 + ParseC.parse_test @{context} (
52.45 "SubProblem (EqSystemX, [LINEAR, system], [no_met]) " ^
52.46 " [BOOL_LIST [c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]," ^
52.47 " REAL_LIST [c, c_2], BOOL_LIST ss''']");
52.48 @@ -202,7 +202,7 @@
52.49 Free (dI',_) $
52.50 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.51 (*...copied from LItool.tac_from_prog*)
52.52 - TermC.parse_test @{context} (
52.53 + ParseC.parse_test @{context} (
52.54 "SubProblem (EqSystemX, [LINEAR, system], [no_met]) " ^
52.55 " [REAL_LIST [c, c_2]]");
52.56 val ags = isalist2list ags';
52.57 @@ -247,7 +247,7 @@
52.58 Free (dI',_) $
52.59 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.60 (*...copied from LItool.tac_from_prog*)
52.61 - TermC.parse_test @{context} (
52.62 + ParseC.parse_test @{context} (
52.63 "SubProblem (TestX,[univariate,equation,test]," ^
52.64 " [no_met]) [BOOL (x+1=2), REAL x]");
52.65 val AGS = isalist2list ags';
52.66 @@ -265,7 +265,7 @@
52.67 Free (dI',_) $
52.68 (Const (\<^const_name>\<open>Pair\<close>,_) $ pI' $ mI')) $ ags' =
52.69 (*...copied from LItool.tac_from_prog*)
52.70 - TermC.parse_test @{context} (
52.71 + ParseC.parse_test @{context} (
52.72 "SubProblem (TestX,[univariate,equation,test]," ^
52.73 " [no_met]) [BOOL (x+1=2), REAL x]");
52.74 val AGS = isalist2list ags';
53.1 --- a/test/Tools/isac/Specify/o-model.sml Sun Jan 29 14:31:56 2023 +0100
53.2 +++ b/test/Tools/isac/Specify/o-model.sml Mon Jan 30 09:47:18 2023 +0100
53.3 @@ -257,7 +257,7 @@
53.4 val pbt = [("#Given", (@{term "equality"}, @{term "e_e :: bool"})),
53.5 ("#Given", (@{term "solveFor"}, @{term "v_v :: real"} ))];
53.6 (*the model specific for an example*)
53.7 -val oris = [([1], "#Given", @{term "equality"} , [TermC.parse_test @{context} "x+1= 2"]),
53.8 +val oris = [([1], "#Given", @{term "equality"} , [ParseC.parse_test @{context} "x+1= 2"]),
53.9 ([1], "#Given", @{term "solveFor"} , [@{term "x :: real"} ])];
53.10 val cy = [("#Find", (@{term "solutions"}, @{term "v_v'i' :: bool list"}))];
53.11 (*...all must be true*)
53.12 @@ -274,7 +274,7 @@
53.13 val pbt = [("#Given", (@{term "equalities"}, @{term "e_s :: bool list"})),
53.14 ("#Given", (@{term "solveForVars v_s"}, @{term "v_s :: bool list"} ))];
53.15 (*the model specific for an example*)
53.16 -val oris = [([1], "#Given", @{term "equalities"} ,[TermC.parse_test @{context} "[x_1+1=2,x_2=0]"]),
53.17 +val oris = [([1], "#Given", @{term "equalities"} ,[ParseC.parse_test @{context} "[x_1+1=2,x_2=0]"]),
53.18 ([1], "#Given", @{term "solveForVars"} , [@{term "[x_1,x_2]::real list"}])];
53.19 val cy = [("#Find", (@{term "solution"}, @{term "ss''' :: bool list"}))
53.20 (*could be more than 1*)];