1.1 --- a/TODO.md Mon Dec 11 16:18:42 2023 +0100
1.2 +++ b/TODO.md Mon Dec 11 17:26:30 2023 +0100
1.3 @@ -45,19 +45,18 @@
1.4 ***** priority of WN items is top down, most urgent/simple on top
1.5
1.6 * WN:
1.7 -* WN: clarify handling "#undef" -> type m_field +++ bool in i_single
1.8 +* WN: I_Model: review/rename seek_ppc, overwrite_ppc
1.9 * WN: replace I_Model.feedb_values -> val get_values = Pre_Conds.get_values
1.10 * WN: replace I_Model.descriptor with fun descr_exists: descriptor -> feedback -> bool
1.11 * WN: review Model_Def.is_list_descr, replace by Term.is_list. Exception: make_values
1.12 (values determine handling_lists by [[..], [..], ..])
1.13 * WN: review Specify.select_inc_lists .. should not be necessary
1.14 * WN: intro-fn into M_Match
1.15 -* WN: after--^^^ replace I_Model.descriptor_POS with Model_Def.get_descr, ELIMI_Model.descriptor
1.16 -* WN: thy --> ctxt in by_Add_, ? I_Model.T_POS ?
1.17 +* WN: after--^^^ replace I_Model.descriptor with Model_Def.get_descr, ELIMI_Model.descriptor
1.18 +* WN: thy --> ctxt in by_Add_, ? I_Model.T ?
1.19 try to do the same in as many functions as possible
1.20 * WN: rename type Rule.rule -> Rule.T
1.21 -* WN: use fn in add_single and further funs in i-model.sml
1.22 -* WN: reconsider design max_variants/_POS
1.23 +* WN: clarify handling "#undef" -> type m_field +++ bool in i_single
1.24 * WN: simplify "" in O_Model.to_string "(3, [\"1\", \"2\", \"3\"], #Find, AdditionalValues, [\"[u]\", \"[v]\"])"
1.25 * WN: review PblObj {meth, ...}
1.26 * fill early (Model_Problem?) with Inc [] presents input-templates
2.1 --- a/src/Tools/isac/BaseDefinitions/environment.sml Mon Dec 11 16:18:42 2023 +0100
2.2 +++ b/src/Tools/isac/BaseDefinitions/environment.sml Mon Dec 11 17:26:30 2023 +0100
2.3 @@ -6,8 +6,6 @@
2.4 sig
2.5 type T
2.6 val empty: T
2.7 - type T_POS
2.8 - val T_POS_to_string: T_POS -> string
2.9
2.10 val env2str: subst -> string
2.11 val env2str': subst -> string
2.12 @@ -27,15 +25,6 @@
2.13 (**)
2.14 type T = LibraryC.subst;
2.15 val empty = []: T
2.16 -type T_POS = (term * term list) list
2.17 -
2.18 -fun T_POS_to_string env_POS =
2.19 - let
2.20 - val ctxt = ContextC.for_ERROR ()
2.21 - in
2.22 - env_POS |> map (fn (t, ts) => "(" ^ UnparseC.term ctxt t ^ ", " ^ UnparseC.terms ctxt ts^ ")")
2.23 - |> strs2str'
2.24 - end
2.25
2.26 fun subst2str s =
2.27 let
3.1 --- a/src/Tools/isac/BridgeJEdit/preliminary.sml Mon Dec 11 16:18:42 2023 +0100
3.2 +++ b/src/Tools/isac/BridgeJEdit/preliminary.sml Mon Dec 11 17:26:30 2023 +0100
3.3 @@ -7,7 +7,7 @@
3.4
3.5 signature PRELIMINARY =
3.6 sig
3.7 - val check_input: Model_Pattern.model_input_pos -> I_Model.T_POS
3.8 + val check_input: Model_Pattern.model_input_pos -> I_Model.T
3.9 val init_ctree: theory -> string -> CTbasic.ctree
3.10 val update_state: theory -> string * (Model_Pattern.model_input_pos * References.input) ->
3.11 CTbasic.ctree -> CTbasic.ctree
3.12 @@ -25,7 +25,7 @@
3.13 * parse_references_input works
3.14 * switching \<Odot>\<Otimes> i_model for probl and meth works.
3.15 *)
3.16 -fun check_input (*ctxt o-model ??*) (_: Model_Pattern.model_input_pos) = []: I_Model.T_POS (*TODO*)
3.17 +fun check_input (*ctxt o-model ??*) (_: Model_Pattern.model_input_pos) = []: I_Model.T (*TODO*)
3.18 (** first trial: init or update state **)
3.19
3.20 (* at the first encounter of an Example create the following data and transfer them to ctree:
3.21 @@ -44,11 +44,11 @@
3.22 Store.get (Know_Store.get_expls @{theory}) example_id' example_id'
3.23 val {model = model_patt, ...} = Problem.from_store ctxt probl_id
3.24 val (o_model, ctxt) = O_Model.init thy model model_patt
3.25 - val i_model_empty = I_Model.init_POS ctxt o_model model_patt
3.26 + val i_model_empty = I_Model.init ctxt o_model model_patt
3.27 in
3.28 CTbasic.Nd (CTbasic.PblObj {
3.29 fmz = fmz, origin = (o_model, refs, TermC.empty (*TODO handle CAS_Cmd*)),
3.30 - spec = References.empty, probl = i_model_empty, meth = I_Model.empty_POS,
3.31 + spec = References.empty, probl = i_model_empty, meth = I_Model.empty,
3.32 ctxt = ctxt, loc = (NONE, NONE),
3.33 branch = CTbasic.NoBranch, ostate = CTbasic.Incomplete, result = (TermC.empty, [])}, [])
3.34 end
4.1 --- a/src/Tools/isac/BridgeJEdit/template.sml Mon Dec 11 16:18:42 2023 +0100
4.2 +++ b/src/Tools/isac/BridgeJEdit/template.sml Mon Dec 11 17:26:30 2023 +0100
4.3 @@ -5,7 +5,7 @@
4.4 2. The template is filled from hidden data:
4.5 2.1. \<open>Model\<close>:
4.6 The elements come with hints for input the format,
4.7 - see test/../i-model.sml --- build I_Model.init_POS ---
4.8 + see test/../i-model.sml --- build I_Model.init ---
4.9 2.2 \<open>References\<close>:
4.10 * The elements come with hints for input the format, see test/../Test_VSCode_Example.thy
4.11 * toggle \<Odot>\<Otimes> determines whether the \<open>Model\<close> relates to \<open>Problem_Ref\<close> or \<open>Method_Ref\<close>
4.12 @@ -18,16 +18,16 @@
4.13 signature TEMPLATE =
4.14 sig
4.15 datatype feedback = Correct | Incomplete | SyntaxError | Superfluous | False
4.16 - val show: Proof.context -> (bool * term) list -> I_Model.T_POS -> References.input -> unit
4.17 + val show: Proof.context -> (bool * term) list -> I_Model.T -> References.input -> unit
4.18
4.19 (*from isac_test for Minisubpbl*)
4.20 type model_out
4.21 val model_to_string: model_out -> string
4.22 val refs_to_string: References.input -> string
4.23 - val model_to_out: Proof.context -> (bool * term) list -> I_Model.T_POS -> model_out
4.24 - val items_to_out: Proof.context -> Model_Pattern.m_field -> I_Model.T_POS ->
4.25 + val model_to_out: Proof.context -> (bool * term) list -> I_Model.T -> model_out
4.26 + val items_to_out: Proof.context -> Model_Pattern.m_field -> I_Model.T ->
4.27 Model_Pattern.m_field * (UnparseC.term_as_string * feedback) list
4.28 - val item_to_out: Proof.context -> I_Model.single_POS -> UnparseC.term_as_string * feedback
4.29 + val item_to_out: Proof.context -> I_Model.single -> UnparseC.term_as_string * feedback
4.30
4.31 \<^isac_test>\<open>
4.32 (**)
4.33 @@ -76,17 +76,17 @@
4.34
4.35 (** create output format **)
4.36
4.37 -fun item_to_out ctxt (_, _, _, _, (I_Model.Cor_POS dsc_ts, _)) =
4.38 +fun item_to_out ctxt (_, _, _, _, (I_Model.Cor dsc_ts, _)) =
4.39 (dsc_ts |> Term.list_comb |> UnparseC.term ctxt, Correct)
4.40 - | item_to_out _ (_, _, _, _, (I_Model.Syn_POS (term_as_string), _)) =
4.41 + | item_to_out _ (_, _, _, _, (I_Model.Syn (term_as_string), _)) =
4.42 (term_as_string, Incomplete)
4.43
4.44 - | item_to_out ctxt (_, _, _, _, (I_Model.Inc_POS (dsc, []), _)) =
4.45 + | item_to_out ctxt (_, _, _, _, (I_Model.Inc (dsc, []), _)) =
4.46 (UnparseC.term ctxt dsc ^ " " ^ Model_Pattern.empty_for dsc, Incomplete)
4.47 - | item_to_out ctxt (_, _, _, _, (I_Model.Inc_POS (dsc_ts), _)) =
4.48 + | item_to_out ctxt (_, _, _, _, (I_Model.Inc (dsc_ts), _)) =
4.49 (dsc_ts |> Term.list_comb |> UnparseC.term ctxt, Incomplete)
4.50
4.51 - | item_to_out ctxt (_, _, _, _, (I_Model.Sup_POS dsc_ts, _)) =
4.52 + | item_to_out ctxt (_, _, _, _, (I_Model.Sup dsc_ts, _)) =
4.53 (dsc_ts |> Term.list_comb |> UnparseC.term ctxt, Superfluous)
4.54
4.55 fun items_to_out ctxt m_field items =
5.1 --- a/src/Tools/isac/BridgeLibisabelle/datatypes.sml Mon Dec 11 16:18:42 2023 +0100
5.2 +++ b/src/Tools/isac/BridgeLibisabelle/datatypes.sml Mon Dec 11 17:26:30 2023 +0100
5.3 @@ -83,39 +83,39 @@
5.4 if str = s then (t1 $ t2) :: filt ps else filt ps
5.5 in filt end;
5.6
5.7 -(*T_POSold*)
5.8 -fun xml_of_itm_ (I_Model.Cor_POS (dts)) =
5.9 +(*Told*)
5.10 +fun xml_of_itm_ (I_Model.Cor (dts)) =
5.11 XML.Elem (("ITEM", [("status", "correct")]), [xml_of_term (Input_Descript.join' dts)])
5.12 - | xml_of_itm_ (I_Model.Syn_POS c) =
5.13 + | xml_of_itm_ (I_Model.Syn c) =
5.14 XML.Elem (("ITEM", [("status", "syntaxerror")]), [XML.Text c])
5.15 - | xml_of_itm_ (I_Model.Inc_POS (dts)) =
5.16 + | xml_of_itm_ (I_Model.Inc (dts)) =
5.17 XML.Elem (("ITEM", [("status", "incomplete")]), [xml_of_term (Input_Descript.join' dts)])
5.18 - | xml_of_itm_ (I_Model.Sup_POS dts) =
5.19 + | xml_of_itm_ (I_Model.Sup dts) =
5.20 XML.Elem (("ITEM", [("status", "superfluous")]), [xml_of_term (Input_Descript.join' dts)])
5.21 -fun xml_of_itms (itms: I_Model.T_POS) =
5.22 +fun xml_of_itms (itms: I_Model.T) =
5.23 let
5.24 fun extract (_, _, _, _, (itm_, _)) = itm_
5.25 in map (xml_of_itm_ o extract) itms end
5.26 -(*T_POS*)
5.27 -fun xml_of_itm_POS (I_Model.Cor_POS dts) =
5.28 +(*T*)
5.29 +fun xml_of_itm (I_Model.Cor dts) =
5.30 XML.Elem (("ITEM", [("status", "correct")]), [xml_of_term (Input_Descript.join' dts)])
5.31 - | xml_of_itm_POS (I_Model.Syn_POS c) =
5.32 + | xml_of_itm (I_Model.Syn c) =
5.33 XML.Elem (("ITEM", [("status", "syntaxerror")]), [XML.Text c])
5.34 - | xml_of_itm_POS (I_Model.Inc_POS dts) =
5.35 + | xml_of_itm (I_Model.Inc dts) =
5.36 XML.Elem (("ITEM", [("status", "incomplete")]), [xml_of_term (Input_Descript.join' dts)])
5.37 - | xml_of_itm_POS (I_Model.Sup_POS dts) =
5.38 + | xml_of_itm (I_Model.Sup dts) =
5.39 XML.Elem (("ITEM", [("status", "superfluous")]), [xml_of_term (Input_Descript.join' dts)])
5.40 -fun xml_of_itms_POS itms =
5.41 +fun xml_of_itms itms =
5.42 let
5.43 - fun extract (_, _, _, _, itm_) = itm_
5.44 - in map (xml_of_itm_POS o extract) itms end
5.45 -(*T_POSnew*)
5.46 + fun extract (_, _, _, _, (itm_, _)) = itm_
5.47 + in map (xml_of_itm o extract) itms end
5.48 +(*Tnew*)
5.49
5.50 fun xml_of_precond (status, term) =
5.51 XML.Elem (("ITEM", [("status", if status then "correct" else "false")]), [xml_of_term term])
5.52 fun xml_of_preconds ps = map xml_of_precond ps
5.53
5.54 -fun xml_of_model (itms: I_Model.T_POS) where_ =
5.55 +fun xml_of_model (itms: I_Model.T) where_ =
5.56 let
5.57 fun eq str (_, _, _,field, _) = str = field
5.58 in
6.1 --- a/src/Tools/isac/Interpret/li-tool.sml Mon Dec 11 16:18:42 2023 +0100
6.2 +++ b/src/Tools/isac/Interpret/li-tool.sml Mon Dec 11 17:26:30 2023 +0100
6.3 @@ -14,7 +14,7 @@
6.4 val associate: Ctree.state -> Proof.context -> (Tactic.T * term (*..Prog_Tac*)) -> ass
6.5
6.6 val parent_node: Ctree.ctree -> Pos.pos' -> bool * Pos.pos * Rule_Set.T * Proof.context
6.7 - val init_pstate: Proof.context -> I_Model.T_POS -> MethodC.id ->
6.8 + val init_pstate: Proof.context -> I_Model.T -> MethodC.id ->
6.9 Istate.T * Proof.context * Program.T
6.10 val resume_prog: Pos.pos' -> Ctree.ctree ->
6.11 (Istate.T * Proof.context) * Program.T
6.12 @@ -27,7 +27,7 @@
6.13 val tac_from_prog: Ctree.state -> term -> Tactic.input
6.14
6.15 (*from isac_test for Minisubpbl*)
6.16 - val arguments_from_model: Proof.context -> MethodC.id -> I_Model.T_POS -> term list
6.17 + val arguments_from_model: Proof.context -> MethodC.id -> I_Model.T -> term list
6.18 val errmsg: string
6.19 val error_msg: string
6.20 val relate_args: Env.T -> term list -> term list -> Proof.context -> Program.term ->
7.1 --- a/src/Tools/isac/MathEngBasic/ctree-access.sml Mon Dec 11 16:18:42 2023 +0100
7.2 +++ b/src/Tools/isac/MathEngBasic/ctree-access.sml Mon Dec 11 17:26:30 2023 +0100
7.3 @@ -8,11 +8,11 @@
7.4 val get_last_formula: CTbasic.state -> term
7.5 val update_branch : CTbasic.ctree -> Pos.pos -> CTbasic.branch -> CTbasic.ctree
7.6 val update_domID : CTbasic.ctree -> Pos.pos -> ThyC.id -> CTbasic.ctree
7.7 - val update_met : CTbasic.ctree -> Pos.pos -> Model_Def.i_model_POS -> CTbasic.ctree (* =vvv= ? *)
7.8 - val update_metppc : CTbasic.ctree -> Pos.pos -> Model_Def.i_model_POS -> CTbasic.ctree (* =^^^= ? *)
7.9 + val update_met : CTbasic.ctree -> Pos.pos -> Model_Def.i_model -> CTbasic.ctree (* =vvv= ? *)
7.10 + val update_metppc : CTbasic.ctree -> Pos.pos -> Model_Def.i_model -> CTbasic.ctree (* =^^^= ? *)
7.11 val update_metID : CTbasic.ctree -> Pos.pos -> MethodC.id -> CTbasic.ctree
7.12 - val update_pbl : CTbasic.ctree -> Pos.pos -> Model_Def.i_model_POS -> CTbasic.ctree (* =vvv= ? *)
7.13 - val update_pblppc : CTbasic.ctree -> Pos.pos -> Model_Def.i_model_POS -> CTbasic.ctree (* =^^^= ? *)
7.14 + val update_pbl : CTbasic.ctree -> Pos.pos -> Model_Def.i_model -> CTbasic.ctree (* =vvv= ? *)
7.15 + val update_pblppc : CTbasic.ctree -> Pos.pos -> Model_Def.i_model -> CTbasic.ctree (* =^^^= ? *)
7.16 val update_pblID : CTbasic.ctree -> Pos.pos -> Problem.id -> CTbasic.ctree
7.17 val update_oris : CTbasic.ctree -> Pos.pos -> Model_Def.o_model -> CTbasic.ctree
7.18 val update_orispec : CTbasic.ctree -> Pos.pos -> References_Def.T -> CTbasic.ctree
7.19 @@ -25,7 +25,7 @@
7.20 val cappend_problem : CTbasic.ctree -> Pos.pos -> Istate_Def.T * Proof.context ->
7.21 Model_Def.form_T -> Model_Def.o_model * References_Def.T * term * Proof.context
7.22 -> CTbasic.ctree * Pos.pos' list
7.23 - val cupdate_problem: CTbasic.ctree -> Pos.pos -> References_Def.T * Model_Def.i_model_POS * Model_Def.i_model_POS * Proof.context
7.24 + val cupdate_problem: CTbasic.ctree -> Pos.pos -> References_Def.T * Model_Def.i_model * Model_Def.i_model * Proof.context
7.25 -> CTbasic.ctree * Pos.pos' list
7.26 val append_atomic : (* for solve.sml *)
7.27 Pos.pos -> ((Istate_Def.T * Proof.context) option * (Istate_Def.T * Proof.context)) ->
7.28 @@ -42,7 +42,7 @@
7.29 val append_form: Pos.pos -> Istate_Def.T * Proof.context -> term -> CTbasic.ctree -> CTbasic.ctree
7.30 val append_problem : Pos.pos -> Istate_Def.T * Proof.context -> Model_Def.form_T ->
7.31 Model_Def.o_model * References_Def.T * term * Proof.context -> CTbasic.ctree -> CTbasic.ctree
7.32 - val update_problem: Pos.pos -> References_Def.T * Model_Def.i_model_POS * Model_Def.i_model_POS * Proof.context
7.33 + val update_problem: Pos.pos -> References_Def.T * Model_Def.i_model * Model_Def.i_model * Proof.context
7.34 -> CTbasic.ctree -> CTbasic.ctree
7.35 \<close>
7.36
8.1 --- a/src/Tools/isac/MathEngBasic/ctree-basic.sml Mon Dec 11 16:18:42 2023 +0100
8.2 +++ b/src/Tools/isac/MathEngBasic/ctree-basic.sml Mon Dec 11 17:26:30 2023 +0100
8.3 @@ -44,8 +44,8 @@
8.4 val g_spec : ppobj -> References_Def.T
8.5 val g_loc : ppobj -> (Istate_Def.T * Proof.context) option * (Istate_Def.T * Proof.context) option
8.6 val g_form : ppobj -> term
8.7 - val g_pbl : ppobj -> Model_Def.i_model_POS
8.8 - val g_met : ppobj -> Model_Def.i_model_POS
8.9 + val g_pbl : ppobj -> Model_Def.i_model
8.10 + val g_met : ppobj -> Model_Def.i_model
8.11 val g_metID : ppobj -> MethodC.id
8.12 val g_result : ppobj -> Celem.result
8.13 val g_tac : ppobj -> Tactic.input
8.14 @@ -181,8 +181,8 @@
8.15 References_Def.T * (* updated by Refine_Tacitly *)
8.16 term, (* headline of calc-head, as calculated initially(!) *)
8.17 spec : References_Def.T, (* explicitly input *)
8.18 - probl : Model_Def.i_model_POS,(* = I_Model.T for interactive input to a Problem *)
8.19 - meth : Model_Def.i_model_POS,(* = I_Model.T for interactive input to a MethodC *)
8.20 + probl : Model_Def.i_model,(* = I_Model.T for interactive input to a Problem *)
8.21 + meth : Model_Def.i_model,(* = I_Model.T for interactive input to a MethodC *)
8.22 ctxt : Proof.context, (* used while specifying this (Sub-)Problem and MethodC *)
8.23 loc : (Istate_Def.T * Proof.context) option (* like in PrfObj, calling this SubProblem *)
8.24 * (Istate_Def.T * Proof.context) option, (* like in PrfObj, finishing the SubProblem *)
9.1 --- a/src/Tools/isac/MathEngBasic/model-def.sml Mon Dec 11 16:18:42 2023 +0100
9.2 +++ b/src/Tools/isac/MathEngBasic/model-def.sml Mon Dec 11 17:26:30 2023 +0100
9.3 @@ -29,40 +29,29 @@
9.4 val o_model_empty : o_model_single
9.5
9.6 type i_model
9.7 - type i_model_POS
9.8 type i_model_single
9.9 - type i_model_single_POS
9.10 datatype i_model_feedback =
9.11 - Cor of (term * (term list)) * (term * (term list))
9.12 + Cor of (descriptor * values)
9.13 | Syn of TermC.as_string
9.14 - | Typ of TermC.as_string
9.15 - | Inc of (term * (term list)) * (term * (term list))
9.16 - | Sup of (term * (term list))
9.17 - | Mis of (term * term)
9.18 - | Par of TermC.as_string
9.19 - datatype i_model_feedback_POS =
9.20 - Cor_POS of (descriptor * values)
9.21 - | Syn_POS of TermC.as_string
9.22 - | Inc_POS of (descriptor * values)
9.23 - | Sup_POS of (descriptor * values)
9.24 - val feedback_empty_POS: i_model_feedback_POS
9.25 + | Inc of (descriptor * values)
9.26 + | Sup of (descriptor * values)
9.27 + val feedback_empty: i_model_feedback
9.28
9.29 - val i_model_empty : i_model_single
9.30 - val i_model_empty_POS: i_model_single_POS
9.31 + val i_model_empty: i_model_single
9.32
9.33 - val get_descr_opt: i_model_single_POS -> descriptor option;
9.34 - val get_dscr_opt: i_model_feedback_POS -> descriptor option
9.35 - val get_descr: i_model_feedback_POS -> descriptor
9.36 - val descriptor_exists: descriptor -> i_model_feedback_POS -> bool
9.37 + val get_descr_opt: i_model_single -> descriptor option;
9.38 + val get_dscr_opt: i_model_feedback -> descriptor option
9.39 + val get_descr: i_model_feedback -> descriptor
9.40 + val descriptor_exists: descriptor -> i_model_feedback -> bool
9.41
9.42 val member_vnt: variants -> variant -> bool
9.43 - val max_variants: o_model -> i_model_POS -> variants
9.44 - val max_variants'': i_model_POS -> variants
9.45 + val max_variants: o_model -> i_model -> variants
9.46 + val max_variants'': i_model -> variants
9.47
9.48 (*from isac_test for Minisubpbl*)
9.49 val all_variants: ('a * variants * 'c * 'd * 'e) list -> variants
9.50 - val filter_variants': i_model_POS -> variant -> i_model_POS
9.51 - val cnt_corrects: i_model_POS -> int
9.52 + val filter_variants': i_model -> variant -> i_model
9.53 + val cnt_corrects: i_model -> int
9.54 val arrange_args: int list -> int * variant list -> (int * variant) list
9.55
9.56 \<^isac_test>\<open>
9.57 @@ -134,32 +123,19 @@
9.58
9.59 (** definitions for I_Model.T **)
9.60
9.61 -datatype i_model_feedback =
9.62 - Cor of (descriptor * (* correct input: descriptor, see Input_Descript.thy *)
9.63 - (values)) * (* set of values for list-types: for decdiing
9.64 - Inc the values packed out from the list;
9.65 - They are packed back to an isalist in env *)
9.66 - (term * (term list)) (* will be eliminated in i_model_feedback_POS*)
9.67 -| Syn of TermC.as_string (* PIDE: contains "(__=__)" etc *)
9.68 -| Typ of TermC.as_string (* type error: drop with PIDE ? *)
9.69 -| Inc of (descriptor * values) * (term * (term list)) (* see Cor *)
9.70 -| Sup of (descriptor * values)(* superfluous; input not found in O_Model.T *)
9.71 -| Mis of (descriptor * term) (* missing; for feedback *)
9.72 -| Par of TermC.as_string; (* internal state from fun parsitm *)
9.73 -
9.74 (*
9.75 this datatype assumes that all items of the Model_Pattern are output
9.76 by the initial template, where the items are displayed with hints for the input format.
9.77 *)
9.78 -datatype i_model_feedback_POS =
9.79 - Cor_POS of (descriptor * (* correct input: descriptor, see Input_Descript.thy *)
9.80 +datatype i_model_feedback =
9.81 + Cor of (descriptor * (* correct input: descriptor, see Input_Descript.thy *)
9.82 (values)) (* set of values for list-types: for decding
9.83 Inc the values packed out from the list;
9.84 They are packed back to an isalist for envs *)
9.85 -| Syn_POS of TermC.as_string (* syntax error kept for P_Model.switch_pbl_met *)
9.86 -| Inc_POS of (descriptor * values) (* see Cor *)
9.87 -| Sup_POS of (descriptor * values) (* superfluous; input not found in O_Model.T *)
9.88 -val feedback_empty_POS = Syn_POS "i_model_empty"
9.89 +| Syn of TermC.as_string (* syntax error kept for P_Model.switch_pbl_met *)
9.90 +| Inc of (descriptor * values) (* see Cor *)
9.91 +| Sup of (descriptor * values) (* superfluous; input not found in O_Model.T *)
9.92 +val feedback_empty = Syn "i_model_empty"
9.93
9.94
9.95 type i_model_single =
9.96 @@ -168,25 +144,24 @@
9.97 bool * (* input on this item is not/complete *)
9.98 m_field * (* #Given | #Find | #Relate *)
9.99 i_model_feedback; (* variables and values, see above *)
9.100 -type i_model_single_POS =
9.101 +type i_model_single =
9.102 int * (* sequence of input, 0 = untouched, drop with PIDE ? *)
9.103 variants * (* pointers to variants given in Formalise.model *)
9.104 bool * (* this item is not/complete, completed by O_Model.T *)
9.105 m_field * (* #Given | #Find | #Relate *)
9.106 - (i_model_feedback_POS * (* variables and values, see above *)
9.107 + (i_model_feedback * (* variables and values, see above *)
9.108 Position.T); (* for pushing feedback back to PIDE *)
9.109
9.110 type i_model = i_model_single list;
9.111 -type i_model_POS = i_model_single_POS list;
9.112 +type i_model = i_model_single list;
9.113
9.114 (*shift to i-model.sml ?*)
9.115 -val i_model_empty = (0, [], false, "i_model_empty", Syn "i_model_empty");
9.116 -val i_model_empty_POS = (0, [], false, "i_model_empty", (feedback_empty_POS, Position.none));
9.117 +val i_model_empty = (0, [], false, "i_model_empty", (feedback_empty, Position.none));
9.118
9.119 (*get descriptor of those items which can contribute to Subst.T and Env.T*)
9.120 -fun get_dscr_opt (Cor_POS (descr, _)) = SOME descr
9.121 - | get_dscr_opt (Inc_POS (descr, _)) = SOME descr
9.122 - | get_dscr_opt (Sup_POS (descr, _)) = SOME descr
9.123 +fun get_dscr_opt (Cor (descr, _)) = SOME descr
9.124 + | get_dscr_opt (Inc (descr, _)) = SOME descr
9.125 + | get_dscr_opt (Sup (descr, _)) = SOME descr
9.126 | get_dscr_opt _ = NONE (*other feedback cannot contribute to make_environments *)
9.127 fun get_descr_opt (_, _, _, _, (feedb, _)) =
9.128 case get_dscr_opt feedb of NONE => NONE | some_descr => some_descr
9.129 @@ -211,9 +186,9 @@
9.130 fun filter_variants' i_singles n =
9.131 filter (fn (_, variants, _, _, _) => member op= variants n) i_singles
9.132
9.133 -fun some_input (Cor_POS _) = true
9.134 - | some_input (Inc_POS (_, _::_)) = true
9.135 - | some_input (Syn_POS _) = true
9.136 +fun some_input (Cor _) = true
9.137 + | some_input (Inc (_, _::_)) = true
9.138 + | some_input (Syn _) = true
9.139 | some_input _ = false
9.140
9.141 fun cnt_corrects i_model =
10.1 --- a/src/Tools/isac/MathEngBasic/specification-def.sml Mon Dec 11 16:18:42 2023 +0100
10.2 +++ b/src/Tools/isac/MathEngBasic/specification-def.sml Mon Dec 11 17:26:30 2023 +0100
10.3 @@ -19,10 +19,10 @@
10.4 bool * (* I_Model.T andalso Pre_Conds.T ELIMINATE *)
10.5 Pos.pos_ * (* model belongs to Problem or MethodC *)
10.6 term * (* the headline shown on Calc.T NOT SPECIFIC FOR Pbl | Met *)
10.7 - Model_Def.i_model_POS *(* used by I_Model.T *)
10.8 + Model_Def.i_model *(* used by I_Model.T *)
10.9 Pre_Conds_Def.T * (* used by Pre_Conds.T *)
10.10 References_Def.T; (* into Know_Store NOT SPECIFIC FOR Pbl | Met *)
10.11 val empty =
10.12 - (false, Pos.Und, TermC.empty, [Model_Def.i_model_empty_POS], [(false, TermC.empty)], References_Def.empty);
10.13 + (false, Pos.Und, TermC.empty, [Model_Def.i_model_empty], [(false, TermC.empty)], References_Def.empty);
10.14
10.15 (**)end(**)
11.1 --- a/src/Tools/isac/MathEngBasic/tactic.sml Mon Dec 11 16:18:42 2023 +0100
11.2 +++ b/src/Tools/isac/MathEngBasic/tactic.sml Mon Dec 11 17:26:30 2023 +0100
11.3 @@ -11,15 +11,15 @@
11.4 signature TACTIC =
11.5 sig
11.6 datatype T =
11.7 - Add_Find' of TermC.as_string * Model_Def.i_model_POS
11.8 - | Add_Given' of TermC.as_string * Model_Def.i_model_POS
11.9 - | Add_Relation' of TermC.as_string * Model_Def.i_model_POS
11.10 + Add_Find' of TermC.as_string * Model_Def.i_model
11.11 + | Add_Given' of TermC.as_string * Model_Def.i_model
11.12 + | Add_Relation' of TermC.as_string * Model_Def.i_model
11.13 (*RM*)| Del_Find' of TermC.as_string | Del_Given' of TermC.as_string | Del_Relation' of TermC.as_string
11.14 - | Model_Problem' of Problem.id * Model_Def.i_model_POS * Model_Def.i_model_POS
11.15 - | Refine_Problem' of Problem.id * (Model_Def.i_model_POS * Pre_Conds_Def.T)
11.16 - | Refine_Tacitly' of Problem.id * Problem.id * ThyC.id * MethodC.id * Model_Def.i_model_POS
11.17 - | Specify_Method' of MethodC.id * Model_Def.o_model * Model_Def.i_model_POS
11.18 - | Specify_Problem' of Problem.id * (bool * (Model_Def.i_model_POS * Pre_Conds_Def.T))
11.19 + | Model_Problem' of Problem.id * Model_Def.i_model * Model_Def.i_model
11.20 + | Refine_Problem' of Problem.id * (Model_Def.i_model * Pre_Conds_Def.T)
11.21 + | Refine_Tacitly' of Problem.id * Problem.id * ThyC.id * MethodC.id * Model_Def.i_model
11.22 + | Specify_Method' of MethodC.id * Model_Def.o_model * Model_Def.i_model
11.23 + | Specify_Problem' of Problem.id * (bool * (Model_Def.i_model * Pre_Conds_Def.T))
11.24 | Specify_Theory' of ThyC.id
11.25 (* ^^^^^--------------------- for specify-phase, for solve-phase ---------------------vvvvv*)
11.26 | Apply_Method' of MethodC.id * term option * Istate_Def.T * Proof.context
11.27 @@ -313,24 +313,24 @@
11.28 (** tactics for internal use **)
11.29
11.30 datatype T =
11.31 - Add_Find' of TermC.as_string * Model_Def.i_model_POS | Add_Given' of TermC.as_string * Model_Def.i_model_POS
11.32 - | Add_Relation' of TermC.as_string * Model_Def.i_model_POS (* for Step.do_next *)
11.33 + Add_Find' of TermC.as_string * Model_Def.i_model | Add_Given' of TermC.as_string * Model_Def.i_model
11.34 + | Add_Relation' of TermC.as_string * Model_Def.i_model (* for Step.do_next *)
11.35 (*RM*)| Del_Find' of TermC.as_string | Del_Given' of TermC.as_string | Del_Relation' of TermC.as_string
11.36 | Model_Problem' of (* first step in specify-phase *)
11.37 Problem.id * (* id in the Know_Store *)
11.38 - Model_Def.i_model_POS * (* the model for the Problem *)
11.39 - Model_Def.i_model_POS (* the model for the method *)
11.40 - | Refine_Problem' of Problem.id * (Model_Def.i_model_POS * Pre_Conds_Def.T)
11.41 + Model_Def.i_model * (* the model for the Problem *)
11.42 + Model_Def.i_model (* the model for the method *)
11.43 + | Refine_Problem' of Problem.id * (Model_Def.i_model * Pre_Conds_Def.T)
11.44 | Refine_Tacitly' of
11.45 Problem.id * (* the original id in the Know_Store *)
11.46 Problem.id * (* the id of the refined Problem *)
11.47 ThyC.id * (* the id of the refined theory *)
11.48 MethodC.id * (* the id of the refined MethodC *)
11.49 - Model_Def.i_model_POS (* RM 9.03: remains [] for Model_Problem recognizing its activation *)
11.50 - | Specify_Method' of MethodC.id * Model_Def.o_model * Model_Def.i_model_POS
11.51 + Model_Def.i_model (* RM 9.03: remains [] for Model_Problem recognizing its activation *)
11.52 + | Specify_Method' of MethodC.id * Model_Def.o_model * Model_Def.i_model
11.53 | Specify_Problem' of Problem.id *
11.54 (bool * (* all preconditions evaluate to True *)
11.55 - (Model_Def.i_model_POS * (* the model checked for the input id *)
11.56 + (Model_Def.i_model * (* the model checked for the input id *)
11.57 Pre_Conds_Def.T)) (* individual preconditions marked true/false *)
11.58 | Specify_Theory' of ThyC.id
11.59 (* ^^^^^--------------------- for specify-phase, for solve-phase ---------------------vvvvv*)
12.1 --- a/src/Tools/isac/MathEngine/mathengine-stateless.sml Mon Dec 11 16:18:42 2023 +0100
12.2 +++ b/src/Tools/isac/MathEngine/mathengine-stateless.sml Mon Dec 11 17:26:30 2023 +0100
12.3 @@ -10,12 +10,12 @@
12.4 val autocalc : Pos.pos' list -> Pos.pos' -> Calc.T * State_Steps.T ->
12.5 Solve.auto -> string * Pos.pos' list * Calc.T
12.6
12.7 - val initcontext_met : Ctree.ctree -> Pos.pos' -> bool * string list * Program.T * I_Model.T_POS * Pre_Conds.T
12.8 - val initcontext_pbl : Ctree.ctree -> Pos.pos' -> bool * string list * term * I_Model.T_POS * Pre_Conds.T
12.9 + val initcontext_met : Ctree.ctree -> Pos.pos' -> bool * string list * Program.T * I_Model.T * Pre_Conds.T
12.10 + val initcontext_pbl : Ctree.ctree -> Pos.pos' -> bool * string list * term * I_Model.T * Pre_Conds.T
12.11 val set_method : MethodC.id -> Calc.T -> Ctree.ctree * SpecificationC.T
12.12 val set_problem : Problem.id -> Calc.T -> Ctree.ctree * SpecificationC.T
12.13 val set_theory : ThyC.id -> Calc.T -> Ctree.ctree * SpecificationC.T
12.14 - val tryrefine : Problem.id -> Ctree.ctree -> Pos.pos' -> bool * Problem.id * term * I_Model.T_POS * Pre_Conds.T
12.15 + val tryrefine : Problem.id -> Ctree.ctree -> Pos.pos' -> bool * Problem.id * term * I_Model.T * Pre_Conds.T
12.16 end
12.17
12.18 (**)
13.1 --- a/src/Tools/isac/MathEngine/me-misc.sml Mon Dec 11 16:18:42 2023 +0100
13.2 +++ b/src/Tools/isac/MathEngine/me-misc.sml Mon Dec 11 17:26:30 2023 +0100
13.3 @@ -42,7 +42,7 @@
13.4 let
13.5 val (dI, pI, _) = Ctree.get_somespec' spec spec'
13.6 val {cas, model, ...} = Problem.from_store ctxt pI
13.7 - val env_model = Pre_Conds.environment_POS model probl
13.8 + val env_model = Pre_Conds.environment model probl
13.9 in case cas of
13.10 NONE => Ctree.Form (Auto_Prog.pblterm dI pI)
13.11 | SOME t => Ctree.Form (subst_atomic env_model t)
14.1 --- a/src/Tools/isac/Specify/Specify.thy Mon Dec 11 16:18:42 2023 +0100
14.2 +++ b/src/Tools/isac/Specify/Specify.thy Mon Dec 11 17:26:30 2023 +0100
14.3 @@ -33,9 +33,9 @@
14.4 \<close> ML \<open>
14.5 \<close> ML \<open>
14.6 \<close> ML \<open>
14.7 -I_Model.is_error: I_Model.feedback_POS -> bool
14.8 +I_Model.is_error: I_Model.feedback -> bool
14.9 \<close> ML \<open>
14.10 -P_Model.mk_delete: theory -> string -> I_Model.feedback_POS -> Tactic.input
14.11 +P_Model.mk_delete: theory -> string -> I_Model.feedback -> Tactic.input
14.12 \<close> ML \<open>
14.13 P_Model.mk_additem: string -> TermC.as_string -> Tactic.input
14.14 \<close> ML \<open>
15.1 --- a/src/Tools/isac/Specify/cas-command.sml Mon Dec 11 16:18:42 2023 +0100
15.2 +++ b/src/Tools/isac/Specify/cas-command.sml Mon Dec 11 17:26:30 2023 +0100
15.3 @@ -11,9 +11,9 @@
15.4
15.5 (*/----- from isac_test for Minisubpbl*)
15.6 val input_: References.T -> (term * term list) list ->
15.7 - Problem.id * I_Model.T_POS * MethodC.id * I_Model.T_POS * Pre_Conds.T * Proof.context
15.8 + Problem.id * I_Model.T * MethodC.id * I_Model.T * Pre_Conds.T * Proof.context
15.9 val dtss2itm_: Model_Pattern.T -> term * term list ->
15.10 - int list * bool * Model_Def.m_field * (I_Model.feedback_POS * Position.T)
15.11 + int list * bool * Model_Def.m_field * (I_Model.feedback * Position.T)
15.12 val flattup2: 'a * ('b * 'c * 'd * 'e) -> 'a * 'b * 'c * 'd * 'e
15.13 (*\----- from isac_test for Minisubpbl*)
15.14
15.15 @@ -36,7 +36,7 @@
15.16 (#1: (term * term) -> term) o
15.17 (#2: Model_Pattern.single -> (term * term))) model)
15.18 in
15.19 - ([1], true, f, (I_Model.Cor_POS (d, ts), Position.none))
15.20 + ([1], true, f, (I_Model.Cor (d, ts), Position.none))
15.21 end
15.22
15.23 fun flattup2 (a, (b ,c, d, e)) = (a, b, c, d, e)
16.1 --- a/src/Tools/isac/Specify/i-model.sml Mon Dec 11 16:18:42 2023 +0100
16.2 +++ b/src/Tools/isac/Specify/i-model.sml Mon Dec 11 17:26:30 2023 +0100
16.3 @@ -9,15 +9,11 @@
16.4 sig
16.5
16.6 type T
16.7 - type T_POS
16.8 val empty: T
16.9 - val empty_POS: T_POS
16.10
16.11 type single
16.12 - type single_POS
16.13 val empty_single: single
16.14 - val empty_single_POS: single_POS
16.15 - val is_empty_single_POS: single_POS -> bool
16.16 + val is_empty_single: single -> bool
16.17
16.18 type variant
16.19 type variants
16.20 @@ -26,54 +22,53 @@
16.21 type values
16.22
16.23 datatype feedback = datatype Model_Def.i_model_feedback
16.24 - datatype feedback_POS = datatype Model_Def.i_model_feedback_POS
16.25 - val feedback_empty_POS: Model_Def.i_model_feedback_POS
16.26 + val feedback_empty: Model_Def.i_model_feedback
16.27
16.28 type env
16.29 type message
16.30
16.31 - val single_to_string_POS: Proof.context -> single_POS -> string
16.32 - val to_string_POS: Proof.context -> T_POS -> string
16.33 + val single_to_string: Proof.context -> single -> string
16.34 + val to_string: Proof.context -> T -> string
16.35
16.36 - datatype add_single = Add of single_POS | Err of string
16.37 - val init_POS: Proof.context -> O_Model.T -> Model_Pattern.T -> T_POS
16.38 - val check_single: Proof.context -> m_field -> O_Model.T -> T_POS -> Model_Pattern.T ->
16.39 + datatype add_single = Add of single | Err of string
16.40 + val init: Proof.context -> O_Model.T -> Model_Pattern.T -> T
16.41 + val check_single: Proof.context -> m_field -> O_Model.T -> T -> Model_Pattern.T ->
16.42 TermC.as_string -> add_single
16.43 - val add_single: theory -> single_POS -> T_POS -> T_POS
16.44 + val add_single: theory -> single -> T -> T
16.45
16.46 - val make_tactic: m_field -> TermC.as_string * T_POS -> Tactic.T
16.47 + val make_tactic: m_field -> TermC.as_string * T -> Tactic.T
16.48
16.49 - val descriptor_POS: feedback_POS -> descriptor
16.50 - val get_values: T_POS -> values list
16.51 - val feedb_values: feedback_POS -> values
16.52 - val order_by_patt: Model_Pattern.T -> T_POS ->T_POS
16.53 - val descr_pairs_to_string: Proof.context -> (Model_Pattern.single * single_POS) list -> string
16.54 - val variables: Model_Pattern.T -> Model_Def.i_model_POS -> term list
16.55 - val is_notyet_input: Proof.context -> T_POS -> O_Model.values -> O_Model.single ->
16.56 - Model_Pattern.T -> message * single_POS
16.57 + val descriptor: feedback -> descriptor
16.58 + val get_values: T -> values list
16.59 + val feedb_values: feedback -> values
16.60 + val order_by_patt: Model_Pattern.T -> T ->T
16.61 + val descr_pairs_to_string: Proof.context -> (Model_Pattern.single * single) list -> string
16.62 + val variables: Model_Pattern.T -> Model_Def.i_model -> term list
16.63 + val is_notyet_input: Proof.context -> T -> O_Model.values -> O_Model.single ->
16.64 + Model_Pattern.T -> message * single
16.65
16.66 - val fill_from_o: O_Model.T -> single_POS -> single_POS option
16.67 + val fill_from_o: O_Model.T -> single -> single option
16.68
16.69 - val add_other: variant -> T_POS -> single_POS -> single_POS
16.70 - val fill_method: O_Model.T -> T_POS * T_POS-> Model_Pattern.T -> T_POS
16.71 - val s_make_complete: Proof.context -> O_Model.T -> T_POS * T_POS -> Problem.id * MethodC.id ->
16.72 - T_POS * T_POS
16.73 - val s_are_complete: Proof.context -> O_Model.T -> T_POS * T_POS -> Problem.id * MethodC.id -> bool
16.74 + val add_other: variant -> T -> single -> single
16.75 + val fill_method: O_Model.T -> T * T-> Model_Pattern.T -> T
16.76 + val s_make_complete: Proof.context -> O_Model.T -> T * T -> Problem.id * MethodC.id ->
16.77 + T * T
16.78 + val s_are_complete: Proof.context -> O_Model.T -> T * T -> Problem.id * MethodC.id -> bool
16.79
16.80 - val is_error: feedback_POS -> bool
16.81 - val to_p_model: theory -> feedback_POS -> string
16.82 + val is_error: feedback -> bool
16.83 + val to_p_model: theory -> feedback -> string
16.84
16.85 (*/----- from isac_test for Minisubpbl*)
16.86 - val msg: variants -> feedback_POS -> string
16.87 - val transfer_terms: O_Model.single -> single_POS
16.88 + val msg: variants -> feedback -> string
16.89 + val transfer_terms: O_Model.single -> single
16.90
16.91 - val feedback_POS_to_string: Proof.context -> feedback_POS -> string
16.92 + val feedback_to_string: Proof.context -> feedback -> string
16.93 val descr_vals_to_string: Proof.context -> descriptor * values -> string
16.94 - val feedb_args_to_string: Proof.context -> feedback_POS -> string
16.95 + val feedb_args_to_string: Proof.context -> feedback -> string
16.96
16.97 - val single_from_o: feedback_POS -> descriptor -> Model_Def.values -> O_Model.single -> single_POS
16.98 - val seek_ppc: int -> single_POS list -> single_POS option
16.99 - val overwrite_ppc: theory -> single_POS -> T_POS -> T_POS
16.100 + val single_from_o: feedback -> descriptor -> Model_Def.values -> O_Model.single -> single
16.101 + val seek_ppc: int -> single list -> single option
16.102 + val overwrite_ppc: theory -> single -> T -> T
16.103 (*\----- from isac_test for Minisubpbl*)
16.104
16.105 \<^isac_test>\<open>
16.106 @@ -97,59 +92,48 @@
16.107 type values = Model_Def.values
16.108
16.109 type T = Model_Def.i_model_single list;
16.110 -(* for developing input from PIDE, we use T_POS with these ideas:
16.111 - (1) the new structure is as close to old T, because we want to preserve the old tests
16.112 - (2) after development (with *_POS) of essential parts of the Specification's semantics,
16.113 - we adapt the old tests to the new T_POS
16.114 - (3) together with adaption of the tests we remove the *_POS
16.115 -*)
16.116 -type T_POS = Model_Def.i_model_single_POS list;
16.117 datatype feedback = datatype Model_Def.i_model_feedback;
16.118 -datatype feedback_POS = datatype Model_Def.i_model_feedback_POS;
16.119 -val feedback_empty_POS = Model_Def.feedback_empty_POS
16.120 +val feedback_empty = Model_Def.feedback_empty
16.121 type single = Model_Def.i_model_single;
16.122 -type single_POS = Model_Def.i_model_single_POS;
16.123 val empty_single = Model_Def.i_model_empty;
16.124 -val empty_single_POS = Model_Def.i_model_empty_POS;
16.125 -fun is_empty_single_POS (0, [], false, "i_model_empty", _) = true
16.126 - | is_empty_single_POS _ = false
16.127 +fun is_empty_single (0, [], false, "i_model_empty", _) = true
16.128 + | is_empty_single _ = false
16.129
16.130 val empty = []: T;
16.131 -val empty_POS = []: T_POS;
16.132
16.133 type env = Env.T
16.134
16.135 type message = string;
16.136 -fun feedback_POS_to_string ctxt (Cor_POS (d, ts)) =
16.137 - "Cor_POS " ^ UnparseC.term ctxt (Input_Descript.join (d, ts)) ^ " , pen2str"
16.138 - | feedback_POS_to_string _ (Syn_POS c) =
16.139 - "Syn_POS " ^ c
16.140 - | feedback_POS_to_string ctxt (Inc_POS (d, [])) =
16.141 - "Inc_POS " ^ UnparseC.term ctxt (Input_Descript.join (d, [])) ^ " " ^
16.142 +fun feedback_to_string ctxt (Cor (d, ts)) =
16.143 + "Cor " ^ UnparseC.term ctxt (Input_Descript.join (d, ts)) ^ " , pen2str"
16.144 + | feedback_to_string _ (Syn c) =
16.145 + "Syn " ^ c
16.146 + | feedback_to_string ctxt (Inc (d, [])) =
16.147 + "Inc " ^ UnparseC.term ctxt (Input_Descript.join (d, [])) ^ " " ^
16.148 Model_Pattern.empty_for d
16.149 - | feedback_POS_to_string ctxt (Inc_POS (d, ts)) =
16.150 - "Inc_POS " ^ UnparseC.term ctxt (Input_Descript.join (d, ts)) ^ " , pen2str"
16.151 - | feedback_POS_to_string ctxt (Sup_POS (d, ts)) =
16.152 - "Sup_POS " ^ UnparseC.term ctxt (Input_Descript.join (d, ts))
16.153 + | feedback_to_string ctxt (Inc (d, ts)) =
16.154 + "Inc " ^ UnparseC.term ctxt (Input_Descript.join (d, ts)) ^ " , pen2str"
16.155 + | feedback_to_string ctxt (Sup (d, ts)) =
16.156 + "Sup " ^ UnparseC.term ctxt (Input_Descript.join (d, ts))
16.157
16.158 fun descr_vals_to_string ctxt (descr, values) =
16.159 UnparseC.term ctxt (descr $ Model_Def.values_to_present values)
16.160
16.161 -(*prepare for presentation to user; thus Syn_POS does NOT raise an exn*)
16.162 -fun feedb_args_to_string ctxt (Cor_POS (descr, values)) =
16.163 +(*prepare for presentation to user; thus Syn does NOT raise an exn*)
16.164 +fun feedb_args_to_string ctxt (Cor (descr, values)) =
16.165 UnparseC.term ctxt (descr $ Model_Def.values_to_present values)
16.166 - | feedb_args_to_string _ (Syn_POS str) = str
16.167 - | feedb_args_to_string ctxt (Inc_POS (descr, [])) =
16.168 + | feedb_args_to_string _ (Syn str) = str
16.169 + | feedb_args_to_string ctxt (Inc (descr, [])) =
16.170 UnparseC.term ctxt descr ^ Model_Pattern.empty_for descr
16.171 - | feedb_args_to_string ctxt (Inc_POS (descr, values)) =
16.172 + | feedb_args_to_string ctxt (Inc (descr, values)) =
16.173 UnparseC.term ctxt (descr $ Model_Def.values_to_present values)
16.174 - | feedb_args_to_string ctxt (Sup_POS (descr, values)) =
16.175 + | feedb_args_to_string ctxt (Sup (descr, values)) =
16.176 UnparseC.term ctxt (descr $ Model_Def.values_to_present values)
16.177
16.178 -fun single_to_string_POS ctxt (i, is, b, s, (itm_, _(*Position.T*))) =
16.179 +fun single_to_string ctxt (i, is, b, s, (itm_, _(*Position.T*))) =
16.180 "(" ^ string_of_int i ^ ", " ^ ints2str' is ^ ", " ^ bool2str b ^ " ," ^
16.181 - s ^ ", (" ^ feedback_POS_to_string ctxt itm_ ^ ", Position.T))";
16.182 -fun to_string_POS ctxt itms = strs2str' (map (linefeed o (single_to_string_POS ctxt)) itms);
16.183 + s ^ ", (" ^ feedback_to_string ctxt itm_ ^ ", Position.T))";
16.184 +fun to_string ctxt itms = strs2str' (map (linefeed o (single_to_string ctxt)) itms);
16.185
16.186
16.187 (** make a Tactic.T **)
16.188 @@ -164,11 +148,6 @@
16.189
16.190 (** initialise a model **)
16.191
16.192 -fun init pbt =
16.193 - let
16.194 - fun pbt2itm (f, (d, _)) = (0, [], false, f, Inc ((d, []), (TermC.empty, [])))
16.195 - in map pbt2itm pbt end
16.196 -
16.197 (*
16.198 NEW design decision:
16.199 * Now the Model in Specification is intialised such that the placement of items can be
16.200 @@ -182,8 +161,8 @@
16.201 case find_first (fn (_, _, _, desc, _) => desc = descriptor) o_model of
16.202 NONE => raise ERROR ("I_Model.patt_to_item NONE for " ^ UnparseC.term ctxt descriptor)
16.203 | SOME (_, variants, m_field, descr, _) => (variants, false, m_field,
16.204 - (Inc_POS (descr, []), Position.none))
16.205 -fun init_POS ctxt o_model model_patt =
16.206 + (Inc (descr, []), Position.none))
16.207 +fun init ctxt o_model model_patt =
16.208 let
16.209 val pre_items = map (patt_to_item ctxt o_model) model_patt
16.210 in
16.211 @@ -193,57 +172,57 @@
16.212
16.213 val unique = Syntax.read_term\<^context> "UnIqE_tErM";
16.214 (*DANGEROUS: do NOT use "UnIqE_tErM" *)
16.215 -fun descriptor_POS (Cor_POS (d ,_)) = d
16.216 - | descriptor_POS (Syn_POS _) = ((*tracing ("*** descriptor: Syn ("^c^")");*) unique)
16.217 - | descriptor_POS (Inc_POS (d, _)) = d
16.218 - | descriptor_POS (Sup_POS (d, _)) = d
16.219 -fun feedb_values (Cor_POS (_, ts)) = ts
16.220 - | feedb_values (Syn_POS _) = raise ERROR "feedb_values NOT for Syn_POS"
16.221 - | feedb_values (Inc_POS (_, ts)) = ts
16.222 - | feedb_values (Sup_POS (_, ts)) = ts
16.223 +fun descriptor (Cor (d ,_)) = d
16.224 + | descriptor (Syn _) = ((*tracing ("*** descriptor: Syn ("^c^")");*) unique)
16.225 + | descriptor (Inc (d, _)) = d
16.226 + | descriptor (Sup (d, _)) = d
16.227 +fun feedb_values (Cor (_, ts)) = ts
16.228 + | feedb_values (Syn _) = raise ERROR "feedb_values NOT for Syn"
16.229 + | feedb_values (Inc (_, ts)) = ts
16.230 + | feedb_values (Sup (_, ts)) = ts
16.231
16.232 (*assumption: i_model has filtered max_vnt*)
16.233 local
16.234 fun order_by_pa i_model (_, (descr, _ )) =
16.235 - case find_first (fn (_, _, _, _, (feedb, _)) => descr = descriptor_POS feedb) i_model of
16.236 + case find_first (fn (_, _, _, _, (feedb, _)) => descr = descriptor feedb) i_model of
16.237 SOME i_single => [i_single]
16.238 | NONE => []
16.239 in
16.240 fun order_by_patt model_patt i_model = model_patt |> map (order_by_pa i_model) |> flat
16.241 end
16.242 -fun feedb_vals (Cor_POS (_, ts)) = [ts]
16.243 - | feedb_vals (Syn_POS _) = []
16.244 - | feedb_vals (Inc_POS (_, ts)) = [ts]
16.245 - | feedb_vals (Sup_POS (_, ts)) = [ts]
16.246 +fun feedb_vals (Cor (_, ts)) = [ts]
16.247 + | feedb_vals (Syn _) = []
16.248 + | feedb_vals (Inc (_, ts)) = [ts]
16.249 + | feedb_vals (Sup (_, ts)) = [ts]
16.250 fun get_values i_model =
16.251 map (fn (_, _, _, _, (feedb, _)) => feedb_vals feedb) i_model
16.252 |> flat
16.253
16.254 fun descr_pairs_to_string ctxt equal_descr_pairs =
16.255 -(map (fn (a, b) => pair (Model_Pattern.single_to_string ctxt a) (single_to_string_POS ctxt b)
16.256 +(map (fn (a, b) => pair (Model_Pattern.single_to_string ctxt a) (single_to_string ctxt b)
16.257 |> pair2str) equal_descr_pairs)
16.258 |> strs2str'
16.259
16.260 fun variables model_patt i_model =
16.261 - Pre_Conds.environment_POS model_patt i_model
16.262 + Pre_Conds.environment model_patt i_model
16.263 |> map snd
16.264
16.265 (*update the itm_ already input, all..from ori*)
16.266 -fun single_from_o (feedb:feedback_POS) _ all (id, vt, fd, d, ts) =
16.267 +fun single_from_o (feedb:feedback) _ all (id, vt, fd, d, ts) =
16.268 let
16.269 val ts' = union op = (feedb_values feedb) ts;
16.270 val complete = if eq_set op = (ts', all) then true else false
16.271 in
16.272 case feedb of
16.273 - Cor_POS _ => if fd = "#undef"
16.274 - then (id, vt, complete, fd, (Sup_POS (d, ts'), Position.none))
16.275 - else (id, vt, complete, fd, (Cor_POS (d, ts'), Position.none))
16.276 - | Inc_POS _ => if complete
16.277 - then (id, vt, true, fd, (Cor_POS (d, ts'), Position.none))
16.278 - else (id, vt, false, fd, (Inc_POS (d, ts'), Position.none))
16.279 - | Sup_POS (d, ts') =>
16.280 - (id, vt, complete, fd, (Sup_POS (d, ts'), Position.none))
16.281 - | i => raise ERROR ("single_from_o: uncovered case of " ^ feedback_POS_to_string (ContextC.for_ERROR ()) i)
16.282 + Cor _ => if fd = "#undef"
16.283 + then (id, vt, complete, fd, (Sup (d, ts'), Position.none))
16.284 + else (id, vt, complete, fd, (Cor (d, ts'), Position.none))
16.285 + | Inc _ => if complete
16.286 + then (id, vt, true, fd, (Cor (d, ts'), Position.none))
16.287 + else (id, vt, false, fd, (Inc (d, ts'), Position.none))
16.288 + | Sup (d, ts') =>
16.289 + (id, vt, complete, fd, (Sup (d, ts'), Position.none))
16.290 + | i => raise ERROR ("single_from_o: uncovered case of " ^ feedback_to_string (ContextC.for_ERROR ()) i)
16.291 end
16.292
16.293
16.294 @@ -254,20 +233,20 @@
16.295 case find_first (fn (_, (d', _)) => d = d') pbt of
16.296 SOME (_, (_, pid)) =>
16.297 (case find_first (fn (_, _, _, f', (feedb, _)) =>
16.298 - f = f' andalso d = (descriptor_POS feedb)) itms of
16.299 + f = f' andalso d = (descriptor feedb)) itms of
16.300 SOME (_, _, _, _, (feedb, _)) =>
16.301 let
16.302 val ts' = inter op = (feedb_values feedb) ts
16.303 in
16.304 if subset op = (ts, ts')
16.305 - then (((strs2str' o map (UnparseC.term ctxt)) ts') ^ " already input", empty_single_POS)
16.306 + then (((strs2str' o map (UnparseC.term ctxt)) ts') ^ " already input", empty_single)
16.307 else ("", single_from_o feedb pid all (i, v, f, d, subtract op = ts' ts))
16.308 end
16.309 - | NONE => ("", single_from_o (Inc_POS (TermC.empty, [])) pid all (i, v, f, d, ts)))
16.310 - | NONE => ("", single_from_o (Sup_POS (d, ts)) TermC.empty all (i, v, f, d, ts))
16.311 + | NONE => ("", single_from_o (Inc (TermC.empty, [])) pid all (i, v, f, d, ts)))
16.312 + | NONE => ("", single_from_o (Sup (d, ts)) TermC.empty all (i, v, f, d, ts))
16.313
16.314 datatype add_single =
16.315 - Add of single_POS (* return-value of check_single *)
16.316 + Add of single (* return-value of check_single *)
16.317 | Err of string (* error-message *)
16.318
16.319 (*
16.320 @@ -290,19 +269,19 @@
16.321 in
16.322 (*if d = TermC.empty then .. *)
16.323 (case find_first (fn (_, (d', _)) => d = d') m_patt of
16.324 - NONE => Add (i, [], true, m_field, (Sup_POS (d,ts), Position.none))
16.325 - | SOME (f, (_, id)) =>
16.326 - case find_first (fn (i, _, _, _, (feedb, _)) => d = (descriptor_POS feedb) andalso i <> 0) i_model of
16.327 + NONE => Add (i, [], true, m_field, (Sup (d,ts), Position.none))
16.328 + | SOME (f, (_, _)) =>
16.329 + case find_first (fn (i, _, _, _, (feedb, _)) => d = (descriptor feedb) andalso i <> 0) i_model of
16.330 NONE =>
16.331 - Add (i, [], true, f, (Cor_POS (d, ts), Position.none))
16.332 + Add (i, [], true, f, (Cor (d, ts), Position.none))
16.333 | SOME (i', _, _, _, (itm_, _)) =>
16.334 if Input_Descript.for_list d then
16.335 let
16.336 val in_itm = feedb_values itm_
16.337 val ts' = union op = ts in_itm
16.338 val i'' = if in_itm = [] then i else i'
16.339 - in Add (i'', [], true, f, (Cor_POS (d, ts'), Position.none)) end
16.340 - else Add (i', [], true, f, (Cor_POS (d, ts), Position.none)))
16.341 + in Add (i'', [], true, f, (Cor (d, ts'), Position.none)) end
16.342 + else Add (i', [], true, f, (Cor (d, ts), Position.none)))
16.343 end
16.344 (*will come directly from PIDE ----------------------vvvvvvvvvvv*)
16.345 | check_single ctxt m_field o_model i_model m_patt (str(*, pos*)) =
16.346 @@ -333,7 +312,7 @@
16.347 fun overwrite_ppc thy itm model =
16.348 let
16.349 fun repl _ (_, _, _, _, (itm_, _)) [] =
16.350 - raise ERROR ("overwrite_ppc: " ^ feedback_POS_to_string (Proof_Context.init_global thy) itm_
16.351 + raise ERROR ("overwrite_ppc: " ^ feedback_to_string (Proof_Context.init_global thy) itm_
16.352 ^ " not found")
16.353 | repl model' itm (p :: model) =
16.354 if (#1 itm) = (#1 p)
16.355 @@ -343,18 +322,18 @@
16.356
16.357 (*find_first item with #1 equal to id*)
16.358 fun seek_ppc _ [] = NONE
16.359 - | seek_ppc id (p :: model) = if id = #1 (p: single_POS) then SOME p else seek_ppc id model
16.360 + | seek_ppc id (p :: model) = if id = #1 (p: single) then SOME p else seek_ppc id model
16.361
16.362 (* 10.3.00: insert the parsed itm into model;
16.363 ev. filter_out untouched (in FE: (0,...)) item related to insert-item *)
16.364 fun add_single thy itm model =
16.365 let
16.366 - fun eq_untouched d (0, _, _, _, (itm_, _)) = (d = descriptor_POS itm_)
16.367 + fun eq_untouched d (0, _, _, _, (itm_, _)) = (d = descriptor itm_)
16.368 | eq_untouched _ _ = false
16.369 val model' = case seek_ppc (#1 itm) model of
16.370 SOME _ => overwrite_ppc thy itm model (*itm updated in is_notyet_input WN.11.03*)
16.371 | NONE => (model @ [itm])
16.372 - in filter_out (eq_untouched ((descriptor_POS o #1 o #5) itm)) model' end
16.373 + in filter_out (eq_untouched ((descriptor o #1 o #5) itm)) model' end
16.374
16.375
16.376 (** complete I_Model.T **)
16.377 @@ -380,16 +359,16 @@
16.378 pbl_check andalso met_check
16.379 end
16.380
16.381 -fun is_error (Cor_POS _) = false
16.382 - | is_error (Sup_POS _) = false
16.383 - | is_error (Inc_POS _) = false
16.384 - | is_error (Syn_POS _) = true
16.385 +fun is_error (Cor _) = false
16.386 + | is_error (Sup _) = false
16.387 + | is_error (Inc _) = false
16.388 + | is_error (Syn _) = true
16.389
16.390 (*create output-string for itm*)
16.391 -fun to_p_model thy (Cor_POS (d, ts)) = UnparseC.term_in_thy thy (Input_Descript.join (d, ts))
16.392 - | to_p_model _ (Syn_POS c) = c
16.393 - | to_p_model thy (Inc_POS (d, ts)) = UnparseC.term_in_thy thy (Input_Descript.join (d, ts))
16.394 - | to_p_model thy (Sup_POS (d, ts)) = UnparseC.term_in_thy thy (Input_Descript.join (d, ts))
16.395 +fun to_p_model thy (Cor (d, ts)) = UnparseC.term_in_thy thy (Input_Descript.join (d, ts))
16.396 + | to_p_model _ (Syn c) = c
16.397 + | to_p_model thy (Inc (d, ts)) = UnparseC.term_in_thy thy (Input_Descript.join (d, ts))
16.398 + | to_p_model thy (Sup (d, ts)) = UnparseC.term_in_thy thy (Input_Descript.join (d, ts))
16.399
16.400 fun fill_from_o o_model (i, vnts, bool, _, (feedb, pos)) =
16.401 let
16.402 @@ -408,23 +387,23 @@
16.403 val ts = already_input @ [hd miss]
16.404 in
16.405 if length all_values = length ts
16.406 - then SOME (i, vnts, bool, m_field, (Cor_POS (descr, [Model_Def.values_to_present ts]), pos))
16.407 - else SOME (i, vnts, bool, m_field, (Inc_POS (descr, [Model_Def.values_to_present ts]), pos))
16.408 + then SOME (i, vnts, bool, m_field, (Cor (descr, [Model_Def.values_to_present ts]), pos))
16.409 + else SOME (i, vnts, bool, m_field, (Inc (descr, [Model_Def.values_to_present ts]), pos))
16.410 end
16.411 - else SOME (i, vnts, bool, m_field, (Cor_POS (descr, all_values(*only 1 term*)), pos))
16.412 + else SOME (i, vnts, bool, m_field, (Cor (descr, all_values(*only 1 term*)), pos))
16.413 end
16.414
16.415 (*
16.416 - in case there is an item in i2_model(= met) with Sup_POS,
16.417 - find_first an appropriate (variant, descriptor) item in i1_model(= pbl) and add it instead Sup_POS,
16.418 + in case there is an item in i2_model(= met) with Sup,
16.419 + find_first an appropriate (variant, descriptor) item in i1_model(= pbl) and add it instead Sup,
16.420 otherwise keep the items of i2_model.
16.421 *)
16.422 -fun add_other max_vnt i1_model (i2, _, bool2, m_field2, (Sup_POS (descr2, ts2), pos2)) =
16.423 +fun add_other max_vnt i1_model (i2, _, bool2, m_field2, (Sup (descr2, ts2), pos2)) =
16.424 (case find_first (fn (_, vnts1, _, _, (feedb1, _)) => case Model_Def.get_dscr_opt feedb1 of
16.425 NONE => false
16.426 | SOME descr1 => descr1 = descr2 andalso Model_Def.member_vnt vnts1 max_vnt) i1_model of
16.427 NONE =>
16.428 - (i2, [max_vnt], bool2, m_field2, (Sup_POS (descr2, ts2), pos2)) (*the present in i2_model*)
16.429 + (i2, [max_vnt], bool2, m_field2, (Sup (descr2, ts2), pos2)) (*the present in i2_model*)
16.430 | SOME i1_single => i1_single) (*shift the item from i1_model to i2_model*)
16.431 | add_other _ _ i2_single = i2_single (*keep all the other items in i2_model*)
16.432
16.433 @@ -447,7 +426,7 @@
16.434 "variants " ^ ints2str' vnts ^ " and descriptor " ^
16.435 (feedb |> Model_Def.get_dscr_opt |> the |> UnparseC.term (ContextC.for_ERROR ()))
16.436 fun transfer_terms (i, vnts, m_field, descr, ts) =
16.437 - (i, vnts, true, m_field, (Cor_POS (descr, ts), Position.none))
16.438 + (i, vnts, true, m_field, (Cor (descr, ts), Position.none))
16.439 fun s_make_complete ctxt o_model (pbl_imod, met_imod) (pbl_id, met_id) =
16.440 let
16.441 val {model = pbl_patt, ...} = Problem.from_store ctxt pbl_id;
16.442 @@ -456,7 +435,7 @@
16.443 val i_from_pbl = map (fn (_, (descr, _)) =>
16.444 Pre_Conds.get_descr_vnt descr pbl_max_vnts pbl_imod) pbl_patt
16.445 val pbl_from_o_model = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
16.446 - if is_empty_single_POS i_single
16.447 + if is_empty_single i_single
16.448 then
16.449 case Pre_Conds.get_descr_vnt' feedb pbl_max_vnts o_model of
16.450 [] => raise ERROR (msg pbl_max_vnts feedb)
16.451 @@ -469,7 +448,7 @@
16.452 val max_vnt = hd met_max_vnts (*need only one for solve-phase*)
16.453
16.454 val met_from_pbl = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
16.455 - if is_empty_single_POS i_single
16.456 + if is_empty_single i_single
16.457 then
16.458 case Pre_Conds.get_descr_vnt' feedb [max_vnt] o_model of
16.459 [] => raise ERROR (msg [max_vnt] feedb)
17.1 --- a/src/Tools/isac/Specify/m-match.sml Mon Dec 11 16:18:42 2023 +0100
17.2 +++ b/src/Tools/isac/Specify/m-match.sml Mon Dec 11 17:26:30 2023 +0100
17.3 @@ -14,14 +14,14 @@
17.4
17.5 val data_by_o: Proof.context -> O_Model.T ->
17.6 Model_Pattern.T * Pre_Conds.unchecked * Rule_Def.rule_set ->
17.7 - bool * (I_Model.T_POS * Pre_Conds.T)
17.8 + bool * (I_Model.T * Pre_Conds.T)
17.9 val by_o_model: Proof.context -> O_Model.T ->
17.10 Model_Pattern.single list * Pre_Conds.unchecked * Rule_Def.rule_set -> bool
17.11 - val by_i_model: Proof.context -> I_Model.T_POS ->
17.12 + val by_i_model: Proof.context -> I_Model.T ->
17.13 Model_Pattern.T * Pre_Conds.unchecked * Rule_Def.rule_set -> bool * Pre_Conds.T
17.14 - val by_i_models: Proof.context -> O_Model.T -> I_Model.T_POS * I_Model.T_POS ->
17.15 + val by_i_models: Proof.context -> O_Model.T -> I_Model.T * I_Model.T ->
17.16 Model_Pattern.T * Pre_Conds.unchecked * Rule_Def.rule_set ->
17.17 - bool * (I_Model.T_POS * Pre_Conds.T)
17.18 + bool * (I_Model.T * Pre_Conds.T)
17.19
17.20 val arguments: theory -> Model_Pattern.T -> term list -> O_Model.T
17.21 val arguments_msg: Problem.id -> term -> term list -> unit
17.22 @@ -64,7 +64,7 @@
17.23 |> map (fn (_, (descr, _)) => contains_o descr o_model_vnt)
17.24 |> curry (foldl and_) true
17.25 val i_model = (*in order to match sig of Pre_Conds.check*)
17.26 - map (fn (a, b, c, d, e) => (a, b, true, c, (I_Model.Cor_POS (d, e), Position.none))) o_model_vnt
17.27 + map (fn (a, b, c, d, e) => (a, b, true, c, (I_Model.Cor (d, e), Position.none))) o_model_vnt
17.28 val (pre_conds_check, pre_conds) = Pre_Conds.check ctxt where_rls where_ (model_patt, i_model)
17.29 in
17.30 (is_complete andalso pre_conds_check, (i_model, pre_conds))
17.31 @@ -81,7 +81,7 @@
17.32 (check, (met_imod, preconds))
17.33 end
17.34
17.35 -(*contains_i: descriptor -> I_Model.T_POS -> bool*)
17.36 +(*contains_i: descriptor -> I_Model.T -> bool*)
17.37 fun contains_i descr i_model =
17.38 case find_first (fn (_, _, _, _, (feedb, _)) => Model_Def.get_descr feedb = descr) i_model of
17.39 SOME _ => true | NONE => false
18.1 --- a/src/Tools/isac/Specify/p-model.sml Mon Dec 11 16:18:42 2023 +0100
18.2 +++ b/src/Tools/isac/Specify/p-model.sml Mon Dec 11 17:26:30 2023 +0100
18.3 @@ -17,14 +17,14 @@
18.4 | Missing of TermC.as_string | Superfl of string | SyntaxE of string | TypeE of string
18.5 type 'a model (*shall be dropped with PIDE*)
18.6
18.7 - val from: theory -> I_Model.T_POS -> Pre_Conds.T ->
18.8 + val from: theory -> I_Model.T -> Pre_Conds.T ->
18.9 {Find: item list, Given: item list, Relate: item list, Where: item list, With: item list}
18.10
18.11 val to_list: 'a model -> 'a list
18.12 - val mk_delete: theory -> string -> I_Model.feedback_POS -> Tactic.input
18.13 + val mk_delete: theory -> string -> I_Model.feedback -> Tactic.input
18.14 val mk_additem: string -> TermC.as_string -> Tactic.input
18.15
18.16 - val item_from_feedback_POS: theory -> I_Model.feedback_POS -> item
18.17 + val item_from_feedback: theory -> I_Model.feedback -> item
18.18 (*from isac_test for Minisubpbl*)
18.19 val add_sel_ppc: theory -> string -> {Find: 'a list, Given: 'a list, Relate: 'a list, Where: 'a list, With: 'b} -> 'a -> {Find: 'a list, Given: 'a list, Relate: 'a list, Where: 'a list, With: 'b}
18.20
18.21 @@ -77,12 +77,12 @@
18.22
18.23 (** build T **)
18.24
18.25 -fun item_from_feedback_POS thy (I_Model.Cor_POS ((d, ts))) =
18.26 +fun item_from_feedback thy (I_Model.Cor ((d, ts))) =
18.27 Correct (UnparseC.term_in_thy thy (Input_Descript.join (d, ts)))
18.28 - | item_from_feedback_POS _ (I_Model.Syn_POS c) = SyntaxE c
18.29 - | item_from_feedback_POS thy (I_Model.Inc_POS ((d, ts))) =
18.30 + | item_from_feedback _ (I_Model.Syn c) = SyntaxE c
18.31 + | item_from_feedback thy (I_Model.Inc ((d, ts))) =
18.32 Incompl (UnparseC.term_in_thy thy (Input_Descript.join (d, ts)))
18.33 - | item_from_feedback_POS thy (I_Model.Sup_POS (d, ts)) =
18.34 + | item_from_feedback thy (I_Model.Sup (d, ts)) =
18.35 Superfl (UnparseC.term_in_thy thy (Input_Descript.join (d, ts)))
18.36
18.37 fun add_sel_ppc (_: theory) sel {Given = gi, Where = wh, Find = fi, With = wi, Relate = re} x =
18.38 @@ -104,7 +104,7 @@
18.39 let
18.40 fun coll model [] = model
18.41 | coll model ((_, _, _, field, (feedb, _)) :: itms) =
18.42 - coll (add_sel_ppc thy field model (item_from_feedback_POS thy feedb)) itms;
18.43 + coll (add_sel_ppc thy field model (item_from_feedback thy feedb)) itms;
18.44 val gfr = coll empty i_model;
18.45 in add_where gfr (map (boolterm2item (Proof_Context.init_global thy)) where_) end;
18.46
19.1 --- a/src/Tools/isac/Specify/p-spec.sml Mon Dec 11 16:18:42 2023 +0100
19.2 +++ b/src/Tools/isac/Specify/p-spec.sml Mon Dec 11 17:26:30 2023 +0100
19.3 @@ -3,7 +3,7 @@
19.4 (c) due to copyright terms
19.5
19.6 Major parts will be dropped at switch to Isabelle/PIDE.
19.7 -Thus the switch to I_Model.T_POS is prepared quick and dirty.
19.8 +Thus the switch to I_Model.T is prepared quick and dirty.
19.9 *)
19.10
19.11 signature PRESENTATION_SPECIFICATION =
19.12 @@ -15,18 +15,18 @@
19.13 | Given of TermC.as_string list
19.14 | Relate of TermC.as_string list
19.15
19.16 - val appl_add': ThyC.id -> O_Model.T -> I_Model.T_POS -> Model_Pattern.T ->
19.17 - string * TermC.as_string -> I_Model.single_POS
19.18 - val appl_adds: ThyC.id -> O_Model.T -> I_Model.T_POS -> Model_Pattern.T ->
19.19 - (Model_Def.m_field * TermC.as_string) list -> I_Model.T_POS
19.20 + val appl_add': ThyC.id -> O_Model.T -> I_Model.T -> Model_Pattern.T ->
19.21 + string * TermC.as_string -> I_Model.single
19.22 + val appl_adds: ThyC.id -> O_Model.T -> I_Model.T -> Model_Pattern.T ->
19.23 + (Model_Def.m_field * TermC.as_string) list -> I_Model.T
19.24 val eq7: ''a * ''b -> ''a * (''b * 'c) -> bool
19.25 val fstr2itm_: theory -> Model_Pattern.T -> Model_Def.m_field * string ->
19.26 - int list * bool * Model_Def.m_field * (I_Model.feedback_POS * Position.T)
19.27 + int list * bool * Model_Def.m_field * (I_Model.feedback * Position.T)
19.28 val imodel2fstr: p_model list -> (string * TermC.as_string) list
19.29 val is_e_ts: term list -> bool
19.30 - val itms2fstr: Proof.context -> I_Model.single_POS -> string * string
19.31 - val par2fstr: I_Model.single_POS -> string * TermC.as_string
19.32 - val unknown_expl: ThyC.id -> Model_Pattern.T -> (Model_Def.m_field * string) list -> I_Model.T_POS
19.33 + val itms2fstr: Proof.context -> I_Model.single -> string * string
19.34 + val par2fstr: I_Model.single -> string * TermC.as_string
19.35 + val unknown_expl: ThyC.id -> Model_Pattern.T -> (Model_Def.m_field * string) list -> I_Model.T
19.36 (*\----- from isac_test for Minisubpbl*)
19.37
19.38 \<^isac_test>\<open>
19.39 @@ -59,14 +59,14 @@
19.40 | is_e_ts [Const (\<^const_name>\<open>Nil\<close>, _)] = true
19.41 | is_e_ts _ = false;
19.42
19.43 -fun appl_add' dI oris (model: I_Model.T_POS) pbt (sel, ct) =
19.44 +fun appl_add' dI oris (model: I_Model.T) pbt (sel, ct) =
19.45 let
19.46 val ctxt = Know_Store.get_via_last_thy dI |> Proof_Context.init_global;
19.47 in
19.48 (*/------------ replace by ParseC.term_position ------------------\*)
19.49 case ParseC.term_opt ctxt ct of
19.50 (*\------------ replace by ParseC.term_position ------------------/*)
19.51 - NONE => (0, [], false, sel, (I_Model.Syn_POS ct, Position.none))
19.52 + NONE => (0, [], false, sel, (I_Model.Syn ct, Position.none))
19.53 | SOME t =>
19.54 (case O_Model.contains ctxt sel oris t of
19.55 ("", ori', all) =>
19.56 @@ -75,8 +75,8 @@
19.57 | (msg,_) => raise ERROR ("P_Spec.appl_add': " ^ msg))
19.58 | (_, (i, v, _, d, ts), _) =>
19.59 if is_e_ts ts
19.60 - then (i, v, false, sel, (I_Model.Inc_POS (d, ts), Position.none))
19.61 - else (i, v, false, sel, (I_Model.Sup_POS (d, ts), Position.none)))
19.62 + then (i, v, false, sel, (I_Model.Inc (d, ts), Position.none))
19.63 + else (i, v, false, sel, (I_Model.Sup (d, ts), Position.none)))
19.64 end
19.65
19.66 (* generate preliminary itm_ from a string (with field "#Given" etc.) *)
19.67 @@ -88,15 +88,15 @@
19.68 (*\------------ replace by ParseC.term_position ? ------------/*)
19.69 in
19.70 case topt of
19.71 - NONE => ([], false, f, (I_Model.Syn_POS str, Position.none))
19.72 + NONE => ([], false, f, (I_Model.Syn str, Position.none))
19.73 | SOME ct =>
19.74 let
19.75 val (d, ts) = Input_Descript.split ct
19.76 val popt = find_first (eq7 (f, d)) pbt
19.77 in
19.78 case popt of
19.79 - NONE => ([1](*??*), true(*??*), f, (I_Model.Sup_POS (d, ts), Position.none))
19.80 - | SOME (f, (d, id)) => ([1], true, f, (I_Model.Cor_POS (d, ts), Position.none))
19.81 + NONE => ([1](*??*), true(*??*), f, (I_Model.Sup (d, ts), Position.none))
19.82 + | SOME (f, (d, id)) => ([1], true, f, (I_Model.Cor (d, ts), Position.none))
19.83 end
19.84 end
19.85
19.86 @@ -109,23 +109,23 @@
19.87 in map flattup2 its end
19.88
19.89 fun eq_dsc ((_, _, _, _, (itm_, _)), (_, _, _, _, (iitm_, _))) =
19.90 - (I_Model.descriptor_POS itm_ = I_Model.descriptor_POS iitm_)
19.91 -fun add itm (itms: I_Model.T_POS) = if member eq_dsc itms itm then itms else itms @ [itm] (* @ new itm *)
19.92 + (I_Model.descriptor itm_ = I_Model.descriptor iitm_)
19.93 +fun add itm (itms: I_Model.T) = if member eq_dsc itms itm then itms else itms @ [itm] (* @ new itm *)
19.94 fun appl_adds dI [] _ pbt selcts = unknown_expl dI pbt selcts
19.95 (*already present itms in model are being overwritten*)
19.96 - | appl_adds _ _ (model: I_Model.T_POS) _ [] = model
19.97 - | appl_adds dI oris (model: I_Model.T_POS) pbt (selct :: ss) =
19.98 + | appl_adds _ _ (model: I_Model.T) _ [] = model
19.99 + | appl_adds dI oris (model: I_Model.T) pbt (selct :: ss) =
19.100 let val itm = appl_add' dI oris model pbt selct;
19.101 in appl_adds dI oris (add itm model) pbt ss end
19.102
19.103 -fun par2fstr (_, _, _, f, (I_Model.Syn_POS s, _)) = (f, s)
19.104 +fun par2fstr (_, _, _, f, (I_Model.Syn s, _)) = (f, s)
19.105 | par2fstr itm = raise ERROR ("par2fstr: called with " ^
19.106 - I_Model.single_to_string_POS (ContextC.for_ERROR ()) itm)
19.107 + I_Model.single_to_string (ContextC.for_ERROR ()) itm)
19.108
19.109 -fun itms2fstr _ (_, _, _, f, (I_Model.Cor_POS (d, ts), _)) = (f, Input_Descript.join''' (d, ts))
19.110 - | itms2fstr _ (_, _, _, f, (I_Model.Syn_POS str, _)) = (f, str)
19.111 - | itms2fstr _ (_, _, _, f, (I_Model.Inc_POS (d, ts), _)) = (f, Input_Descript.join''' (d,ts))
19.112 - | itms2fstr _ (_, _, _, f, (I_Model.Sup_POS (d, ts), _)) = (f, Input_Descript.join''' (d, ts))
19.113 +fun itms2fstr _ (_, _, _, f, (I_Model.Cor (d, ts), _)) = (f, Input_Descript.join''' (d, ts))
19.114 + | itms2fstr _ (_, _, _, f, (I_Model.Syn str, _)) = (f, str)
19.115 + | itms2fstr _ (_, _, _, f, (I_Model.Inc (d, ts), _)) = (f, Input_Descript.join''' (d,ts))
19.116 + | itms2fstr _ (_, _, _, f, (I_Model.Sup (d, ts), _)) = (f, Input_Descript.join''' (d, ts))
19.117
19.118 fun imodel2fstr iitems =
19.119 let
20.1 --- a/src/Tools/isac/Specify/pre-conditions.sml Mon Dec 11 16:18:42 2023 +0100
20.2 +++ b/src/Tools/isac/Specify/pre-conditions.sml Mon Dec 11 17:26:30 2023 +0100
20.3 @@ -18,41 +18,41 @@
20.4 val to_string : Proof.context -> T -> string
20.5 val eval: Proof.context -> Rule_Set.T -> bool * term -> bool * term
20.6
20.7 - val environment_POS: Model_Pattern.T -> Model_Def.i_model_POS -> Env.T
20.8 - val make_environments: Model_Pattern.T -> Model_Def.i_model_POS -> Env.T * (env_subst * env_eval)
20.9 - val make_envs_preconds: (Model_Pattern.single * Model_Def.i_model_single_POS) list ->
20.10 + val environment: Model_Pattern.T -> Model_Def.i_model -> Env.T
20.11 + val make_environments: Model_Pattern.T -> Model_Def.i_model -> Env.T * (env_subst * env_eval)
20.12 + val make_envs_preconds: (Model_Pattern.single * Model_Def.i_model_single) list ->
20.13 ((term * term) * (term * term)) list
20.14
20.15 val check_pos: Proof.context -> Rule_Set.T -> unchecked_pos ->
20.16 - Model_Pattern.T * Model_Def.i_model_POS -> checked_pos
20.17 - val check_internal: Proof.context -> Model_Def.i_model_POS -> (Pos.pos_ * References_Def.id)
20.18 + Model_Pattern.T * Model_Def.i_model -> checked_pos
20.19 + val check_internal: Proof.context -> Model_Def.i_model -> (Pos.pos_ * References_Def.id)
20.20 -> checked
20.21 val check_envs: Proof.context -> Rule_Set.T -> unchecked -> Env.T * (env_subst * env_eval)
20.22 -> checked
20.23 val check: Proof.context -> Rule_Set.T -> unchecked ->
20.24 - Model_Pattern.T * Model_Def.i_model_POS -> checked
20.25 + Model_Pattern.T * Model_Def.i_model -> checked
20.26
20.27 (*/----- from isac_test for Minisubpbl*)
20.28 - val get_equal_descr: Model_Def.i_model_POS -> Model_Pattern.single ->
20.29 - (Model_Pattern.single * Model_Def.i_model_single_POS) list
20.30 - val unchecked_OLD_to_POS: term list -> (term * Position.T) list
20.31 + val get_equal_descr: Model_Def.i_model -> Model_Pattern.single ->
20.32 + (Model_Pattern.single * Model_Def.i_model_single) list
20.33 + val unchecked_OLD_to: term list -> (term * Position.T) list
20.34
20.35 val all_lhs_atoms: term list -> bool
20.36 val handle_lists: term -> Model_Def.values -> Env.T
20.37 - val filter_variants': Model_Def.i_model_POS -> Model_Def.variant -> Model_Def.i_model_POS
20.38 + val filter_variants': Model_Def.i_model -> Model_Def.variant -> Model_Def.i_model
20.39 val switch_type: Model_Def.descriptor -> term list -> Model_Def.descriptor;
20.40 - val discern_feedback: term -> Model_Def.i_model_feedback_POS ->
20.41 + val discern_feedback: term -> Model_Def.i_model_feedback ->
20.42 ((term * term) * (term * term)) list
20.43 val discern_typ: term -> Model_Def.descriptor * term list ->
20.44 ((term * term) * (term * term)) list
20.45
20.46 - val mk_env_model: term -> Model_Def.i_model_feedback_POS -> Env.T
20.47 - val make_env_model: (Model_Pattern.single * Model_Def.i_model_single_POS) list -> Env.T
20.48 + val mk_env_model: term -> Model_Def.i_model_feedback -> Env.T
20.49 + val make_env_model: (Model_Pattern.single * Model_Def.i_model_single) list -> Env.T
20.50
20.51 - val get_values: Model_Def.i_model_feedback_POS -> Model_Def.values
20.52 - val get_descr_vnt: Model_Def.descriptor -> Model_Def.variants -> Model_Def.i_model_POS ->
20.53 - Model_Def.i_model_single_POS
20.54 - val get_descr_vnt': Model_Def.i_model_feedback_POS -> Model_Def.variants -> O_Model.T ->
20.55 + val get_values: Model_Def.i_model_feedback -> Model_Def.values
20.56 + val get_descr_vnt: Model_Def.descriptor -> Model_Def.variants -> Model_Def.i_model ->
20.57 + Model_Def.i_model_single
20.58 + val get_descr_vnt': Model_Def.i_model_feedback -> Model_Def.variants -> O_Model.T ->
20.59 O_Model.T
20.60 (*\----- from isac_test for Minisubpbl*)
20.61
20.62 @@ -125,10 +125,10 @@
20.63 (map (pair m_patt_single) equal_descr)
20.64 end
20.65
20.66 -fun get_values (Cor_POS (_, values)) = values
20.67 - | get_values (Syn_POS _) = raise ERROR "Pre_Conds.get_values not for Syn_POS"
20.68 - | get_values (Inc_POS (_, values)) = values
20.69 - | get_values (Sup_POS (_, values)) = values
20.70 +fun get_values (Cor (_, values)) = values
20.71 + | get_values (Syn _) = raise ERROR "Pre_Conds.get_values not for Syn"
20.72 + | get_values (Inc (_, values)) = values
20.73 + | get_values (Sup (_, values)) = values
20.74
20.75 (*
20.76 get an appropriate (description, variant)-item from i_model, otherwise return empty item,
20.77 @@ -140,12 +140,12 @@
20.78 | SOME descr' => if descr = descr' then true else false) i_model
20.79 in
20.80 case filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) equal_descr of
20.81 - [] => (0, [], false, "i_model_empty", (Sup_POS (descr, []), Position.none))
20.82 + [] => (0, [], false, "i_model_empty", (Sup (descr, []), Position.none))
20.83 | items => Library.the_single items (*only applied to model_patt, which has each descr once*)
20.84 end
20.85 (*
20.86 get an appropriate (description, variant) item from o_model;
20.87 - called in case of item in met_imod is_empty_single_POS
20.88 + called in case of item in met_imod is_empty_single
20.89 (i.e. was not transferred pbl_mod by \<open>fun get_descr_vnt\<close>).
20.90 *)
20.91 fun get_descr_vnt' feedb vnts o_model =
20.92 @@ -162,12 +162,12 @@
20.93
20.94 fun handle_lists id values = [(id, values_to_present values)]
20.95
20.96 -fun mk_env_model _ (Model_Def.Cor_POS (_, [])) = []
20.97 - | mk_env_model id (Model_Def.Cor_POS (_, ts)) = handle_lists id ts
20.98 - | mk_env_model _ (Model_Def.Syn_POS _) = [] (*TODO handle correct list elements*)
20.99 - | mk_env_model _ (Model_Def.Inc_POS (_, [])) = []
20.100 - | mk_env_model id (Model_Def.Inc_POS (_, ts)) = handle_lists id ts
20.101 - | mk_env_model _ (Model_Def.Sup_POS _) = []
20.102 +fun mk_env_model _ (Model_Def.Cor (_, [])) = []
20.103 + | mk_env_model id (Model_Def.Cor (_, ts)) = handle_lists id ts
20.104 + | mk_env_model _ (Model_Def.Syn _) = [] (*TODO handle correct list elements*)
20.105 + | mk_env_model _ (Model_Def.Inc (_, [])) = []
20.106 + | mk_env_model id (Model_Def.Inc (_, ts)) = handle_lists id ts
20.107 + | mk_env_model _ (Model_Def.Sup _) = []
20.108 fun make_env_model equal_descr_pairs =
20.109 map (fn ((_, (_, id)), (_, _, _, _, (feedb, _)))
20.110 => (mk_env_model id feedb)) equal_descr_pairs
20.111 @@ -201,12 +201,12 @@
20.112 (*TODO.md "review (descriptor, ts)" REMOVE--------------------------------------\*)
20.113 end
20.114 (*TODO.md "review (descriptor, ts)" REMOVE--------------------------------------/*)
20.115 -(*T_POSnew*)
20.116 +(*Tnew*)
20.117
20.118 -fun discern_feedback id (Model_Def.Cor_POS (descr, ts)) = discern_typ id (descr, ts)
20.119 - | discern_feedback _ (Model_Def.Syn_POS _) = [] (*TODO: handle correct elements*)
20.120 - | discern_feedback id (Model_Def.Inc_POS (descr, ts)) = discern_typ id (descr, ts)
20.121 - | discern_feedback _ (Model_Def.Sup_POS _) = []
20.122 +fun discern_feedback id (Model_Def.Cor (descr, ts)) = discern_typ id (descr, ts)
20.123 + | discern_feedback _ (Model_Def.Syn _) = [] (*TODO: handle correct elements*)
20.124 + | discern_feedback id (Model_Def.Inc (descr, ts)) = discern_typ id (descr, ts)
20.125 + | discern_feedback _ (Model_Def.Sup _) = []
20.126 fun make_envs_preconds equal_givens =
20.127 map (fn ((_, (_, id)), (_, _, _, _, (feedb, _))) => discern_feedback id feedb) equal_givens
20.128 |> flat
20.129 @@ -244,18 +244,18 @@
20.130 end;
20.131
20.132 (*extract one environment rom make_environments *)
20.133 -fun environment_POS model_patt i_model = make_environments model_patt i_model |> #1
20.134 +fun environment model_patt i_model = make_environments model_patt i_model |> #1
20.135
20.136 (** check pre-conditions **)
20.137 -fun check_pos ctxt where_rls where_POS (model_patt, i_model) =
20.138 +fun check_pos ctxt where_rls where_ (model_patt, i_model) =
20.139 let
20.140 val (_, (_, env_eval)) = make_environments model_patt
20.141 (filter (fn (_, _, _, m_field ,_) => m_field = "#Given") i_model)
20.142 val full_subst = if env_eval = []
20.143 - then map (fn (t, pos) => ((true, t), pos)) where_POS
20.144 - else map (fn (t, pos) => (TermC.subst_atomic_all env_eval t, pos)) where_POS;
20.145 + then map (fn (t, pos) => ((true, t), pos)) where_
20.146 + else map (fn (t, pos) => (TermC.subst_atomic_all env_eval t, pos)) where_
20.147 val evals = map (fn ((bool_t), pos) => (eval ctxt where_rls bool_t, pos)) full_subst;
20.148 - val display = map (fn ((t, pos), ((bool, _), _)) => (bool, (t, pos))) (where_POS ~~ evals)
20.149 + val display = map (fn ((t, pos), ((bool, _), _)) => (bool, (t, pos))) (where_ ~~ evals)
20.150 in
20.151 (foldl and_ (true, map (fn ((bool, _: term), _: Position.T) => bool) evals), display)
20.152 end;
20.153 @@ -286,6 +286,6 @@
20.154 (foldl and_ (true, map fst evals), pres_subst_other)
20.155 end;
20.156
20.157 -fun unchecked_OLD_to_POS pres = map (fn t => (t, Position.none)) pres
20.158 +fun unchecked_OLD_to pres = map (fn t => (t, Position.none)) pres
20.159
20.160 (**)end(**)
21.1 --- a/src/Tools/isac/Specify/refine.sml Mon Dec 11 16:18:42 2023 +0100
21.2 +++ b/src/Tools/isac/Specify/refine.sml Mon Dec 11 17:26:30 2023 +0100
21.3 @@ -28,7 +28,7 @@
21.4
21.5 signature REFINE_PROBLEM =
21.6 sig
21.7 - val problem: theory -> Problem.id -> I_Model.T_POS -> (Problem.id * (I_Model.T_POS * Pre_Conds.T)) option
21.8 + val problem: theory -> Problem.id -> I_Model.T -> (Problem.id * (I_Model.T * Pre_Conds.T)) option
21.9
21.10 val by_o_model : Proof.context -> O_Model.T -> Problem.id -> Problem.id option
21.11 val by_o_model' : Proof.context -> O_Model.T -> Problem.id -> Problem.id
21.12 @@ -36,7 +36,7 @@
21.13
21.14 (*from isac_test for Minisubpbl*)
21.15 type match_model_prec
21.16 - val find_match: theory -> Problem.id -> I_Model.T_POS -> match_model_prec list ->
21.17 + val find_match: theory -> Problem.id -> I_Model.T -> match_model_prec list ->
21.18 Problem.T Store.node -> match_model_prec list
21.19 val find_node_elem: (Probl_Def.T Store.node -> 'a) -> Store.key -> Store.key -> 'a
21.20 val check_match: Proof.context -> Problem.id -> O_Model.T -> Problem.T Store.node ->
21.21 @@ -44,7 +44,7 @@
21.22 val refins: Proof.context -> Problem.id -> O_Model.T -> Problem.T Store.node list ->
21.23 Problem.id option
21.24 val match_found: match_model_prec list -> match_model_prec option
21.25 - val find_matchs: theory -> Problem.id -> I_Model.T_POS -> match_model_prec list -> Problem.T Store.node list -> match_model_prec list
21.26 + val find_matchs: theory -> Problem.id -> I_Model.T -> match_model_prec list -> Problem.T Store.node list -> match_model_prec list
21.27
21.28 \<^isac_test>\<open>
21.29 (**)
21.30 @@ -57,7 +57,7 @@
21.31 (**)
21.32
21.33 datatype match_model_prec =
21.34 - Match_ of Problem.id * (( I_Model.T_POS) * (Pre_Conds.T))
21.35 + Match_ of Problem.id * (( I_Model.T) * (Pre_Conds.T))
21.36 | NoMatch_;
21.37
21.38 fun is_matches_ (Match_ _) = true
22.1 --- a/src/Tools/isac/Specify/specification.sml Mon Dec 11 16:18:42 2023 +0100
22.2 +++ b/src/Tools/isac/Specify/specification.sml Mon Dec 11 17:26:30 2023 +0100
22.3 @@ -62,10 +62,10 @@
22.4 type T = Specification_Def.T
22.5 val get: Calc.T -> T
22.6 val get_data: Calc.T ->
22.7 - I_Model.T_POS * O_Model.T * References.T * I_Model.T_POS * References.T * Proof.context
22.8 + I_Model.T * O_Model.T * References.T * I_Model.T * References.T * Proof.context
22.9 val reset: Calc.T -> Calc.T
22.10
22.11 - val is_complete': I_Model.T_POS -> Pre_Conds.T -> References.T -> bool(*TODO:see I_Model.is_complete*)
22.12 + val is_complete': I_Model.T -> Pre_Conds.T -> References.T -> bool(*TODO:see I_Model.is_complete*)
22.13 val is_complete: Calc.T -> bool (*TODO:see I_Model.is_complete*)
22.14
22.15 end
22.16 @@ -88,7 +88,7 @@
22.17 * sort out References
22.18 *)
22.19 fun is_complete' its where_ (dI, pI, mI) =
22.20 - foldl and_ (true, map #3 (its: I_Model.T_POS)) andalso
22.21 + foldl and_ (true, map #3 (its: I_Model.T)) andalso
22.22 foldl and_ (true, map #1 (where_: Pre_Conds.T)) andalso
22.23 dI <> ThyC.id_empty andalso pI <> Problem.id_empty andalso mI <> MethodC.id_empty
22.24
23.1 --- a/src/Tools/isac/Specify/specify-step.sml Mon Dec 11 16:18:42 2023 +0100
23.2 +++ b/src/Tools/isac/Specify/specify-step.sml Mon Dec 11 17:26:30 2023 +0100
23.3 @@ -9,7 +9,7 @@
23.4 sig
23.5 val check: Tactic.input -> Calc.T -> Applicable.T
23.6 val add: Tactic.T -> Istate_Def.T * Proof.context -> Calc.T -> Test_Out.T
23.7 - val complete_for: MethodC.id -> Calc.T -> O_Model.T * Proof.context * I_Model.T_POS
23.8 + val complete_for: MethodC.id -> Calc.T -> O_Model.T * Proof.context * I_Model.T
23.9 end
23.10
23.11 (**)
23.12 @@ -50,7 +50,7 @@
23.13 Ctree.PblObj {ctxt, origin = (o_model, (_, pI', _), _), ...} => (ctxt, o_model, pI')
23.14 | _ => raise ERROR "Specify_Step.check Model_Problem: uncovered case Ctree.get_obj"
23.15 val {model = model_patt, ...} = Problem.from_store (Ctree.get_ctxt pt pos) pI'
23.16 - val pbl = I_Model.init_POS ctxt o_model model_patt
23.17 + val pbl = I_Model.init ctxt o_model model_patt
23.18 in Applicable.Yes (Tactic.Model_Problem' (pI', pbl, [])) end
23.19 | check (Tactic.Refine_Problem pI) (pt, (p, _)) =
23.20 let
23.21 @@ -95,7 +95,7 @@
23.22 | _ => raise ERROR "Specify_Step.check Specify_Problem: uncovered case Ctree.get_obj"
23.23 val {model, where_, where_rls, ...} = Problem.from_store (Ctree.get_ctxt pt pos) pID;
23.24 val (check, (i_model, preconds)) = if pI' = Problem.id_empty andalso pI = Problem.id_empty
23.25 - then (false, (I_Model.init_POS ctxt oris model, []: (bool * term) list))
23.26 + then (false, (I_Model.init ctxt oris model, []: (bool * term) list))
23.27 else M_Match.by_i_models ctxt oris (probl, meth) (model, where_, where_rls)
23.28 in
23.29 Applicable.Yes (Tactic.Specify_Problem' (pID, (check, (i_model, preconds))))
24.1 --- a/src/Tools/isac/Specify/specify.sml Mon Dec 11 16:18:42 2023 +0100
24.2 +++ b/src/Tools/isac/Specify/specify.sml Mon Dec 11 17:26:30 2023 +0100
24.3 @@ -7,16 +7,16 @@
24.4 val do_all: Calc.T -> Calc.T
24.5 val finish_phase: Calc.T -> Calc.T
24.6
24.7 - val item_to_add: Proof.context -> O_Model.T -> I_Model.T_POS ->
24.8 + val item_to_add: Proof.context -> O_Model.T -> I_Model.T ->
24.9 (Model_Def.m_field * TermC.as_string) option
24.10 val by_Add_: string -> TermC.as_string -> Calc.T -> string * Calc.state_post
24.11
24.12 (*from isac_test for Minisubpbl*)
24.13 - val for_problem: Proof.context -> O_Model.T -> References.T * References.T -> I_Model.T_POS * I_Model.T_POS ->
24.14 + val for_problem: Proof.context -> O_Model.T -> References.T * References.T -> I_Model.T * I_Model.T ->
24.15 string * (Pos.pos_ * Tactic.input)
24.16 - val for_method: Proof.context -> O_Model.T -> References.T * References.T -> I_Model.T_POS * I_Model.T_POS ->
24.17 + val for_method: Proof.context -> O_Model.T -> References.T * References.T -> I_Model.T * I_Model.T ->
24.18 string * (Pos.pos_ * Tactic.input)
24.19 - val select_inc_lists: I_Model.T_POS -> I_Model.T_POS
24.20 + val select_inc_lists: I_Model.T -> I_Model.T
24.21
24.22 \<^isac_test>\<open>
24.23 (**)
24.24 @@ -31,7 +31,7 @@
24.25 fun select_inc_lists i_model =
24.26 let
24.27 (* filter problem like with Const ("Input_Descript.solutions", _) *)
24.28 - val filt = (fn (_, _, _, _, (I_Model.Inc_POS (descr, _::_) , _)) => Model_Def.is_list_descr descr
24.29 + val filt = (fn (_, _, _, _, (I_Model.Inc (descr, _::_) , _)) => Model_Def.is_list_descr descr
24.30 | _ => false)
24.31 in
24.32 (filter filt i_model) @ (filter_out filt i_model)
24.33 @@ -43,7 +43,7 @@
24.34 (Model_Def.max_variants o_model i_model)
24.35 val o_vnts = filter (fn (_, vnts, _, _, _) => member op= vnts max_vnt) o_model
24.36 val i_to_select = i_model
24.37 - |> filter_out (fn (_, vnts, _, _, (I_Model.Cor_POS _, _)) => member op= vnts max_vnt | _ => false)
24.38 + |> filter_out (fn (_, vnts, _, _, (I_Model.Cor _, _)) => member op= vnts max_vnt | _ => false)
24.39 |> select_inc_lists
24.40 in
24.41 if i_to_select = [] then NONE
25.1 --- a/src/Tools/isac/Specify/step-specify.sml Mon Dec 11 16:18:42 2023 +0100
25.2 +++ b/src/Tools/isac/Specify/step-specify.sml Mon Dec 11 17:26:30 2023 +0100
25.3 @@ -29,7 +29,7 @@
25.4 | _ => raise ERROR "by_tactic_input Model_Problem; uncovered case get_obj"
25.5 val (_, pI, mI) = References.select_input ospec spec
25.6 val {cas, model, ...} = Problem.from_store (Ctree.get_ctxt pt pos) pI
25.7 - val pbl = I_Model.init_POS ctxt oris model (* fill in descriptions *)
25.8 + val pbl = I_Model.init ctxt oris model (* fill in descriptions *)
25.9 val (pbl, met) = case cas of
25.10 NONE => (pbl, [])
25.11 | _ => I_Model.s_make_complete ctxt oris (probl, meth) (pI, mI)
25.12 @@ -92,7 +92,7 @@
25.13 val {model, where_, where_rls,...} = Problem.from_store (Ctree.get_ctxt pt pos) pI
25.14 val (check, (i_model, preconds)) =
25.15 if pI' = Problem.id_empty andalso pI = Problem.id_empty
25.16 - then (false, (I_Model.init_POS ctxt oris model, []))
25.17 + then (false, (I_Model.init ctxt oris model, []))
25.18 else M_Match.by_i_models ctxt oris (probl, meth) (model, where_, where_rls)
25.19 val (c, pt) =
25.20 case Specify_Step.add (Tactic.Specify_Problem' (pI, (check, (i_model, preconds)))) (Istate_Def.Uistate, ctxt) (pt, pos) of
25.21 @@ -251,7 +251,7 @@
25.22 val (pt, _) = cappend_problem e_ctree [] (Istate_Def.Uistate, ContextC.empty) ([], (dI, pI, mI))
25.23 ([], (dI,pI,mI), hdl, ContextC.empty)
25.24 val pt = update_spec pt [] (dI, pI, mI)
25.25 - val pits = I_Model.init_POS (Proof_Context.init_global thy) [(*o_model*)] model
25.26 + val pits = I_Model.init (Proof_Context.init_global thy) [(*o_model*)] model
25.27 val pt = update_pbl pt [] pits
25.28 in ((pt, ([] , Pbl)), []) end
25.29 else
25.30 @@ -263,7 +263,7 @@
25.31 val (pt, _) = cappend_problem e_ctree [] (Istate_Def.empty, ContextC.empty)
25.32 ([], (dI, pI, mI)) ([], (dI, pI, mI), TermC.empty, ContextC.empty)
25.33 val pt = update_spec pt [] (dI, pI, mI)
25.34 - val mits = I_Model.init_POS (Proof_Context.init_global thy) [(*o_model*)] model
25.35 + val mits = I_Model.init (Proof_Context.init_global thy) [(*o_model*)] model
25.36 val pt = update_met pt [] mits
25.37 in ((pt, ([], Met)), []) end
25.38 else (* new example, pepare for interactive modeling *)
26.1 --- a/src/Tools/isac/Specify/test-out.sml Mon Dec 11 16:18:42 2023 +0100
26.2 +++ b/src/Tools/isac/Specify/test-out.sml Mon Dec 11 17:26:30 2023 +0100
26.3 @@ -13,7 +13,7 @@
26.4 | Error' of string
26.5 | FormKF of TermC.as_string
26.6 | PpcKF of pblmet * P_Model.T
26.7 - | RefinedKF of Problem.id * (I_Model.T_POS * Pre_Conds.T)
26.8 + | RefinedKF of Problem.id * (I_Model.T * Pre_Conds.T)
26.9
26.10 type T = Pos.pos' * Pos.pos' list * mout * Ctree.ctree
26.11 val mout2str: mout -> string
26.12 @@ -50,12 +50,12 @@
26.13 | FormKF of cellID * edit * indent * nest * TermC.as_string (*<--*)
26.14 | PpcKF of cellID * edit * indent * nest * (pblmet * P_Model.T) (*<--*)
26.15 | RefineKF of M_Match.T list (*<--*)
26.16 -| RefinedKF of (Problem.id * ((I_Model.T_POS) * (Pre_Conds.T))) (*<--*)
26.17 +| RefinedKF of (Problem.id * ((I_Model.T) * (Pre_Conds.T))) (*<--*)
26.18
26.19 datatype mout =
26.20 FormKF of TermC.as_string
26.21 | PpcKF of (pblmet * P_Model.T)
26.22 -| RefinedKF of Problem.id * (I_Model.T_POS * Pre_Conds.T)
26.23 +| RefinedKF of Problem.id * (I_Model.T * Pre_Conds.T)
26.24 | Error' of string
26.25 | EmptyMout
26.26
27.1 --- a/test/Tools/isac/BridgeJEdit/Test_VSCode_Example.thy Mon Dec 11 16:18:42 2023 +0100
27.2 +++ b/test/Tools/isac/BridgeJEdit/Test_VSCode_Example.thy Mon Dec 11 17:26:30 2023 +0100
27.3 @@ -292,10 +292,10 @@
27.4 By this input Where: \<open>0 < r\<close> is not rendered \<open>False\<close> anymore.
27.5 \<close>
27.6 ML \<open> (* # 2: Somewhere in the Model, the user inputs a next item *)
27.7 -(*/---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------* )
27.8 +(*/---Step.specify_do_next still works with Ctree, not Ctree-------------------* )
27.9 val ("ok", ([(Tactic.Add_Given "Constants [r = 7]", _, _)], _, ptp))
27.10 = Step.specify_do_next ptp;
27.11 -( *\---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------*)
27.12 +( *\---Step.specify_do_next still works with Ctree, not Ctree-------------------*)
27.13 \<close>
27.14 Example "Diff_App-No.123a" (*step 1: <Constants [r = 7]>*)
27.15 Specification:
27.16 @@ -315,10 +315,10 @@
27.17 Since this item requests for a list, \<open>AdditionalValues\<close> is marked "incomplete":
27.18 \<close>
27.19 ML \<open> (* 3: ISAC suggests a next item within a term list *)
27.20 -(*/---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------* )
27.21 +(*/---Step.specify_do_next still works with Ctree, not Ctree-------------------* )
27.22 val ("ok", ([(Tactic.Add_Find "Maximum A", _, _)], _, ptp))
27.23 = Step.specify_do_next ptp;
27.24 -( *\---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------*)
27.25 +( *\---Step.specify_do_next still works with Ctree, not Ctree-------------------*)
27.26 \<close>
27.27 Example "Diff_App-No.123a" (*step 2: AdditionalValues [u]*)
27.28 Specification:
27.29 @@ -337,10 +337,10 @@
27.30 # 4: The user inputs a next item, and the item \<open>AdditionalValues\<close> is marked "correct":
27.31 \<close>
27.32 ML \<open> (* # 4: ISAC suggests a next step on request, even a next element within a list *)
27.33 -(*/---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------* )
27.34 +(*/---Step.specify_do_next still works with Ctree, not Ctree-------------------* )
27.35 val ("ok", ([(Tactic.Add_Find "AdditionalValues [u]", _, _)], _, ptp))
27.36 = Step.specify_do_next ptp;
27.37 -( *\---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------*)
27.38 +( *\---Step.specify_do_next still works with Ctree, not Ctree-------------------*)
27.39 \<close>
27.40
27.41 Example "Diff_App-No.123a" (*step 3: A.Values [u, v]*)
28.1 --- a/test/Tools/isac/BridgeJEdit/calculation.sml Mon Dec 11 16:18:42 2023 +0100
28.2 +++ b/test/Tools/isac/BridgeJEdit/calculation.sml Mon Dec 11 17:26:30 2023 +0100
28.3 @@ -7,7 +7,7 @@
28.4 "-----------------------------------------------------------------------------------------------";
28.5 "----------- build Outer_Syntax Example 1: parse errors shown at the spot -----------------";
28.6 "----------- build Outer_Syntax Example 2: handle empty input -----------------------------";
28.7 -"----------- build Outer_Syntax Example 3: Pre_Conds.check_POS I_Model.is_complete_OLD ---";
28.8 +"----------- build Outer_Syntax Example 3: Pre_Conds.check I_Model.is_complete_OLD ---";
28.9 "-----------------------------------------------------------------------------------------------";
28.10 "-----------------------------------------------------------------------------------------------";
28.11 "-----------------------------------------------------------------------------------------------";
28.12 @@ -165,9 +165,9 @@
28.13 (*end*);
28.14
28.15
28.16 -"----------- build Outer_Syntax Example 3: Pre_Conds.check_POS I_Model.is_complete_OLD ---";
28.17 -"----------- build Outer_Syntax Example 3: Pre_Conds.check_POS I_Model.is_complete_OLD ---";
28.18 -"----------- build Outer_Syntax Example 3: Pre_Conds.check_POS I_Model.is_complete_OLD ---";
28.19 +"----------- build Outer_Syntax Example 3: Pre_Conds.check I_Model.is_complete_OLD ---";
28.20 +"----------- build Outer_Syntax Example 3: Pre_Conds.check I_Model.is_complete_OLD ---";
28.21 +"----------- build Outer_Syntax Example 3: Pre_Conds.check I_Model.is_complete_OLD ---";
28.22 (*/---------------------------------------- mimic input from PIDE -----------------------------\*)
28.23 (* Example "Diff_App-No.123a" (*complete Model, empty References*) *)
28.24 val thy = @{theory Calculation}
28.25 @@ -242,7 +242,7 @@
28.26 val {model = model_patt, where_ = where_ctree, where_rls, ...} =
28.27 Problem.from_store ctxt pbl_id;
28.28
28.29 -(*/----- ERROR: mk_env not reasonable for "Inc_POS Constants [] [__=__, __=__]"-------------\
28.30 +(*/----- ERROR: mk_env not reasonable for "Inc Constants [] [__=__, __=__]"-------------\
28.31 ------------------------------------------------vvvvvvvvvvvvvvvvvvvvv-----------------------* )
28.32 val (_, env_eval) = Pre_Conds.sep_variants_envs_OLD model_patt probl
28.33 (*------------------- must be completed first ---^^^^^*)
28.34 @@ -251,13 +251,13 @@
28.35 NONE => writeln "I_Model.is_complete_OLD --> NONE"
28.36 | SOME variants =>
28.37 writeln ("I_Model.is_complete_OLD --> SOME " ^ LibraryC.ints2str' variants)
28.38 -( *\----- ERROR: mk_env not reasonable for "Inc_POS Constants [] [__=__, __=__]"-------------/*)
28.39 +( *\----- ERROR: mk_env not reasonable for "Inc Constants [] [__=__, __=__]"-------------/*)
28.40 (*reminder for Template.show ----------------------------------------------------------------/*)
28.41
28.42 -(*reminder for Pre_Conds.check_POS ---------------------------------------------------------\* )
28.43 +(*reminder for Pre_Conds.check ---------------------------------------------------------\* )
28.44 val (true, [(true, (Const ("Orderings.ord_class.less", _) $ Const ("Groups.zero_class.zero", _) $
28.45 - Free ("r", _), _))]) = Pre_Conds.check_POS ctxt where_rls where_ env_eval;
28.46 -( *reminder for Pre_Conds.check_POS ---------------------------------------------------------/*)
28.47 + Free ("r", _), _))]) = Pre_Conds.check ctxt where_rls where_ env_eval;
28.48 +( *reminder for Pre_Conds.check ---------------------------------------------------------/*)
28.49 (**)
28.50 val ((_, true, _), (_, pbl_id as ["univariate_calculus", "Optimisation"], _)) =
28.51 References.for_eval_model (thy_id, probl_id, meth_id) spec_ref o_ref
29.1 --- a/test/Tools/isac/BridgeJEdit/template.sml Mon Dec 11 16:18:42 2023 +0100
29.2 +++ b/test/Tools/isac/BridgeJEdit/template.sml Mon Dec 11 17:26:30 2023 +0100
29.3 @@ -51,15 +51,15 @@
29.4 (*+*)val ("Diff_App", ["univariate_calculus", "Optimisation"], ["Optimisation", "by_univariate_calculus"]) =
29.5 (*+*) refs
29.6
29.7 - val empty_i_model = I_Model.init_POS user_ctxt o_model model_patt;
29.8 + val empty_i_model = I_Model.init user_ctxt o_model model_patt;
29.9
29.10 -(*+*)if I_Model.to_string_POS @{context} empty_i_model = "[\n" ^
29.11 -(*+*) "(1, [1, 2, 3], false ,#Given, (Inc_POS Constants [] [__=__, __=__], Position.T)), \n" ^
29.12 -(*+*) "(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n" ^
29.13 -(*+*) "(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n" ^
29.14 -(*+*) "(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n" ^
29.15 -(*+*) "(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
29.16 -(*+*)then () else error "final test of build I_Model.init_POS FAILED";
29.17 +(*+*)if I_Model.to_string @{context} empty_i_model = "[\n" ^
29.18 +(*+*) "(1, [1, 2, 3], false ,#Given, (Inc Constants [] [__=__, __=__], Position.T)), \n" ^
29.19 +(*+*) "(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n" ^
29.20 +(*+*) "(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n" ^
29.21 +(*+*) "(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n" ^
29.22 +(*+*) "(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
29.23 +(*+*)then () else error "final test of build I_Model.init FAILED";
29.24
29.25 val {where_rls, where_, ...} = MethodC.from_store ctxt meth_id;
29.26 val (_, preconds) = Pre_Conds.check ctxt where_rls where_ (model_patt, empty_i_model);
29.27 @@ -67,8 +67,8 @@
29.28 show ctxt preconds empty_i_model in_refs;
29.29 "~~~~~ fun show , args:"; val (ctxt, preconds, i_model, in_refs) =
29.30 (ctxt, preconds, empty_i_model, in_refs);
29.31 -(*+*)val "[\n(1, [1, 2, 3], false ,#Given, (Inc_POS Constants [] [__=__, __=__], Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
29.32 - = i_model |> I_Model.to_string_POS @{context}
29.33 +(*+*)val "[\n(1, [1, 2, 3], false ,#Given, (Inc Constants [] [__=__, __=__], Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
29.34 + = i_model |> I_Model.to_string @{context}
29.35 (*let*)
29.36 val model_out =
29.37 model_to_out ctxt preconds i_model;
29.38 @@ -80,7 +80,7 @@
29.39
29.40 val return_ = (m_field, filter (fn (_, _, _, f, _) => f = m_field) items |>
29.41 map (item_to_out ctxt));
29.42 -"~~~~~ fun item_to_out , args:"; val (ctxt, (_, _, _, _, (I_Model.Inc_POS ((dsc, [])), _))) =
29.43 +"~~~~~ fun item_to_out , args:"; val (ctxt, (_, _, _, _, (I_Model.Inc ((dsc, [])), _))) =
29.44 (ctxt, nth 1 items);
29.45 val return_ = (UnparseC.term ctxt dsc ^ " " ^ Model_Pattern.empty_for dsc, Incomplete)
29.46
30.1 --- a/test/Tools/isac/BridgeJEdit/vscode-example.sml Mon Dec 11 16:18:42 2023 +0100
30.2 +++ b/test/Tools/isac/BridgeJEdit/vscode-example.sml Mon Dec 11 17:26:30 2023 +0100
30.3 @@ -66,7 +66,7 @@
30.4 val ("ok", ([(Model_Problem, Model_Problem' (["univariate_calculus", "Optimisation"], _, _), _)], _, ptp))
30.5 = Step.specify_do_next ptp;
30.6 ( **)
30.7 -(*/---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------* )
30.8 +(*/---Step.specify_do_next still works with Ctree, not Ctree-------------------* )
30.9 val ("ok", ([(Tactic.Add_Given "Constants [r = 7]", _, _)], _, ptp))
30.10 = Step.specify_do_next ptp;
30.11 val ("ok", ([(Tactic.Add_Find "Maximum A", _, _)], _, ptp))
30.12 @@ -89,18 +89,18 @@
30.13 "(4 ,[1, 2, 3] ,true ,#Relate ,Cor Extremum (A = 2 * u * v - u \<up> 2) ,(extr, [A = 2 * u * v - u \<up> 2])), \n" ^
30.14 "(5 ,[1, 2] ,true ,#Relate ,Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] ,(sideconds, [[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]]))]"
30.15 then () else error "I_Model.to_string probl CHANGED";
30.16 -( *\---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------*)
30.17 +( *\---Step.specify_do_next still works with Ctree, not Ctree-------------------*)
30.18
30.19 (*//---------------- adhoc inserted ------------------------------------------------\\*)
30.20 (*with update_state*)
30.21 (* already been input -------vvvvvvvvvvvvvvvvvvv: code in check_input is missing*)
30.22 -(*/---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------* )
30.23 +(*/---Step.specify_do_next still works with Ctree, not Ctree-------------------* )
30.24 (*+*)val ("ok", ([(Tactic.Add_Given "Constants [r = 7]", _, _)], _, ptp))
30.25 = (**) Step.specify_do_next ptp;
30.26 (*with update_state*)
30.27 (*+*)val ("ERROR I_Model.check_single: \"Maximum A\"\" not for field \"#Find\"", ([], [], ptp))
30.28 = (**) Step.specify_do_next ptp;
30.29 -( *\---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------*)
30.30 +( *\---Step.specify_do_next still works with Ctree, not Ctree-------------------*)
30.31 (*\\---------------- adhoc inserted ------------------------------------------------//*)
30.32
30.33 (*** Specification of References ========================================================== *** )
30.34 @@ -123,13 +123,13 @@
30.35 ---------------------------------------------------------------------- trace from Test_Code.init_calc @{context}*)
30.36
30.37 (*** Specification of Problem and MethodC model is complete =============================== ***)
30.38 -(*/---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------* )
30.39 +(*/---Step.specify_do_next still works with Ctree, not Ctree-------------------* )
30.40 val Ctree.PblObj {meth, ...} = Ctree.get_obj I (fst ptp) [];
30.41 (*with update_state*)
30.42 if I_Model.to_string @{context} meth = ("[\n" ^
30.43 "(1 ,[1, 2, 3] ,true ,#Given ,Cor Constants [r = 7] ,(fixes, [[r = 7]]))]"
30.44 ) then () else error "ERROR output CHANGED";
30.45 -( *\---Step.specify_do_next still works with Ctree, not Ctree_POS-------------------*)
30.46 +( *\---Step.specify_do_next still works with Ctree, not Ctree-------------------*)
30.47
30.48 (*with Test_Code.init_calc @{context}* )
30.49 if I_Model.to_string @ {context} meth = "[\n" ^
31.1 --- a/test/Tools/isac/Interpret/error-pattern.sml Mon Dec 11 16:18:42 2023 +0100
31.2 +++ b/test/Tools/isac/Interpret/error-pattern.sml Mon Dec 11 17:26:30 2023 +0100
31.3 @@ -724,10 +724,10 @@
31.4 val "Pstate ([], [], empty, NONE, \n??.empty, ORundef, false, false)"
31.5 = fst istate |> Istate.string_of ctxt
31.6 val ("Isac_Knowledge", ["derivative_of", "function"], ["diff", "differentiate_on_R"]) = spec;
31.7 -val "[\n(1, [1], true ,#Given, (Cor_POS functionTerm (x \<up> 2 + x + 1) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor_POS differentiateFor x , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor_POS derivative f_'_f , pen2str, Position.T))]"
31.8 - = probl |> I_Model.to_string_POS ctxt
31.9 -val "[\n(1, [1], true ,#Given, (Cor_POS functionTerm (x \<up> 2 + x + 1) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor_POS differentiateFor x , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor_POS derivative f_'_f , pen2str, Position.T))]"
31.10 - = meth |> I_Model.to_string_POS ctxt;
31.11 +val "[\n(1, [1], true ,#Given, (Cor functionTerm (x \<up> 2 + x + 1) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor differentiateFor x , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor derivative f_'_f , pen2str, Position.T))]"
31.12 + = probl |> I_Model.to_string ctxt
31.13 +val "[\n(1, [1], true ,#Given, (Cor functionTerm (x \<up> 2 + x + 1) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor differentiateFor x , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor derivative f_'_f , pen2str, Position.T))]"
31.14 + = meth |> I_Model.to_string ctxt;
31.15
31.16 (*7>*)fetchProposedTactic 1 (*--> Apply_Method*);
31.17 autoCalculate 1 (Steps 1);
31.18 @@ -1308,7 +1308,7 @@
31.19 ...vvv
31.20 *)
31.21 (* val (dI, oris, model, pbt, (selct::ss))=
31.22 - (#1 (References.select_input ospec spec), oris, []:I_Model.T_POS,
31.23 + (#1 (References.select_input ospec spec), oris, []:I_Model.T,
31.24 ((#model o Problem.from_store) (#2 (References.select_input ospec spec))),(imodel2fstr imodel));
31.25 val iii = appl_adds dI oris model pbt (selct::ss);
31.26 tracing(I_Model.to_string thy iii);
32.1 --- a/test/Tools/isac/Interpret/li-tool.sml Mon Dec 11 16:18:42 2023 +0100
32.2 +++ b/test/Tools/isac/Interpret/li-tool.sml Mon Dec 11 17:26:30 2023 +0100
32.3 @@ -245,8 +245,8 @@
32.4
32.5 val descr_ts = f_model |> map (fn (descr $ term) => (descr, term))
32.6 val descr_valss = map (fn (descr, term) => (descr, make_values (descr, term))) descr_ts
32.7 -val i_model_test: I_Model.T_POS = map
32.8 - (fn descr_vals => (4711, [1], true, "#undef", (Cor_POS descr_vals, Position.none))) descr_valss
32.9 +val i_model_test: I_Model.T = map
32.10 + (fn descr_vals => (4711, [1], true, "#undef", (Cor descr_vals, Position.none))) descr_valss
32.11
32.12 val return_arguments_from_model =
32.13 LItool.arguments_from_model ctxt ["IntegrierenUndKonstanteBestimmen2"] i_model_test;
32.14 @@ -357,8 +357,8 @@
32.15 val (_, pI', _) = References.select_input o_spec spec
32.16 val (_, itms) = I_Model.s_make_complete ctxt oris (probl, itms) (pI', mI)
32.17 ;
32.18 -(*+*)val "[\n(1, [1], true ,#Given, (Cor_POS Traegerlaenge L , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor_POS Streckenlast q_0 , pen2str, Position.T)), \n(4, [1], true ,#Relate, (Cor_POS Randbedingungen [M_b 0 = 0, y 0 = 0, y L = 0, M_b L = 0] , pen2str, Position.T)), \n(5, [1], true ,#Given, (Cor_POS FunktionsVariable x , pen2str, Position.T)), \n(6, [1], true ,#Given, (Cor_POS AbleitungBiegelinie y' , pen2str, Position.T)), \n(7, [1], true ,#Given, (Cor_POS Biegemoment M_b , pen2str, Position.T)), \n(8, [1], true ,#Given, (Cor_POS Querkraft Q , pen2str, Position.T)), \n(9, [1], true ,#Given, (Cor_POS GleichungsVariablen [c_3, c, c_2, c_4] , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor_POS Biegelinie y , pen2str, Position.T))]"
32.19 - = itms |> I_Model.to_string_POS @{context};
32.20 +(*+*)val "[\n(1, [1], true ,#Given, (Cor Traegerlaenge L , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor Streckenlast q_0 , pen2str, Position.T)), \n(4, [1], true ,#Relate, (Cor Randbedingungen [M_b 0 = 0, y 0 = 0, y L = 0, M_b L = 0] , pen2str, Position.T)), \n(5, [1], true ,#Given, (Cor FunktionsVariable x , pen2str, Position.T)), \n(6, [1], true ,#Given, (Cor AbleitungBiegelinie y' , pen2str, Position.T)), \n(7, [1], true ,#Given, (Cor Biegemoment M_b , pen2str, Position.T)), \n(8, [1], true ,#Given, (Cor Querkraft Q , pen2str, Position.T)), \n(9, [1], true ,#Given, (Cor GleichungsVariablen [c_3, c, c_2, c_4] , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor Biegelinie y , pen2str, Position.T))]"
32.21 + = itms |> I_Model.to_string @{context};
32.22
32.23 (*case*)
32.24 LItool.init_pstate ctxt itms mI (*of*);
32.25 @@ -380,14 +380,14 @@
32.26 val subst_eval_list = make_envs_preconds equal_givens
32.27 val (env_subst, env_eval) = split_list subst_eval_list
32.28 ;
32.29 -(*+*)val "[((#Given, (Traegerlaenge, l_l)), (1, [1], true ,#Given, (Cor_POS Traegerlaenge L , pen2str, Position.T))), ((#Given, (Streckenlast, q_q)), (2, [1], true ,#Given, (Cor_POS Streckenlast q_0 , pen2str, Position.T))), ((#Given, (Randbedingungen, r_b)), (4, [1], true ,#Relate, (Cor_POS Randbedingungen [M_b 0 = 0, y 0 = 0, y L = 0, M_b L = 0] , pen2str, Position.T))), ((#Given, (FunktionsVariable, fun_var)), (5, [1], true ,#Given, (Cor_POS FunktionsVariable x , pen2str, Position.T))), ((#Given, (AbleitungBiegelinie, id_der)), (6, [1], true ,#Given, (Cor_POS AbleitungBiegelinie y' , pen2str, Position.T))), ((#Given, (Biegemoment, id_momentum)), (7, [1], true ,#Given, (Cor_POS Biegemoment M_b , pen2str, Position.T))), ((#Given, (Querkraft, id_lat_force)), (8, [1], true ,#Given, (Cor_POS Querkraft Q , pen2str, Position.T))), ((#Given, (GleichungsVariablen, vs)), (9, [1], true ,#Given, (Cor_POS GleichungsVariablen [c_3, c, c_2, c_4] , pen2str, Position.T))), ((#Find, (Biegelinie, b_b)), (3, [1], true ,#Find, (Cor_POS Biegelinie y , pen2str, Position.T)))]"
32.30 +(*+*)val "[((#Given, (Traegerlaenge, l_l)), (1, [1], true ,#Given, (Cor Traegerlaenge L , pen2str, Position.T))), ((#Given, (Streckenlast, q_q)), (2, [1], true ,#Given, (Cor Streckenlast q_0 , pen2str, Position.T))), ((#Given, (Randbedingungen, r_b)), (4, [1], true ,#Relate, (Cor Randbedingungen [M_b 0 = 0, y 0 = 0, y L = 0, M_b L = 0] , pen2str, Position.T))), ((#Given, (FunktionsVariable, fun_var)), (5, [1], true ,#Given, (Cor FunktionsVariable x , pen2str, Position.T))), ((#Given, (AbleitungBiegelinie, id_der)), (6, [1], true ,#Given, (Cor AbleitungBiegelinie y' , pen2str, Position.T))), ((#Given, (Biegemoment, id_momentum)), (7, [1], true ,#Given, (Cor Biegemoment M_b , pen2str, Position.T))), ((#Given, (Querkraft, id_lat_force)), (8, [1], true ,#Given, (Cor Querkraft Q , pen2str, Position.T))), ((#Given, (GleichungsVariablen, vs)), (9, [1], true ,#Given, (Cor GleichungsVariablen [c_3, c, c_2, c_4] , pen2str, Position.T))), ((#Find, (Biegelinie, b_b)), (3, [1], true ,#Find, (Cor Biegelinie y , pen2str, Position.T)))]"
32.31 = equal_descr_pairs |> descr_pairs_to_string @{context}
32.32
32.33 val return_make_env_model = make_env_model equal_descr_pairs;
32.34 (*////---------------- step into make_env_model --------------------------------------------\\*)
32.35 "~~~~~ fun make_env_model , args:"; val (equal_descr_pairs) = (equal_descr_pairs);
32.36 "~~~~~ fun xxx , args:"; val ((_, (_, id)), (_, _, _, _, (feedb, _))) = nth 4 equal_descr_pairs;
32.37 -"~~~~~ fun mk_env_model , args:"; val (id, (Model_Def.Cor_POS ((descr, ts)))) = (id, feedb);
32.38 +"~~~~~ fun mk_env_model , args:"; val (id, (Model_Def.Cor ((descr, ts)))) = (id, feedb);
32.39
32.40 handle_lists id ts;
32.41 "~~~~~ fun handle_lists , args:"; val (id, (descr, ts)) = (id, (descr, ts));
33.1 --- a/test/Tools/isac/Knowledge/diff-app.sml Mon Dec 11 16:18:42 2023 +0100
33.2 +++ b/test/Tools/isac/Knowledge/diff-app.sml Mon Dec 11 17:26:30 2023 +0100
33.3 @@ -312,7 +312,7 @@
33.4 === inhibit exn 110722=============================================================*)
33.5
33.6 val oris = fst3 (get_obj g_origin pt (fst p));writeln(O_Model.to_string @{context} oris);
33.7 -val pits = get_obj g_pbl pt (fst p);writeln (I_Model.to_string_POS ctxt pits);
33.8 +val pits = get_obj g_pbl pt (fst p);writeln (I_Model.to_string ctxt pits);
33.9
33.10 (*=== inhibit exn 110722=============================================================
33.11 val (p,_,f,nxt,_,pt) = me nxt p c pt;
33.12 @@ -382,11 +382,11 @@
33.13
33.14 val oris = fst3 (get_obj g_origin pt (fst p));writeln(O_Model.to_string @{context} oris);
33.15
33.16 -val pits = get_obj g_pbl pt (fst p); writeln (I_Model.to_string_POS ctxt pits);
33.17 -val pits = get_obj g_pbl pt []; writeln (I_Model.to_string_POS ctxt pits);
33.18 +val pits = get_obj g_pbl pt (fst p); writeln (I_Model.to_string ctxt pits);
33.19 +val pits = get_obj g_pbl pt []; writeln (I_Model.to_string ctxt pits);
33.20
33.21 -val mits = get_obj g_met pt (fst p);writeln(I_Model.to_string_POS ctxt mits);
33.22 -val mits = get_obj g_met pt [];writeln(I_Model.to_string_POS ctxt mits);
33.23 +val mits = get_obj g_met pt (fst p);writeln(I_Model.to_string ctxt mits);
33.24 +val mits = get_obj g_met pt [];writeln(I_Model.to_string ctxt mits);
33.25
33.26 (*=== inhibit exn 110722=============================================================
33.27 arguments_from_model ["Diff_App", "max_by_calculus"] mits;
33.28 @@ -438,7 +438,7 @@
33.29 fetchProposedTactic 1;
33.30 val ((pt,p),_) = States.get_calc 1;
33.31 val mits = get_obj g_met pt (fst p);
33.32 - writeln (I_Model.to_string_POS ctxt mits);
33.33 + writeln (I_Model.to_string ctxt mits);
33.34 (*
33.35 if I_Model.to_string ctxt mits = "[\n(1 ,[1] ,true ,#Given ,Cor functionEq (hd r_s) ,(t_, [hd r_s])),\n(2 ,[1] ,true ,#Given ,Cor boundVariable v_v ,(v_, [v_])),\n(3 ,[1] ,true ,#Given ,Cor interval itv_ ,(itv_, [itv_])),\n(4 ,[1] ,true ,#Find ,Cor maxArgument v__0 ,(v_0, [v__0]))]" then ()
33.36 else error "diffapp.sml: diff.behav. in autoCalc .. scripts for max 1";
34.1 --- a/test/Tools/isac/Knowledge/rational-old.sml Mon Dec 11 16:18:42 2023 +0100
34.2 +++ b/test/Tools/isac/Knowledge/rational-old.sml Mon Dec 11 17:26:30 2023 +0100
34.3 @@ -202,7 +202,7 @@
34.4 (the o term2poly) t7;*)
34.5
34.6
34.7 -print("\n\n***** STEP_CANCEL_POSS: *****\n");
34.8 +print("\n\n***** STEP_CANCELS: *****\n");
34.9 (*
34.10 val term2 = (Thm.term_of o the o (TermC.parse thy)) " (9 * a \<up> 2 * b) /// (6 * a * c)";
34.11 val div2 = step_cancel term2;
35.1 --- a/test/Tools/isac/MathEngine/step.sml Mon Dec 11 16:18:42 2023 +0100
35.2 +++ b/test/Tools/isac/MathEngine/step.sml Mon Dec 11 17:26:30 2023 +0100
35.3 @@ -303,8 +303,8 @@
35.4 (*** Problem model is complete ============================================================ ***)
35.5 val PblObj {probl, ...} = get_obj I (fst ptp) [];
35.6
35.7 -val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS fixedValues [r = Arbfix] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS valuesFor [a, b] , pen2str, Position.T)), \n(4, [1, 2], true ,#Relate, (Cor_POS relations [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
35.8 - = probl |> I_Model.to_string_POS ctxt
35.9 +val "[\n(1, [1, 2, 3], true ,#Given, (Cor fixedValues [r = Arbfix] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor valuesFor [a, b] , pen2str, Position.T)), \n(4, [1, 2], true ,#Relate, (Cor relations [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
35.10 + = probl |> I_Model.to_string ctxt
35.11
35.12 (*** Specification of References ========================================================== ***)
35.13 val ("ok", ([(Specify_Theory "Diff_App", _, _)], _, ptp))
35.14 @@ -325,8 +325,8 @@
35.15
35.16 val PblObj {meth, ...} = get_obj I (fst ptp) [];
35.17
35.18 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS fixedValues [r = Arbfix] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS maximum A , pen2str, Position.T)), \n(4, [1, 2], true ,#Relate, (Cor_POS relations [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS valuesFor [a, b] , pen2str, Position.T)), \n(6, [1], true ,#Given, (Cor_POS boundVariable a , pen2str, Position.T)), \n(9, [1, 2], true ,#Given, (Cor_POS interval {x. 0 \<le> x \<and> x \<le> 2 * r} , pen2str, Position.T)), \n(11, [1, 2, 3], true ,#Given, (Cor_POS errorBound (eps = 0) , pen2str, Position.T))]"
35.19 - = meth |> I_Model.to_string_POS ctxt
35.20 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor fixedValues [r = Arbfix] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor maximum A , pen2str, Position.T)), \n(4, [1, 2], true ,#Relate, (Cor relations [A = a * b, (a / 2) \<up> 2 + (b / 2) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor valuesFor [a, b] , pen2str, Position.T)), \n(6, [1], true ,#Given, (Cor boundVariable a , pen2str, Position.T)), \n(9, [1, 2], true ,#Given, (Cor interval {x. 0 \<le> x \<and> x \<le> 2 * r} , pen2str, Position.T)), \n(11, [1, 2, 3], true ,#Given, (Cor errorBound (eps = 0) , pen2str, Position.T))]"
35.21 + = meth |> I_Model.to_string ctxt
35.22
35.23 (*** Specification of Problem and MethodC model is complete, Solution starts ============== ***)
35.24
36.1 --- a/test/Tools/isac/Minisubpbl/100-init-rootpbl-NEXT_STEP.sml Mon Dec 11 16:18:42 2023 +0100
36.2 +++ b/test/Tools/isac/Minisubpbl/100-init-rootpbl-NEXT_STEP.sml Mon Dec 11 17:26:30 2023 +0100
36.3 @@ -57,12 +57,12 @@
36.4 val {model = pbt, where_rls, where_, ...} = Problem.from_store ctxt cpI;
36.5 val {model = mpc, ...} = MethodC.from_store ctxt cmI
36.6 val (preok as true, xxx) =
36.7 - Pre_Conds.check ctxt where_rls where_ (pbt, I_Model.OLD_to_POS pbl);
36.8 -(*+*)val "[\n(1, [1], true ,#Given, (Cor_POS equality (x + 1 = 2) ,(e_e, [x + 1 = 2]), Position.T)), \n(2, [1], true ,#Given, (Cor_POS solveFor x ,(v_v, [x]), Position.T)), \n(3, [1], true ,#Find, (Cor_POS solutions L ,(v_v'i', [L]), Position.T))]"
36.9 - = I_Model.OLD_to_POS pbl |> I_Model.to_string_POS @{context};
36.10 + Pre_Conds.check ctxt where_rls where_ (pbt, I_Model.OLD_to pbl);
36.11 +(*+*)val "[\n(1, [1], true ,#Given, (Cor equality (x + 1 = 2) ,(e_e, [x + 1 = 2]), Position.T)), \n(2, [1], true ,#Given, (Cor solveFor x ,(v_v, [x]), Position.T)), \n(3, [1], true ,#Find, (Cor solutions L ,(v_v'i', [L]), Position.T))]"
36.12 + = I_Model.OLD_to pbl |> I_Model.to_string @{context};
36.13 (*+*)val "[precond_rootpbl v_v]" = where_ |> UnparseC.terms @{context};
36.14 "~~~~~ fun check , args:"; val (ctxt, where_rls, pres, (model_patt, i_model)) =
36.15 - (ctxt, where_rls, where_, (pbt, I_Model.OLD_to_POS pbl));
36.16 + (ctxt, where_rls, where_, (pbt, I_Model.OLD_to pbl));
36.17 val (_, env_model, (env_subst, env_eval)) = of_max_variant model_patt i_model
36.18 val pres_subst = map (TermC.subst_atomic_all env_subst) pres;
36.19 (*+*)val [] = env_subst
36.20 @@ -137,9 +137,9 @@
36.21 (*4*)val itms' = pbl @ newitms;
36.22
36.23 val (pb, where_') =
36.24 - Pre_Conds.check ctxt where_rls where_ (m_patt, I_Model.OLD_to_POS itms');
36.25 + Pre_Conds.check ctxt where_rls where_ (m_patt, I_Model.OLD_to itms');
36.26 "~~~~~ fun check , args:"; val (ctxt, where_rls, pres, (model_patt, i_model)) =
36.27 - (ctxt, where_rls, where_, (m_patt, I_Model.OLD_to_POS itms'));
36.28 + (ctxt, where_rls, where_, (m_patt, I_Model.OLD_to itms'));
36.29 val (_, env_model, (env_subst, env_eval)) = of_max_variant model_patt i_model
36.30 val pres_subst = map (TermC.subst_atomic_all env_subst) pres;
36.31 val pres_subst_other = map (TermC.subst_atomic_all env_model) (map #2 pres_subst);
36.32 @@ -210,7 +210,7 @@
36.33 val itms = if itms <> [] then itms else I_Model.complete oris probl [] model
36.34
36.35 val return_init_pstate = case
36.36 - LItool.init_pstate ctxt (I_Model.OLD_to_POS itms) mI of
36.37 + LItool.init_pstate ctxt (I_Model.OLD_to itms) mI of
36.38 (is as Pstate {env, ...}, ctxt, program) => (is, env, ctxt, program)
36.39 (*#------------------- un-hide local of init_pstate -----------------------------------------\*)
36.40 fun msg_miss ctxt sc metID caller f formals actuals =
36.41 @@ -276,7 +276,7 @@
36.42 (*//------------------ step into init_pstate -----------------------------------------------\\*)
36.43 val (_, ctxt, i_model, met_id) = (prog_rls, ctxt, itms, mI);
36.44 "~~~~~ fun init_pstate , args:"; val (ctxt, i_model, met_id) =
36.45 - (ctxt, I_Model.OLD_to_POS i_model, met_id);
36.46 + (ctxt, I_Model.OLD_to i_model, met_id);
36.47 val (model_patt, program, prog, prog_rls, where_, where_rls) =
36.48 case MethodC.from_store ctxt met_id of
36.49 {model = model_patt, program = program as Rule.Prog prog, prog_rls, where_, where_rls,...} =>
36.50 @@ -288,7 +288,7 @@
36.51 (*///----------------- step into of_max_variant --------------------------------------------\\*)
36.52 "~~~~~ fun of_max_variant , args:"; val (model_patt, i_model) = (model_patt, i_model);
36.53
36.54 -(*+*)i_model: I_Model.T_POS;
36.55 +(*+*)i_model: I_Model.T;
36.56
36.57 val all_variants =
36.58 map (fn (_, variants, _, _, _) => variants) i_model
36.59 @@ -319,11 +319,11 @@
36.60 (*+*)val ([], []) = (env_subst, env_eval)
36.61 (*+*)if (equal_descr_pairs |> descr_pairs_to_string @{context}) = "[" ^
36.62 "((#Given, (equality, e_e)), " ^
36.63 - "(1, [1], true ,#Given, (Cor_POS equality (x + 1 = 2) ,(e_e, [x + 1 = 2]), Position.T))), " ^
36.64 + "(1, [1], true ,#Given, (Cor equality (x + 1 = 2) ,(e_e, [x + 1 = 2]), Position.T))), " ^
36.65 "((#Given, (solveFor, v_v)), " ^
36.66 - "(2, [1], true ,#Given, (Cor_POS solveFor x ,(v_v, [x]), Position.T))), " ^
36.67 + "(2, [1], true ,#Given, (Cor solveFor x ,(v_v, [x]), Position.T))), " ^
36.68 "((#Find, (solutions, v_v'i')), " ^
36.69 - "(3, [1], true ,#Find, (Cor_POS solutions L ,(v_v'i', [L]), Position.T)))]"
36.70 + "(3, [1], true ,#Find, (Cor solutions L ,(v_v'i', [L]), Position.T)))]"
36.71 then () else error "equal_descr_pairs CHANGED";
36.72
36.73 (*|||----------------- contine of_max_variant ------------------------------------------------*)
37.1 --- a/test/Tools/isac/Minisubpbl/100-init-rootpbl.sml Mon Dec 11 16:18:42 2023 +0100
37.2 +++ b/test/Tools/isac/Minisubpbl/100-init-rootpbl.sml Mon Dec 11 17:26:30 2023 +0100
37.3 @@ -70,13 +70,6 @@
37.4 "~~~~~ fun from , args:"; val (thy, itms, where_) = ((Proof_Context.theory_of ctxt), gfr, where_);
37.5
37.6 (*//------------------ inserted hidden code ------------------------------------------------\\*)
37.7 -fun item_from_feedback thy (I_Model.Cor ((d, ts), _)) = P_Model.Correct (UnparseC.term_in_thy thy (Input_Descript.join (d, ts)))
37.8 - | item_from_feedback _ (I_Model.Syn c) = P_Model.SyntaxE c
37.9 - | item_from_feedback _ (I_Model.Typ c) = P_Model.TypeE c
37.10 - | item_from_feedback thy (I_Model.Inc ((d, ts), _)) = P_Model.Incompl (UnparseC.term_in_thy thy (Input_Descript.join (d, ts)))
37.11 - | item_from_feedback thy (I_Model.Sup (d, ts)) = P_Model.Superfl (UnparseC.term_in_thy thy (Input_Descript.join (d, ts)))
37.12 - | item_from_feedback thy (I_Model.Mis (d, pid)) = P_Model.Missing (UnparseC.term_in_thy thy d ^ " " ^ UnparseC.term_in_thy thy pid)
37.13 - | item_from_feedback _ _ = raise ERROR "item_from_feedback: uncovered definition"
37.14 fun add_sel_ppc (_: theory) sel {Given = gi, Where = wh, Find = fi, With = wi, Relate = re} x =
37.15 case sel of
37.16 "#Given" => {Given = gi @ [x], Where = wh, Find = fi, With = wi,Relate = re}
37.17 @@ -91,7 +84,7 @@
37.18 | boolterm2item ctxt(false, term) = P_Model.False (UnparseC.term ctxt term);
37.19 fun coll model [] = model
37.20 | coll model ((_, _, _, field, (feedb, _)) :: itms) =
37.21 - coll (add_sel_ppc thy field model (item_from_feedback_POS thy feedb)) itms;
37.22 + coll (add_sel_ppc thy field model (item_from_feedback thy feedb)) itms;
37.23 (*\\------------------ inserted hidden code ------------------------------------------------//*)
37.24
37.25 val gfr = coll P_Model.empty itms;
38.1 --- a/test/Tools/isac/Minisubpbl/100a-init-rootpbl-Maximum.sml Mon Dec 11 16:18:42 2023 +0100
38.2 +++ b/test/Tools/isac/Minisubpbl/100a-init-rootpbl-Maximum.sml Mon Dec 11 17:26:30 2023 +0100
38.3 @@ -73,9 +73,9 @@
38.4 val {where_rls, where_, model, ...} = Problem.from_store ctxt pI
38.5 val (_, where_) =
38.6 Pre_Conds.check ctxt where_rls where_
38.7 - (model, I_Model.OLD_to_POS probl);
38.8 + (model, I_Model.OLD_to probl);
38.9 "~~~~~ fun check , args:"; val (ctxt, where_rls, pres, (model_patt, i_model)) =
38.10 - (ctxt, where_rls, where_, (model, I_Model.OLD_to_POS probl));
38.11 + (ctxt, where_rls, where_, (model, I_Model.OLD_to probl));
38.12 val (env_model, (env_subst, env_eval)) =
38.13 make_environments model_patt i_model;
38.14 "~~~~~ fun make_environments , args:"; val (_, []) = (model_patt, i_model);
38.15 @@ -111,7 +111,7 @@
38.16 Ctree.PblObj {ctxt, origin = (o_model, (_, pI', _), _), ...} => (ctxt, o_model, pI')
38.17 | _ => raise ERROR "Specify_Step.check Model_Problem: uncovered case Ctree.get_obj"
38.18 val {model = model_patt, ...} = Problem.from_store (Ctree.get_ctxt pt pos) pI'
38.19 - val pbl = I_Model.init_POS ctxt o_model model_patt
38.20 + val pbl = I_Model.init ctxt o_model model_patt
38.21
38.22 val return_check =
38.23 Applicable.Yes (Tactic.Model_Problem' (pI', I_Model.TEST_to_OLD pbl, []));
38.24 @@ -150,7 +150,7 @@
38.25 (*if*) p_ = Pos.Pbl (*then*);
38.26
38.27 val return_for_problem as ("dummy", (Pbl, Add_Given "Constants [r = 7]")) =
38.28 - Specify.for_problem ctxt oris (o_refs, refs) (pbl, I_Model.OLD_to_POS met);
38.29 + Specify.for_problem ctxt oris (o_refs, refs) (pbl, I_Model.OLD_to met);
38.30 (*/////--------------- step into for_problem -----------------------------------------------\\*)
38.31 "~~~~~ fun for_problem , args:"; val (ctxt, oris, ((dI', pI', mI'), (dI, pI, mI)), (pbl, met))
38.32 = (ctxt, oris, (o_refs, refs), (pbl, met));
38.33 @@ -161,18 +161,18 @@
38.34 val {model = mpc, ...} = MethodC.from_store ctxt cmI;
38.35
38.36 val return_check =
38.37 - Pre_Conds.check ctxt where_rls where_ (pbt, I_Model.OLD_to_POS pbl);
38.38 + Pre_Conds.check ctxt where_rls where_ (pbt, I_Model.OLD_to pbl);
38.39 (*//////-------------- step into check -------------------------------------------------\\*)
38.40 "~~~~~ fun check , args:"; val (ctxt, where_rls, pres, (model_patt, i_model)) =
38.41 - (ctxt, where_rls, where_, (pbt, I_Model.OLD_to_POS pbl));
38.42 + (ctxt, where_rls, where_, (pbt, I_Model.OLD_to pbl));
38.43 val return_make_environments =
38.44 make_environments model_patt i_model;
38.45 (*///// //------------ step into of_max_variant --------------------------------------------\\*)
38.46 "~~~~~ fun of_max_variant , args:"; val (model_patt, i_model) =
38.47 (model_patt, i_model);
38.48
38.49 -(*+*)val "[\n(1, [1, 2, 3], false ,#Given, (Inc_POS Constants [] [__=__, __=__], Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
38.50 - = i_model |> I_Model.to_string_POS ctxt
38.51 +(*+*)val "[\n(1, [1, 2, 3], false ,#Given, (Inc Constants [] [__=__, __=__], Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
38.52 + = i_model |> I_Model.to_string ctxt
38.53 val all_variants =
38.54 map (fn (_, variants, _, _, _) => variants) i_model
38.55 |> flat
38.56 @@ -192,7 +192,7 @@
38.57 (*!!!*) val patt = equal_descr_pairs |> hd |> #1
38.58 (*!!!*)val equal_descr_pairs =
38.59 (patt,
38.60 - (1, [1, 2, 3], true, "#Given", (Cor_POS ((descr, (*!*)TermC.isalist2list(*!*) term)), pos)))
38.61 + (1, [1, 2, 3], true, "#Given", (Cor ((descr, (*!*)TermC.isalist2list(*!*) term)), pos)))
38.62 :: tl equal_descr_pairs
38.63 (*for building make_env_s -------------------------------------------------------------------/*)
38.64
38.65 @@ -214,13 +214,13 @@
38.66 "~~~~~ fun make_envs_preconds , args:"; val (equal_givens) = (equal_givens);
38.67 val xxx = (fn ((_, (_, id)), (_, _, _, _, (feedb, _))) => discern_feedback id feedb)
38.68 ;
38.69 -xxx: (Model_Pattern.single * I_Model.single_POS) -> ((term * term) * (term * term)) list;
38.70 +xxx: (Model_Pattern.single * I_Model.single) -> ((term * term) * (term * term)) list;
38.71 val return_discern_feedback =
38.72 discern_feedback id feedb;
38.73 (*nth 1 equal_descr_pairs* )
38.74 -"~~~~~ fun discern_feedback , args:"; val (id, (Model_Def.Cor_POS ((descr, ts), _))) = (id, feedb);
38.75 +"~~~~~ fun discern_feedback , args:"; val (id, (Model_Def.Cor ((descr, ts), _))) = (id, feedb);
38.76 ( *nth 2 equal_descr_pairs*)
38.77 -"~~~~~ fun discern_feedback , args:"; val (id, (Model_Def.Inc_POS ((descr, ts)))) = (id, feedb);
38.78 +"~~~~~ fun discern_feedback , args:"; val (id, (Model_Def.Inc ((descr, ts)))) = (id, feedb);
38.79
38.80 (*nth 1 equal_descr_pairs* )
38.81 (*+*)val [((Const ("fixes", typ1), Free ("r", typ2)),
38.82 @@ -247,12 +247,12 @@
38.83 "~~~~~ fun switch_type , args:"; val (Const (descr_string, _), ts) = (descr, ts);
38.84
38.85 (*nth 1 equal_descr_pairs* )
38.86 -val return_switch_type_POS = Const (descr_string, ts |> hd |> TermC.lhs |> type_of)
38.87 +val return_switch_type = Const (descr_string, ts |> hd |> TermC.lhs |> type_of)
38.88
38.89 -(*+*)val Const ("Input_Descript.Constants", typ) = return_switch_type_POS
38.90 +(*+*)val Const ("Input_Descript.Constants", typ) = return_switch_type
38.91 (*+*)val Type ("Real.real", []) = typ
38.92 ( *nth 2 equal_descr_pairs*)
38.93 -(*+*)val return_switch_type_POS = descr
38.94 +(*+*)val return_switch_type = descr
38.95 (**)
38.96 (*\\\\\ \\\----------- step into make_envs_preconds ----------------------------------------//*)
38.97 (*||||| ||------------ contine of_max_variant ------------------------------------------------*)
38.98 @@ -284,7 +284,7 @@
38.99
38.100 (** )val SOME (fd, ct') as ("#Given", "Constants [r = 7]") =( **)
38.101 (**)val return_item_to_add as SOME ("#Given", xxx) =(**) (*case*)
38.102 - Specify.item_to_add ctxt oris (I_Model.OLD_to_POS pbl) (*of*);
38.103 + Specify.item_to_add ctxt oris (I_Model.OLD_to pbl) (*of*);
38.104 (*///// /------------- step into item_to_add -----------------------------------------------\\*)
38.105 (*==================== see test/../i_model.sml --- fun item_to_add ---========================*)
38.106 (*\\\\\ \------------- step into item_to_add -----------------------------------------------//*)
38.107 @@ -363,7 +363,7 @@
38.108 (*case*) find_first (fn (_, (d', _)) => d = d') pbt
38.109 val SOME (_, _, _, _, (feedb, _)) =
38.110 (*case*) find_first (fn (_, _, _, f', (feedb, _)) =>
38.111 - f = f' andalso d = (descriptor_POS feedb)) itms
38.112 + f = f' andalso d = (descriptor feedb)) itms
38.113 val ts' = inter op = (feedb_values feedb) ts
38.114 val false =
38.115 (*if*) subset op = (ts, ts')
38.116 @@ -376,7 +376,7 @@
38.117 val pval = [Input_Descript.join'''' (d, ts')]
38.118 val complete = if eq_set op = (ts', all) then true else false
38.119
38.120 -(*+*)val "Inc_POS Constants [] [__=__, __=__]" = feedb |> I_Model.feedback_POS_to_string ctxt
38.121 +(*+*)val "Inc Constants [] [__=__, __=__]" = feedb |> I_Model.feedback_to_string ctxt
38.122 (*\\\----------------- step into specify_do_next -------------------------------------------//*)
38.123 (*\\------------------ step into do_next ---------------------------------------------------//*)
38.124 val ("ok", (ts as (_, _, _) :: _, _, (pt, p))) = return_do_next
38.125 @@ -401,9 +401,9 @@
38.126 "~~~~~ fun pt_model , args:"; val ((Ctree.PblObj {probl, spec, origin = (_, o_spec, hdl), ctxt, ...}),
38.127 Pbl(*Frm,Pbl*)) = (ppobj, p_);
38.128 val (_, _, met_id) = References.select_input o_spec spec
38.129 - val (allcorr, _) = Pre_Conds.check_internal ctxt (I_Model.OLD_to_POS probl) (Pos.Met, met_id)
38.130 + val (allcorr, _) = Pre_Conds.check_internal ctxt (I_Model.OLD_to probl) (Pos.Met, met_id)
38.131
38.132 -val return_pt_model = Ctree.ModSpec (allcorr, Pos.Pbl, hdl, I_Model.OLD_to_POS probl,
38.133 +val return_pt_model = Ctree.ModSpec (allcorr, Pos.Pbl, hdl, I_Model.OLD_to probl,
38.134 (*where_*)[(*Problem.from_store in check*)], spec)
38.135
38.136 (*|------------------- continue with TESTg_form ----------------------------------------------*)
39.1 --- a/test/Tools/isac/Minisubpbl/150a-add-given-Maximum.sml Mon Dec 11 16:18:42 2023 +0100
39.2 +++ b/test/Tools/isac/Minisubpbl/150a-add-given-Maximum.sml Mon Dec 11 17:26:30 2023 +0100
39.3 @@ -74,7 +74,7 @@
39.4 (nxt, p, c, pt);
39.5 val ctxt = Ctree.get_ctxt pt p
39.6 (*+*)val PblObj {probl = (1, [1, 2, 3], false, "#Given",
39.7 - (Inc_POS (Const ("Input_Descript.Constants", _), []), _)) :: _, ...} = get_obj I pt (fst p)
39.8 + (Inc (Const ("Input_Descript.Constants", _), []), _)) :: _, ...} = get_obj I pt (fst p)
39.9 (*-------------------------------------------^^--*)
39.10 val return_step_by_tactic = (*case*)
39.11 Step.by_tactic tac (pt, p) (*of*);
39.12 @@ -111,7 +111,7 @@
39.13 (*/////--------------- step add_single -----------------------------------------------------\\*)
39.14 "~~~~~ fun add_single , args:"; val (thy, itm, model) =
39.15 ((Proof_Context.theory_of ctxt), i_single, i_model);
39.16 - fun eq_untouched d (0, _, _, _, (itm_, _)) = (d = descriptor_POS itm_)
39.17 + fun eq_untouched d (0, _, _, _, (itm_, _)) = (d = descriptor itm_)
39.18 | eq_untouched _ _ = false
39.19 val model' = case I_Model.seek_ppc (#1 itm) model of
39.20 SOME _ => overwrite_ppc thy itm model (*itm updated in is_notyet_input WN.11.03*)
39.21 @@ -119,8 +119,8 @@
39.22
39.23 (*|||||--------------- step by_Add_ ----------------------------------------------------------*)
39.24 val i_model' = return_add_single
39.25 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
39.26 - = i_model' |> I_Model.to_string_POS ctxt
39.27 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
39.28 + = i_model' |> I_Model.to_string ctxt
39.29
39.30 val tac' = I_Model.make_tactic m_field (ct, i_model')
39.31 val (_, _, _, pt') = Specify_Step.add tac' (Istate_Def.Uistate, ctxt) (pt, pos)
39.32 @@ -128,8 +128,8 @@
39.33 ("ok", ([(Tactic.input_from_T ctxt tac', tac', (pos, (Istate_Def.Uistate, ctxt)))],
39.34 [], (pt', pos)))
39.35 (*+++*)val {probl, ...} = Calc.specify_data (pt', pos);
39.36 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
39.37 - = probl |> I_Model.to_string_POS ctxt
39.38 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
39.39 + = probl |> I_Model.to_string ctxt
39.40 (*\\\\---------------- step into by_Add_ ---------------------------------------------------//*)
39.41 val return_by_tactic_step = return_by_Add_
39.42 (*\\\----------------- step into Step_Specify.by_tactic ------------------------------------//*)
39.43 @@ -140,8 +140,8 @@
39.44
39.45 (*+++*)val (pt, p) = ptp
39.46 (*+++*)val {probl, ...} = Calc.specify_data (pt, p);
39.47 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
39.48 - = probl |> I_Model.to_string_POS ctxt;
39.49 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
39.50 + = probl |> I_Model.to_string ctxt;
39.51
39.52 val (pt, p) = ptp; (*case*)
39.53 Step.do_next p ((pt, Pos.e_pos'), []) (*of*);
39.54 @@ -170,8 +170,8 @@
39.55 val {meth = met, origin = origin as (oris, o_refs as (_, pI', mI'), _), probl = pbl,
39.56 spec = refs, ...} = Calc.specify_data (pt, pos);
39.57 val ctxt = Ctree.get_ctxt pt pos;
39.58 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
39.59 - = pbl |> I_Model.to_string_POS ctxt(*+*)
39.60 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
39.61 + = pbl |> I_Model.to_string ctxt(*+*)
39.62
39.63 val false =
39.64 (*if*) Ctree.just_created (pt, pos) andalso origin <> Ctree.e_origin (*else*);
39.65 @@ -217,10 +217,10 @@
39.66 (*map:*)val ((_, (_, id)), (_, _, _, _, (feedb, _))) = (nth 2 equal_descr_pairs);
39.67
39.68 (*///// /------------- step into mk_env_model ----------------------------------------------\\*)
39.69 -"~~~~~ fun mk_env_model , args:"; val (_, (Model_Def.Inc_POS (_, []))) = (id, feedb);
39.70 +"~~~~~ fun mk_env_model , args:"; val (_, (Model_Def.Inc (_, []))) = (id, feedb);
39.71 (*+*)val (patt, imod) = nth 2 equal_descr_pairs
39.72 (*+*)val "(#Find, (Maximum, maxx))" = patt |> Model_Pattern.single_to_string ctxt
39.73 -(*+*)val "(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T))" = imod |> I_Model.single_to_string_POS ctxt
39.74 +(*+*)val "(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T))" = imod |> I_Model.single_to_string ctxt
39.75
39.76 val return_mk_env_model_2_step = []
39.77 (*\\\\\ \------------- step into mk_env_model ----------------------------------------------//*)
39.78 @@ -276,14 +276,14 @@
39.79 (Model_Def.max_variants o_model i_model)
39.80 val o_vnts = filter (fn (_, vnts, _, _, _) => member op= vnts max_vnt) o_model
39.81 val i_to_select = i_model
39.82 - |> filter_out (fn (_, vnts, _, _, (I_Model.Cor_POS _, _)) => member op= vnts max_vnt | _ => false)
39.83 + |> filter_out (fn (_, vnts, _, _, (I_Model.Cor _, _)) => member op= vnts max_vnt | _ => false)
39.84 |> select_inc_lists
39.85 |> hd
39.86 (*in*)
39.87
39.88 val SOME (_, _, _, m_field, (feedb, _)) = (*case*)
39.89 I_Model.fill_from_o o_vnts i_to_select (*of*);
39.90 -(*+*)val "Cor_POS Maximum A , pen2str" = feedb |> I_Model.feedback_POS_to_string ctxt;
39.91 +(*+*)val "Cor Maximum A , pen2str" = feedb |> I_Model.feedback_to_string ctxt;
39.92
39.93 "~~~~~ fun fill_from_o , args:"; val (o_model, (i, vnts, bool, m_field, (feedb, pos))) =
39.94 (o_vnts, i_to_select);
39.95 @@ -295,7 +295,7 @@
39.96 val false =
39.97 (*if*) Model_Def.is_list_descr descr (*else*);
39.98 val return_fill_from_o_STEP = SOME (i, vnts, bool, m_field,
39.99 - (Inc_POS (descr, all_value), pos))
39.100 + (Inc (descr, all_value), pos))
39.101 (*\------------------- step into me_add_find_Constants -------------------------------------//*)
39.102 val (p,_,f,nxt,_,pt) = return_me_add_find_Constants;
39.103 val Add_Find "Maximum A" = nxt
39.104 @@ -367,10 +367,10 @@
39.105 (Model_Def.max_variants o_model i_model)
39.106 val o_vnts = filter (fn (_, vnts, _, _, _) => member op= vnts max_vnt) o_model
39.107 val i_to_select = i_model
39.108 - |> filter_out (fn (_, vnts, _, _, (I_Model.Cor_POS _, _)) => member op= vnts max_vnt | _ => false)
39.109 + |> filter_out (fn (_, vnts, _, _, (I_Model.Cor _, _)) => member op= vnts max_vnt | _ => false)
39.110 |> select_inc_lists
39.111 -(*ERROR*)val "[\n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
39.112 - = i_to_select |> I_Model.to_string_POS ctxt(*ERROR*)
39.113 +(*ERROR*)val "[\n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
39.114 + = i_to_select |> I_Model.to_string ctxt(*ERROR*)
39.115 (*in*)
39.116 val false =
39.117 (*if*) i_to_select = []
39.118 @@ -443,8 +443,8 @@
39.119 (*+*)val "[0 < fixes]" = pres |> UnparseC.terms ctxt
39.120 (*+*)val "[\"(#Given, (Constants, fixes))\", \"(#Find, (Maximum, maxx))\", \"(#Find, (AdditionalValues, vals))\", \"(#Relate, (Extremum, extr))\", \"(#Relate, (SideConditions, sideconds))\"]"
39.121 (*+*) = model_patt |> Model_Pattern.to_string ctxt
39.122 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.123 - = i_model |> I_Model.to_string_POS ctxt
39.124 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.125 + = i_model |> I_Model.to_string ctxt
39.126
39.127 val return_make_environments as (_, (env_subst, env_eval)) =
39.128 Pre_Conds.make_environments model_patt i_model
39.129 @@ -485,8 +485,8 @@
39.130
39.131 (*+*)val "[\n(1, [\"1\", \"2\", \"3\"], #Given, Constants, [\"[r = 7]\"]), \n(2, [\"1\", \"2\", \"3\"], #Find, Maximum, [\"A\"]), \n(3, [\"1\", \"2\", \"3\"], #Find, AdditionalValues, [\"[u]\", \"[v]\"]), \n(4, [\"1\", \"2\", \"3\"], #Relate, Extremum, [\"A = 2 * u * v - u \<up> 2\"]), \n(5, [\"1\", \"2\"], #Relate, SideConditions, [\"[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]\"]), \n(6, [\"3\"], #Relate, SideConditions, [\"[u / 2 = r * sin \<alpha>]\", \"[2 / v = r * cos \<alpha>]\"]), \n(7, [\"1\"], #undef, FunctionVariable, [\"a\"]), \n(8, [\"2\"], #undef, FunctionVariable, [\"b\"]), \n(9, [\"3\"], #undef, FunctionVariable, [\"\<alpha>\"]), \n(10, [\"1\", \"2\"], #undef, Input_Descript.Domain, [\"{0<..<r}\"]), \n(11, [\"3\"], #undef, Input_Descript.Domain, [\"{0<..<\<pi> / 2}\"]), \n(12, [\"1\", \"2\", \"3\"], #undef, ErrorBound, [\"\<epsilon> = 0\"])]"
39.132 = o_model |> O_Model.to_string ctxt
39.133 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.134 - = i_model |> I_Model.to_string_POS ctxt
39.135 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.136 + = i_model |> I_Model.to_string ctxt
39.137
39.138 val max_vnt as 1= last_elem (*this decides, for which variant initially help is given*)
39.139 (Model_Def.max_variants o_model i_model)
39.140 @@ -495,7 +495,7 @@
39.141 = o_vnts |> O_Model.to_string ctxt
39.142
39.143 val i_to_select = i_model
39.144 - |> filter_out (fn (_, vnts, _, _, (I_Model.Cor_POS _, _)) => member op= vnts max_vnt | _ => false)
39.145 + |> filter_out (fn (_, vnts, _, _, (I_Model.Cor _, _)) => member op= vnts max_vnt | _ => false)
39.146 |> select_inc_lists
39.147 val true =
39.148 (*if*) i_to_select = [] (*then*);
39.149 @@ -646,10 +646,10 @@
39.150 "~~~~~ fun fill_method , args:"; val (o_model, (pbl_imod, met_imod), met_patt) =
39.151 (o_model, (pbl_imod, met_imod), m_patt);
39.152
39.153 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.154 - = pbl_imod |> I_Model.to_string_POS ctxt
39.155 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.156 - = met_imod |> I_Model.to_string_POS ctxt
39.157 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.158 + = pbl_imod |> I_Model.to_string ctxt
39.159 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
39.160 + = met_imod |> I_Model.to_string ctxt
39.161
39.162 (**)val return_max_variants =(**)
39.163 (** )val pbl_max_vnts as [2, 1] =( **)
39.164 @@ -661,10 +661,10 @@
39.165 |> flat
39.166 |> distinct op =
39.167 val variants_separated = map (filter_variants' i_model) all_variants
39.168 -(*+*)val ["[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]",
39.169 - "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]",
39.170 - "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T))]"]
39.171 - = variants_separated |> map (I_Model.to_string_POS ctxt)
39.172 +(*+*)val ["[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]",
39.173 + "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]",
39.174 + "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T))]"]
39.175 + = variants_separated |> map (I_Model.to_string ctxt)
39.176
39.177 val sums_corr as [5, 5, 4] = map (cnt_corrects) variants_separated
39.178 (*----------------#--#--#*)
39.179 @@ -682,8 +682,8 @@
39.180 (*probably pbl/met_imod = [], so take met_patt; if empty return Sup*)
39.181 val i_from_met = map (fn (_, (descr, _)) => (*order from met_patt*)
39.182 Pre_Conds.get_descr_vnt descr pbl_max_vnts met_imod) met_patt (*\<longrightarrow> right order for args*)
39.183 -(*+MET: Sup..*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.184 - = i_from_met |> I_Model.to_string_POS ctxt
39.185 +(*+MET: Sup..*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.186 + = i_from_met |> I_Model.to_string ctxt
39.187
39.188 val met_max_vnts as [2, 1] = Model_Def.max_variants o_model i_from_met;
39.189 val max_vnt as 2 = hd (inter op= pbl_max_vnts met_max_vnts);
39.190 @@ -691,15 +691,15 @@
39.191
39.192 val return_add_other = map (
39.193 add_other max_vnt pbl_imod) i_from_met;
39.194 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.195 - = return_add_other |> I_Model.to_string_POS ctxt;
39.196 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.197 + = return_add_other |> I_Model.to_string ctxt;
39.198 (*/////-------------- step into add_other -------------------------------------------------\\*)
39.199 -"~~~~~ fun add_other_5 , args:"; val (max_vnt, i1_model, (i2, _, bool2, m_field2, (Sup_POS (descr2, ts2), pos2))) =
39.200 +"~~~~~ fun add_other_5 , args:"; val (max_vnt, i1_model, (i2, _, bool2, m_field2, (Sup (descr2, ts2), pos2))) =
39.201 (max_vnt, pbl_imod, nth 5 i_from_met);
39.202
39.203 (*+*)val Const ("Input_Descript.FunctionVariable", _) = descr2;
39.204
39.205 -val (_, vnts1, _, _, (feedb1, _)) = (i2, [], bool2, m_field2, (Sup_POS (descr2, ts2), pos2))
39.206 +val (_, vnts1, _, _, (feedb1, _)) = (i2, [], bool2, m_field2, (Sup (descr2, ts2), pos2))
39.207 val SOME (descr1 as (Const ("Input_Descript.FunctionVariable", _)) ) =
39.208 get_dscr_opt feedb1
39.209 val true =
39.210 @@ -711,25 +711,25 @@
39.211 NONE => false
39.212 | SOME descr1 => descr1 = descr2 andalso Model_Def.member_vnt vnts1 max_vnt) i1_model
39.213
39.214 -val return_add_other_1 = (i2, [max_vnt], bool2, m_field2, (Sup_POS (descr2, ts2), pos2))
39.215 +val return_add_other_1 = (i2, [max_vnt], bool2, m_field2, (Sup (descr2, ts2), pos2))
39.216 val check as true = return_add_other_1 = nth 5 return_add_other
39.217 (*\\\\\-------------- step into add_other -------------------------------------------------//*)
39.218 val i_from_pbl = return_add_other
39.219 (*\\\\---------------- step into fill_method -----------------------------------------------//*)
39.220 val return_fill_method_step = filter (fn (_, vnts', _, _, _) => member op = vnts' max_vnt) i_from_met
39.221
39.222 -(*+MET: dropped ALL DUE TO is_empty_single_POS*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]" =
39.223 - return_fill_method_step |> I_Model.to_string_POS ctxt
39.224 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.225 - = return_fill_method |> I_Model.to_string_POS ctxt;
39.226 +(*+MET: dropped ALL DUE TO is_empty_single*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]" =
39.227 + return_fill_method_step |> I_Model.to_string ctxt
39.228 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.229 + = return_fill_method |> I_Model.to_string ctxt;
39.230 return_fill_method_step = return_fill_method; (*latter is correct, did not investigate further*)
39.231 (*\\\----------------- step into by_i_models -------------------------------------------//*)
39.232 val (_, (i_model, _)) = return_match_itms_oris;
39.233
39.234 (*||------------------ continue. complete_for ------------------------------------------------*)
39.235 val (o_model, ctxt, i_model) = return_complete_for
39.236 -(*+isa*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.237 - = i_model |> I_Model.to_string_POS ctxt(*+isa*)
39.238 +(*+isa*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.239 + = i_model |> I_Model.to_string ctxt(*+isa*)
39.240 (*+isa2:MET.Mis* ) val "[\n(1 ,[1, 2, 3] ,true ,#Given ,Cor Constants [r = 7] , pen2str), \n(2 ,[1, 2, 3] ,true ,#Find ,Cor Maximum A , pen2str), \n(3 ,[1, 2, 3] ,true ,#Find ,Cor AdditionalValues [u, v] , pen2str), \n(4 ,[1, 2, 3] ,true ,#Relate ,Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str), \n(5 ,[1, 2] ,true ,#Relate ,Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str), \n(7 ,[1] ,false ,#Given ,Mis FunctionVariable funvar), \n(10 ,[1, 2] ,false ,#Given ,Mis Input_Descript.Domain doma), \n(12 ,[1, 2, 3] ,false ,#Given ,Mis ErrorBound err)]" =
39.241 i_model |> I_Model.to_string ctxt ( *+isa2*)
39.242 (*\\------------------ step into complete_for ----------------------------------------------//*)
39.243 @@ -751,7 +751,7 @@
39.244 (*/------------------- step into me_Specify_Method -----------------------------------------\\*)
39.245 "~~~~~ fun me , args:"; val (tac, p, _, pt) = (nxt, p, c, pt);
39.246
39.247 -(*+*)val "[]" =(*+*) get_obj g_met pt (fst p) |> I_Model.to_string_POS ctxt
39.248 +(*+*)val "[]" =(*+*) get_obj g_met pt (fst p) |> I_Model.to_string ctxt
39.249
39.250 val ctxt = Ctree.get_ctxt pt p
39.251 val (pt, p) =
39.252 @@ -771,8 +771,8 @@
39.253 (* M_Match.by_i_models*)
39.254 "~~~~~ fun by_i_models , args:"; val () = ();
39.255
39.256 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.257 - = get_obj g_met pt (fst p) |> I_Model.to_string_POS ctxt;
39.258 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.259 + = get_obj g_met pt (fst p) |> I_Model.to_string ctxt;
39.260
39.261 (*case*)
39.262 Step.do_next p ((pt, Pos.e_pos'), []) (*of*);
39.263 @@ -803,8 +803,8 @@
39.264 (*if*) Ctree.just_created (pt, pos) andalso origin <> Ctree.e_origin (*else*);
39.265 (*if*) p_ = Pos.Pbl (*else*);
39.266
39.267 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.268 - = met |> I_Model.to_string_POS ctxt
39.269 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.270 + = met |> I_Model.to_string ctxt
39.271
39.272 (**)val ("dummy", (Met, Add_Given "FunctionVariable a")) =(**)
39.273 Specify.for_method ctxt oris (o_refs, refs) (pbl, met);
39.274 @@ -825,17 +825,17 @@
39.275 "~~~~~ fun item_to_add , args:"; val (ctxt, o_model, i_model) = (ctxt, oris, met);
39.276 (*+*)val "[\n(1, [\"1\", \"2\", \"3\"], #Given, Constants, [\"[r = 7]\"]), \n(2, [\"1\", \"2\", \"3\"], #Given, Maximum, [\"A\"]), \n(3, [\"1\", \"2\", \"3\"], #Find, AdditionalValues, [\"[u]\", \"[v]\"]), \n(4, [\"1\", \"2\", \"3\"], #Given, Extremum, [\"A = 2 * u * v - u \<up> 2\"]), \n(5, [\"1\", \"2\"], #Given, SideConditions, [\"[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]\"]), \n(6, [\"3\"], #Given, SideConditions, [\"[u / 2 = r * sin \<alpha>]\", \"[2 / v = r * cos \<alpha>]\"]), \n(7, [\"1\"], #Given, FunctionVariable, [\"a\"]), \n(8, [\"2\"], #Given, FunctionVariable, [\"b\"]), \n(9, [\"3\"], #Given, FunctionVariable, [\"\<alpha>\"]), \n(10, [\"1\", \"2\"], #Given, Input_Descript.Domain, [\"{0<..<r}\"]), \n(11, [\"3\"], #Given, Input_Descript.Domain, [\"{0<..<\<pi> / 2}\"]), \n(12, [\"1\", \"2\", \"3\"], #Given, ErrorBound, [\"\<epsilon> = 0\"])]"
39.277 = oris |> O_Model.to_string ctxt
39.278 -(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
39.279 - = i_model |> I_Model.to_string_POS ctxt
39.280 +(*+*)val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
39.281 + = i_model |> I_Model.to_string ctxt
39.282
39.283 val max_vnt = last_elem (*this decides, for which variant initially help is given*)
39.284 (Model_Def.max_variants o_model i_model)
39.285 val o_vnts = filter (fn (_, vnts, _, _, _) => member op= vnts max_vnt) o_model
39.286 val i_to_select = i_model
39.287 - |> filter_out (fn (_, vnts, _, _, (I_Model.Cor_POS _, _)) => member op= vnts max_vnt | _ => false)
39.288 + |> filter_out (fn (_, vnts, _, _, (I_Model.Cor _, _)) => member op= vnts max_vnt | _ => false)
39.289 |> select_inc_lists
39.290 -(*+*)val "[\n(0, [2], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup_POS ErrorBound, Position.T))]"
39.291 - = i_to_select |> I_Model.to_string_POS ctxt
39.292 +(*+*)val "[\n(0, [2], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n(0, [2], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n(0, [2], false ,i_model_empty, (Sup ErrorBound, Position.T))]"
39.293 + = i_to_select |> I_Model.to_string ctxt
39.294
39.295 val false =
39.296 (*if*) i_to_select = [] (*else*);
39.297 @@ -852,7 +852,7 @@
39.298 val descr = Model_Def.get_descr feedb (*i_single has been filtered appropriately*)
39.299 val false =
39.300 (*if*) Model_Def.is_list_descr descr (*else*);
39.301 -val return_fill_from_o_STEP = SOME (i, vnts, bool, m_field, (Cor_POS (descr, all_value), pos))
39.302 +val return_fill_from_o_STEP = SOME (i, vnts, bool, m_field, (Cor (descr, all_value), pos))
39.303 (*-------------------- stopped after ERROR found ---------------------------------------------*)
39.304 (*\\\\\ \\\----------- step into fill_from_o -----------------------------------------------//*)
39.305 val SOME (_, _, _, m_field, (feedb, _)) = return_fill_from_o
40.1 --- a/test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml Mon Dec 11 16:18:42 2023 +0100
40.2 +++ b/test/Tools/isac/Minisubpbl/200-start-method-NEXT_STEP.sml Mon Dec 11 17:26:30 2023 +0100
40.3 @@ -85,8 +85,8 @@
40.4 (*+isa==isa2*)val [Const ("Test.precond_rootmet", _) $ Free ("v_v", _)] = where_
40.5 (*+*)val "[\"(#Given, (equality, e_e))\", \"(#Given, (solveFor, v_v))\", \"(#Find, (solutions, v_v'i'))\"]"
40.6 = model_patt |> Model_Pattern.to_string ctxt(*+*)
40.7 -(*+*)val "[\n(1, [1], true ,#Given, (Cor_POS equality (x + 1 = 2) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor_POS solveFor x , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor_POS solutions L , pen2str, Position.T))]"
40.8 - = i_model |> I_Model.to_string_POS ctxt(*+*)
40.9 +(*+*)val "[\n(1, [1], true ,#Given, (Cor equality (x + 1 = 2) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor solveFor x , pen2str, Position.T)), \n(3, [1], true ,#Find, (Cor solutions L , pen2str, Position.T))]"
40.10 + = i_model |> I_Model.to_string ctxt(*+*)
40.11
40.12 (*+*)val [(true, tTEST as Const ("Test.precond_rootmet", _) $ Free ("x", xxx))] = full_subst
40.13
41.1 --- a/test/Tools/isac/Minisubpbl/400-start-meth-subpbl.sml Mon Dec 11 16:18:42 2023 +0100
41.2 +++ b/test/Tools/isac/Minisubpbl/400-start-meth-subpbl.sml Mon Dec 11 17:26:30 2023 +0100
41.3 @@ -106,10 +106,10 @@
41.4 "(#Given, (equality, e_e))\", \"" ^
41.5 "(#Given, (solveFor, v_v))\", \"" ^
41.6 "(#Find, (solutions, v_v'i'))\"]";
41.7 -(*+*)(( pbl) |> I_Model.to_string_POS @{context}) = "[\n" ^
41.8 - "(1, [1], true ,#Given, (Cor_POS equality (- 1 + x = 0) ,(e_e, [- 1 + x = 0]), Position.T)), \n" ^
41.9 - "(2, [1], true ,#Given, (Cor_POS solveFor x ,(v_v, [x]), Position.T)), \n" ^
41.10 - "(3, [1], true ,#Find, (Cor_POS solutions x_i ,(v_v'i', [x_i]), Position.T))]";
41.11 +(*+*)(( pbl) |> I_Model.to_string @{context}) = "[\n" ^
41.12 + "(1, [1], true ,#Given, (Cor equality (- 1 + x = 0) ,(e_e, [- 1 + x = 0]), Position.T)), \n" ^
41.13 + "(2, [1], true ,#Given, (Cor solveFor x ,(v_v, [x]), Position.T)), \n" ^
41.14 + "(3, [1], true ,#Find, (Cor solutions x_i ,(v_v'i', [x_i]), Position.T))]";
41.15
41.16 val all_variants =
41.17 map (fn (_, variants, _, _, _) => variants) i_model
42.1 --- a/test/Tools/isac/Specify/i-model.sml Mon Dec 11 16:18:42 2023 +0100
42.2 +++ b/test/Tools/isac/Specify/i-model.sml Mon Dec 11 17:26:30 2023 +0100
42.3 @@ -8,7 +8,7 @@
42.4 "-----------------------------------------------------------------------------------------------";
42.5 "----------- survey on handling of input terms -------------------------------------------------";
42.6 "----------- investigate fun add_single in I_Model ---------------------------------------------";
42.7 -"----------- build I_Model.init_POS -----------------------------------------------------------";
42.8 +"----------- build I_Model.init -----------------------------------------------------------";
42.9 "----------- exercise preparing I_Model.is_complete --------------------------------------------";
42.10 "----------- build I_Model.is_complete_OLD -----------------------------------------------------";
42.11 "----------- build I_Model.s_make_complete -----------------------------------------------------";
42.12 @@ -45,9 +45,9 @@
42.13 val true = (*if*)Model_Def.is_list_descr descr(*else*);
42.14
42.15 val values = vals_term |> TermC.isalist2list |> map TermC.single_to_list
42.16 -val feedb = Cor_POS (descr, values)
42.17 +val feedb = Cor (descr, values)
42.18
42.19 -val "Cor_POS AdditionalValues [u, v] , pen2str" = feedb |> feedback_POS_to_string ctxt
42.20 +val "Cor AdditionalValues [u, v] , pen2str" = feedb |> feedback_to_string ctxt
42.21
42.22 (*get values out of feedback:*)
42.23 val [Free ("u", _), Free ("v", _)] = (values |> map TermC.isalist2list |> flat): term list
42.24 @@ -57,9 +57,9 @@
42.25 val true = (*if*)Model_Def.is_list_descr descr(*else*);
42.26
42.27 val values = [vals_term]
42.28 -val feedb = Cor_POS (descr, values)
42.29 +val feedb = Cor (descr, values)
42.30
42.31 -val "Cor_POS AdditionalValues [u, v] , pen2str" = feedb |> feedback_POS_to_string ctxt (*OK*)
42.32 +val "Cor AdditionalValues [u, v] , pen2str" = feedb |> feedback_to_string ctxt (*OK*)
42.33
42.34 (*get values out of feedback:*)
42.35 val "[u, v]" = values |> map (UnparseC.term ctxt) |> hd
42.36 @@ -74,9 +74,9 @@
42.37 val false = (*if*)Model_Def.is_list_descr descr(*then*);
42.38
42.39 val values = [vals_term]
42.40 -val feedb = Cor_POS (descr, values)
42.41 +val feedb = Cor (descr, values)
42.42
42.43 -val "Cor_POS Maximum A , pen2str" = feedb |> feedback_POS_to_string ctxt (*OK*)
42.44 +val "Cor Maximum A , pen2str" = feedb |> feedback_to_string ctxt (*OK*)
42.45
42.46 (*get values out of feedback:*)
42.47 val "A" = values |> map (UnparseC.term ctxt) |> hd
42.48 @@ -86,9 +86,9 @@
42.49 val false = (*if*)Model_Def.is_list_descr descr(*then*);
42.50
42.51 val values = [vals_term]
42.52 -val feedb = Cor_POS (descr, values)
42.53 +val feedb = Cor (descr, values)
42.54
42.55 -val "Cor_POS Maximum A , pen2str" = feedb |> feedback_POS_to_string ctxt (*OK*)
42.56 +val "Cor Maximum A , pen2str" = feedb |> feedback_to_string ctxt (*OK*)
42.57
42.58 (*get values out of feedback:*)
42.59 val "A" = values |> map (UnparseC.term ctxt) |> hd;
42.60 @@ -145,8 +145,8 @@
42.61 "(6, [\"1\"], #undef, GleichungsVariablen, [\"[c]\", \"[c_2]\", \"[c_3]\", \"[c_4]\"]), \n" ^
42.62 "(7, [\"1\"], #undef, AbleitungBiegelinie, [\"dy\"])]"
42.63 (*+*)then () else error "INITIAL O_Model CHANGED";
42.64 -(*+*)val "[\n(1, [1], true ,#Given, (Cor_POS Traegerlaenge L , pen2str, Position.T)), \n(2, [1], false ,#Given, (Inc_POS Streckenlast __, Position.T)), \n(3, [1], false ,#Find, (Inc_POS Biegelinie __, Position.T)), \n(4, [1], false ,#Relate, (Inc_POS Randbedingungen [] [__=__, __=__], Position.T))]"
42.65 - = pbl |> I_Model.to_string_POS ctxt
42.66 +(*+*)val "[\n(1, [1], true ,#Given, (Cor Traegerlaenge L , pen2str, Position.T)), \n(2, [1], false ,#Given, (Inc Streckenlast __, Position.T)), \n(3, [1], false ,#Find, (Inc Biegelinie __, Position.T)), \n(4, [1], false ,#Relate, (Inc Randbedingungen [] [__=__, __=__], Position.T))]"
42.67 + = pbl |> I_Model.to_string ctxt
42.68
42.69 val return_check_single = (*case*)
42.70 I_Model.check_single ctxt m_field oris i_model m_patt ct (*of*);
42.71 @@ -169,7 +169,7 @@
42.72 (**)val ("", itm) =(**)
42.73 (*case*) is_notyet_input ctxt i_model all ori' m_patt (*of*);
42.74
42.75 -(*+*)val (2, [1], true, "#Given", (Cor_POS (Const (\<^const_name>\<open>Streckenlast\<close>, _), [Free ("q_0", _)]), _)) = itm
42.76 +(*+*)val (2, [1], true, "#Given", (Cor (Const (\<^const_name>\<open>Streckenlast\<close>, _), [Free ("q_0", _)]), _)) = itm
42.77 (*\\------------------ step into check_single ----------------------------------------------//*)
42.78 val I_Model.Add i_single = return_check_single
42.79
42.80 @@ -197,9 +197,9 @@
42.81 ( *ErRoR Clash of types "_ \<Rightarrow> _" and "_ list", Randbedingungen :: bool list \<Rightarrow> una, y :: real \<Rightarrow> real*)
42.82
42.83
42.84 -"----------- build I_Model.init_POS -----------------------------------------------------------";
42.85 -"----------- build I_Model.init_POS -----------------------------------------------------------";
42.86 -"----------- build I_Model.init_POS -----------------------------------------------------------";
42.87 +"----------- build I_Model.init -----------------------------------------------------------";
42.88 +"----------- build I_Model.init -----------------------------------------------------------";
42.89 +"----------- build I_Model.init -----------------------------------------------------------";
42.90 (*/---------------------------------------- mimic input from PIDE -----------------------------\*)
42.91
42.92 (* Test_Example "Diff_App-No.123a" (*complete Model, empty References*) *)
42.93 @@ -235,11 +235,11 @@
42.94 (*+*) refs
42.95
42.96 val empty_i_model =
42.97 - I_Model.init_POS ctxt o_model model_patt;
42.98 -"~~~~~ fun init_POS , args:"; val (ctxt, model_patt) = (ctxt, model_patt);
42.99 + I_Model.init ctxt o_model model_patt;
42.100 +"~~~~~ fun init , args:"; val (ctxt, model_patt) = (ctxt, model_patt);
42.101 ;
42.102 -(*+*)val "[\n(1, [1, 2, 3], false ,#Given, (Inc_POS Constants [] [__=__, __=__], Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
42.103 - = I_Model.to_string_POS @{context} empty_i_model;
42.104 +(*+*)val "[\n(1, [1, 2, 3], false ,#Given, (Inc Constants [] [__=__, __=__], Position.T)), \n(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
42.105 + = I_Model.to_string @{context} empty_i_model;
42.106
42.107
42.108 "----------- exercise preparing I_Model.is_complete --------------------------------------------";
42.109 @@ -294,43 +294,43 @@
42.110 *****************************************************************************************
42.111 The ERROR occurred somewhere since introducing structure or since transition to PIDE.
42.112 *****************************************************************************************
42.113 - We complete the two single_POS "1" and "5" below and replace them in empty_input;
42.114 + We complete the two single "1" and "5" below and replace them in empty_input;
42.115 we add "6" as variant of "5" to the empty input.
42.116 later we shall replace empty_input by partial input "AdditionalValues [v]" (u missing).
42.117 - The test intermediatly pairs (feedback_POS, Position.T) in I_Model.T_POS
42.118 + The test intermediatly pairs (feedback, Position.T) in I_Model.T
42.119 and leaves the rest as is.
42.120
42.121 I_Model.is_complete_OLD: because PIDE gets instantiated Pre_Conds by Template.show,
42.122 - I_Model.is_complete_POS NO instantiation (done in Template.show):
42.123 + I_Model.is_complete NO instantiation (done in Template.show):
42.124 it serves to maintain the OLD test/*
42.125 *)
42.126 val thy = @{theory Calculation}
42.127
42.128 val state =
42.129 case the_data thy of
42.130 - CTbasic_POS.EmptyPtree => Preliminary.init_ctree thy example_id
42.131 + CTbasic.EmptyPtree => Preliminary.init_ctree thy example_id
42.132 | _(*state (*FOR TEST*)*) => (**)the_data thy(**)
42.133 (*let*)
42.134 val {origin = (o_model, o_ref, _), spec = spec_ref, probl, meth, ctxt, ...} =
42.135 - CTbasic_POS.get_obj I state [(*Pos will become variable*)] |> CTbasic_POS.rep_specify_data
42.136 + CTbasic.get_obj I state [(*Pos will become variable*)] |> CTbasic.rep_specify_data
42.137 ;
42.138 -probl: Model_Def.i_model_POS
42.139 -(*[(1, [1, 2, 3], false, "#Given", (Inp_POS (Const ("Input_Descript.Constants", "bool list \<Rightarrow> nam"), "[__=__, __=__]"), {})),
42.140 - (2, [1, 2, 3], false, "#Find", (Inp_POS (Const ("Input_Descript.Maximum", "real \<Rightarrow> toreal"), "__"), {})),
42.141 - (3, [1, 2, 3], false, "#Find", (Inp_POS (Const ("Input_Descript.AdditionalValues", "real list \<Rightarrow> toreall"), "[__, __]"), {})),
42.142 - (4, [1, 2, 3], false, "#Relate", (Inp_POS (Const ("Input_Descript.Extremum", "bool \<Rightarrow> toreal"), "(__=__)"), {})),
42.143 - (5, [1, 2], false, "#Relate", (Inp_POS (Const ("Input_Descript.SideConditions", "bool list \<Rightarrow> una"), "[__=__, __=__]"), {}))]*)
42.144 +probl: Model_Def.i_model
42.145 +(*[(1, [1, 2, 3], false, "#Given", (Inp (Const ("Input_Descript.Constants", "bool list \<Rightarrow> nam"), "[__=__, __=__]"), {})),
42.146 + (2, [1, 2, 3], false, "#Find", (Inp (Const ("Input_Descript.Maximum", "real \<Rightarrow> toreal"), "__"), {})),
42.147 + (3, [1, 2, 3], false, "#Find", (Inp (Const ("Input_Descript.AdditionalValues", "real list \<Rightarrow> toreall"), "[__, __]"), {})),
42.148 + (4, [1, 2, 3], false, "#Relate", (Inp (Const ("Input_Descript.Extremum", "bool \<Rightarrow> toreal"), "(__=__)"), {})),
42.149 + (5, [1, 2], false, "#Relate", (Inp (Const ("Input_Descript.SideConditions", "bool list \<Rightarrow> una"), "[__=__, __=__]"), {}))]*)
42.150 ;
42.151 -val probl_POS = (*from above, #1 and #5,6 replaced by complete items for building code.test*)
42.152 +val probl = (*from above, #1 and #5,6 replaced by complete items for building code.test*)
42.153 (1, [1,2,3], true, "#Given",
42.154 - (Cor_POS ((@{term "Constants"}, [@{term "[r = (7::real)]"(*should be "r = (7::real)"*)}]),
42.155 + (Cor ((@{term "Constants"}, [@{term "[r = (7::real)]"(*should be "r = (7::real)"*)}]),
42.156 (@{term "fixes::bool list"}, [@{term "[r = (7::real)]"}])), Position.none )) ::
42.157 nth 2 probl :: nth 3 probl :: nth 4 probl ::
42.158 (5, [1,2], true, "#Relate",
42.159 - (Cor_POS ((@{term "SideConditions"}, [@{term "[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]"}]),
42.160 + (Cor ((@{term "SideConditions"}, [@{term "[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]"}]),
42.161 (@{term "sideconds::bool list"}, [TermC.empty])), Position.none )) ::
42.162 (6, [3], true, "#Relate",
42.163 - (Cor_POS ((@{term "SideConditions"}, [@{term "[2 * u = r * sin \<alpha>, 2 * v = r * cos \<alpha>]"}]),
42.164 + (Cor ((@{term "SideConditions"}, [@{term "[2 * u = r * sin \<alpha>, 2 * v = r * cos \<alpha>]"}]),
42.165 (@{term "sideconds::bool list"}, [TermC.empty])), Position.none ))
42.166 :: [];
42.167
42.168 @@ -350,8 +350,8 @@
42.169 val "[0 < fixes]" = (where_OLD |> UnparseC.terms @{context})
42.170 (*\\------------------ test data setup -----------------------------------------------------//*)
42.171
42.172 -(*/------------------- test on OLD algorithm (with I_Model.T_POS) --------------------------\*)
42.173 -(*\------------------- test on OLD algorithm (with I_Model.T_POS) --------------------------/*)
42.174 +(*/------------------- test on OLD algorithm (with I_Model.T) --------------------------\*)
42.175 +(*\------------------- test on OLD algorithm (with I_Model.T) --------------------------/*)
42.176 ( *\----- reactivate with CS "remove sep_variants_envs"-----/*)
42.177
42.178
42.179 @@ -385,13 +385,13 @@
42.180 | _ => raise ERROR ""
42.181
42.182 val pbl_imod = [ (*2 items for creating code ---> variants [1, 2]*)
42.183 - (1, [1, 2, 3], true, "#undef", (Cor_POS (@{term Constants},
42.184 + (1, [1, 2, 3], true, "#undef", (Cor (@{term Constants},
42.185 [@{term "[r = (7::real)]"}]), Position.none)),
42.186 - (1, [1, 2], true, "#undef", (Cor_POS (@{term SideConditions},
42.187 + (1, [1, 2], true, "#undef", (Cor (@{term SideConditions},
42.188 [@{term "[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]"}]), Position.none))]
42.189
42.190 val met_imod = [ (*1 item for creating code*)
42.191 -(8, [2], true, "#undef", (Cor_POS (@{term FunctionVariable}, [@{term "b::real"}]), Position.none))]
42.192 +(8, [2], true, "#undef", (Cor (@{term FunctionVariable}, [@{term "b::real"}]), Position.none))]
42.193 ;
42.194 (*+*)if (o_model |> O_Model.to_string @{context}) = "[\n" ^
42.195 (*+*) "(1, [\"1\", \"2\", \"3\"], #Given, Constants, [\"[r = 7]\"]), \n" ^
42.196 @@ -426,17 +426,17 @@
42.197 val equal_descr = filter (fn (_, _, _, _, (feedb, _)) => case get_dscr_opt feedb of NONE => false
42.198 | SOME descr' => if descr = descr' then true else false) i_model
42.199 ;
42.200 -(*+*)filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) equal_descr: I_Model.T_POS
42.201 +(*+*)filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) equal_descr: I_Model.T
42.202 ;
42.203 val return_get_descr_vnt_1 =
42.204 case filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) equal_descr of
42.205 - [] => (0, [], false, "i_model_empty", (Sup_POS (descr, []), Position.none))
42.206 + [] => (0, [], false, "i_model_empty", (Sup (descr, []), Position.none))
42.207 | items => Library.the_single items (*only applied to model_patt, which has each descr once*)
42.208 (*\\------------------ step into get_descr_vnt ---------------------------------------------//*)
42.209
42.210 (*|------------------- continue s_make_complete ----------------------------------------------*)
42.211 val pbl_from_o_model = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
42.212 - if is_empty_single_POS i_single
42.213 + if is_empty_single i_single
42.214 then
42.215 case get_descr_vnt' feedb pbl_max_vnts o_model of
42.216 (*-----------^^^^^^^^^^^^^^-----------------------------*)
42.217 @@ -445,21 +445,21 @@
42.218 else [i_single (*fetched before from pbl_imod*)])) i_from_pbl |> flat
42.219
42.220 (*+*)val [2, 1] = vnts;
42.221 -(*+*)if (pbl_from_o_model |> I_Model.to_string_POS @{context}) = "[\n" ^
42.222 - "(1, [1, 2, 3], true ,#undef, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n" ^
42.223 - "(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n" ^
42.224 - "(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n" ^
42.225 - "(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.226 - "(1, [1, 2], true ,#undef, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
42.227 +(*+*)if (pbl_from_o_model |> I_Model.to_string @{context}) = "[\n" ^
42.228 + "(1, [1, 2, 3], true ,#undef, (Cor Constants [r = 7] , pen2str, Position.T)), \n" ^
42.229 + "(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n" ^
42.230 + "(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n" ^
42.231 + "(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.232 + "(1, [1, 2], true ,#undef, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
42.233 then () else error "pbl_from_o_model CHANGED 1"
42.234
42.235 (*//------------------ step into map ((fn i_single -----------------------------------------\\*)
42.236 "~~~~~ fun map ((fn i_single , args:"; val (i_single as (_, _, _, _, (feedb, _))) = (nth 1 i_from_pbl);
42.237 - (*if*) is_empty_single_POS i_single (*else*);
42.238 + (*if*) is_empty_single i_single (*else*);
42.239 get_descr_vnt' feedb pbl_max_vnts o_model;
42.240
42.241 val pbl_from_o_model = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
42.242 - if is_empty_single_POS i_single
42.243 + if is_empty_single i_single
42.244 then
42.245 case get_descr_vnt' feedb pbl_max_vnts o_model of
42.246 (*---------- ^^^^^^^^^^^^^^ ----------------------------*)
42.247 @@ -472,16 +472,16 @@
42.248 val i_from_met = map (fn (_, (descr, _)) =>
42.249 Pre_Conds.get_descr_vnt descr pbl_max_vnts met_imod) met_patt
42.250 ;
42.251 -(*+*)if (i_from_met |> I_Model.to_string_POS @{context}) = "[\n" ^
42.252 - "(0, [], false ,i_model_empty, (Sup_POS Constants [], Position.T)), \n" ^
42.253 - "(0, [], false ,i_model_empty, (Sup_POS Maximum, Position.T)), \n" ^
42.254 - "(0, [], false ,i_model_empty, (Sup_POS Extremum, Position.T)), \n" ^
42.255 - "(0, [], false ,i_model_empty, (Sup_POS SideConditions [], Position.T)), \n" ^
42.256 - "(8, [2], true ,#undef, (Cor_POS FunctionVariable b , pen2str, Position.T)), \n" ^
42.257 +(*+*)if (i_from_met |> I_Model.to_string @{context}) = "[\n" ^
42.258 + "(0, [], false ,i_model_empty, (Sup Constants [], Position.T)), \n" ^
42.259 + "(0, [], false ,i_model_empty, (Sup Maximum, Position.T)), \n" ^
42.260 + "(0, [], false ,i_model_empty, (Sup Extremum, Position.T)), \n" ^
42.261 + "(0, [], false ,i_model_empty, (Sup SideConditions [], Position.T)), \n" ^
42.262 + "(8, [2], true ,#undef, (Cor FunctionVariable b , pen2str, Position.T)), \n" ^
42.263 (*---there is 1 item already input -^^^^^^^^^^^^^^^^^^*)
42.264 - "(0, [], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n" ^
42.265 - "(0, [], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n" ^
42.266 - "(0, [], false ,i_model_empty, (Sup_POS AdditionalValues [], Position.T))]"
42.267 + "(0, [], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n" ^
42.268 + "(0, [], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n" ^
42.269 + "(0, [], false ,i_model_empty, (Sup AdditionalValues [], Position.T))]"
42.270 (*+*)then () else error "s_make_complete: from_met CHANGED";
42.271 ;
42.272 val met_max_vnts = Model_Def.max_variants o_model i_from_met;
42.273 @@ -489,22 +489,22 @@
42.274
42.275 val met_max_vnt = hd met_max_vnts (*need only one for solve-phase*)
42.276 val met_from_pbl = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
42.277 - if is_empty_single_POS i_single
42.278 + if is_empty_single i_single
42.279 then
42.280 case get_descr_vnt' feedb [met_max_vnt] o_model of
42.281 [] => raise ERROR (msg [met_max_vnt] feedb)
42.282 | o_singles => map transfer_terms o_singles
42.283 else [i_single (*fetched before from met_imod*)])) i_from_met |> flat
42.284 ;
42.285 -(*+*)if (met_from_pbl |> I_Model.to_string_POS @{context}) = "[\n" ^
42.286 - "(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n" ^
42.287 - "(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n" ^
42.288 - "(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.289 - "(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
42.290 - "(8, [2], true ,#undef, (Cor_POS FunctionVariable b , pen2str, Position.T)), \n" ^
42.291 - "(10, [1, 2], true ,#undef, (Cor_POS Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n" ^
42.292 - "(12, [1, 2, 3], true ,#undef, (Cor_POS ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n" ^
42.293 - "(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
42.294 +(*+*)if (met_from_pbl |> I_Model.to_string @{context}) = "[\n" ^
42.295 + "(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n" ^
42.296 + "(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n" ^
42.297 + "(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.298 + "(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
42.299 + "(8, [2], true ,#undef, (Cor FunctionVariable b , pen2str, Position.T)), \n" ^
42.300 + "(10, [1, 2], true ,#undef, (Cor Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n" ^
42.301 + "(12, [1, 2, 3], true ,#undef, (Cor ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n" ^
42.302 + "(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
42.303 (*+*)then () else error "s_make_complete: met_from_pbl CHANGED";
42.304 ;
42.305 val return_s_make_complete_step = (pbl_from_o_model, met_from_pbl)
42.306 @@ -574,32 +574,32 @@
42.307 (*//------------------ step into get_descr_vnt ---------------------------------------------\\*)
42.308 "~~~~~ fun get_descr_vnt , args:"; val (descr, vnts, i_model) =
42.309 (@{term Constants}, pbl_max_vnts, pbl_imod);
42.310 - val equal_descr(*for (*+*)filter (fn (_, vnts',..*): I_Model.T_POS =
42.311 + val equal_descr(*for (*+*)filter (fn (_, vnts',..*): I_Model.T =
42.312 filter (fn (_, _, _, _, (feedb, _)) => case get_dscr_opt feedb of NONE => false
42.313 | SOME descr' => if descr = descr' then true else false) i_model
42.314 ;
42.315 -(*+*)filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) (equal_descr: I_Model.T_POS)
42.316 -(*+*): I_Model.T_POS
42.317 +(*+*)filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) (equal_descr: I_Model.T)
42.318 +(*+*): I_Model.T
42.319 ;
42.320 val return_get_descr_vnt_1 =
42.321 case filter (fn (_, vnts', _, _, _) => inter op= vnts' vnts <> []) equal_descr of
42.322 - [] => (0, [], false, "i_model_empty", (Sup_POS (descr, []), Position.none))
42.323 + [] => (0, [], false, "i_model_empty", (Sup (descr, []), Position.none))
42.324 | items => Library.the_single items (*only applied to model_patt, which has each descr once*)
42.325 (*\\------------------ step into get_descr_vnt ---------------------------------------------//*)
42.326 ;
42.327 (*+*)if return_get_descr_vnt_1 = nth 1 i_from_pbl
42.328 (*+*)then () else error "return_get_descr_vnt_1 <> nth 1 i_from_pbl";
42.329 -(*+*)if (i_from_pbl |> I_Model.to_string_POS @{context}) = "[\n" ^
42.330 - "(0, [], false ,i_model_empty, (Sup_POS Constants [], Position.T)), \n" ^
42.331 - "(0, [], false ,i_model_empty, (Sup_POS Maximum, Position.T)), \n" ^
42.332 - "(0, [], false ,i_model_empty, (Sup_POS AdditionalValues [], Position.T)), \n" ^
42.333 - "(0, [], false ,i_model_empty, (Sup_POS Extremum, Position.T)), \n" ^
42.334 - "(0, [], false ,i_model_empty, (Sup_POS SideConditions [], Position.T))]"
42.335 +(*+*)if (i_from_pbl |> I_Model.to_string @{context}) = "[\n" ^
42.336 + "(0, [], false ,i_model_empty, (Sup Constants [], Position.T)), \n" ^
42.337 + "(0, [], false ,i_model_empty, (Sup Maximum, Position.T)), \n" ^
42.338 + "(0, [], false ,i_model_empty, (Sup AdditionalValues [], Position.T)), \n" ^
42.339 + "(0, [], false ,i_model_empty, (Sup Extremum, Position.T)), \n" ^
42.340 + "(0, [], false ,i_model_empty, (Sup SideConditions [], Position.T))]"
42.341 (*+*)then () else error "I_Model.s_make_complete > i_from_pbl CHANGED";
42.342
42.343 (*|------------------- continue s_make_complete ----------------------------------------------*)
42.344 val pbl_from_o_model = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
42.345 - if is_empty_single_POS i_single
42.346 + if is_empty_single i_single
42.347 then
42.348 case get_descr_vnt' feedb pbl_max_vnts o_model of
42.349 (*-----------^^^^^^^^^^^^^^-----------------------------*)
42.350 @@ -608,24 +608,24 @@
42.351 else [i_single (*fetched before from pbl_imod*)])) i_from_pbl |> flat
42.352
42.353 (*+*)val [1, 2, 3] = vnts;
42.354 -(*+*)if (pbl_from_o_model |> I_Model.to_string_POS @{context}) = "[\n" ^
42.355 - "(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n" ^
42.356 - "(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n" ^
42.357 - "(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n" ^
42.358 - "(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.359 - "(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
42.360 - "(6, [3], true ,#Relate, (Cor_POS SideConditions [u / 2 = r * sin \<alpha>, 2 / v = r * cos \<alpha>] , pen2str, Position.T))]"
42.361 +(*+*)if (pbl_from_o_model |> I_Model.to_string @{context}) = "[\n" ^
42.362 + "(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n" ^
42.363 + "(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n" ^
42.364 + "(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n" ^
42.365 + "(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.366 + "(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
42.367 + "(6, [3], true ,#Relate, (Cor SideConditions [u / 2 = r * sin \<alpha>, 2 / v = r * cos \<alpha>] , pen2str, Position.T))]"
42.368 then () else error "pbl_from_o_model CHANGED 2"
42.369
42.370 (*//------------------ step into map ((fn i_single -----------------------------------------\\*)
42.371 "~~~~~ fun map nth 1 ((fn i_single , args:"; val (i_single as (_, _, _, _, (feedb, _))) =
42.372 (nth 1 i_from_pbl);
42.373 - (*if*) is_empty_single_POS i_single (*then*);
42.374 + (*if*) is_empty_single i_single (*then*);
42.375 (*case*) get_descr_vnt' feedb pbl_max_vnts o_model;
42.376
42.377 -(*+*)val (0, [], false, "i_model_empty", (Sup_POS (Const ("Input_Descript.Constants", _), []), _))
42.378 +(*+*)val (0, [], false, "i_model_empty", (Sup (Const ("Input_Descript.Constants", _), []), _))
42.379 = i_single
42.380 -(*+*)val true = is_empty_single_POS i_single
42.381 +(*+*)val true = is_empty_single i_single
42.382
42.383 val return_get_descr_vnt'= (*case*)
42.384 get_descr_vnt' feedb pbl_max_vnts o_model (*of*);
42.385 @@ -636,15 +636,15 @@
42.386 Pre_Conds.get_descr_vnt descr pbl_max_vnts met_imod) met_patt
42.387
42.388 (*+*)val [1, 2, 3] = pbl_max_vnts (*..? ? GOON*);
42.389 -(*+*)if (i_from_met |> I_Model.to_string_POS @{context}) = "[\n" ^
42.390 - "(0, [], false ,i_model_empty, (Sup_POS Constants [], Position.T)), \n" ^
42.391 - "(0, [], false ,i_model_empty, (Sup_POS Maximum, Position.T)), \n" ^
42.392 - "(0, [], false ,i_model_empty, (Sup_POS Extremum, Position.T)), \n" ^
42.393 - "(0, [], false ,i_model_empty, (Sup_POS SideConditions [], Position.T)), \n" ^
42.394 - "(0, [], false ,i_model_empty, (Sup_POS FunctionVariable, Position.T)), \n" ^
42.395 - "(0, [], false ,i_model_empty, (Sup_POS Input_Descript.Domain, Position.T)), \n" ^
42.396 - "(0, [], false ,i_model_empty, (Sup_POS ErrorBound, Position.T)), \n" ^
42.397 - "(0, [], false ,i_model_empty, (Sup_POS AdditionalValues [], Position.T))]"
42.398 +(*+*)if (i_from_met |> I_Model.to_string @{context}) = "[\n" ^
42.399 + "(0, [], false ,i_model_empty, (Sup Constants [], Position.T)), \n" ^
42.400 + "(0, [], false ,i_model_empty, (Sup Maximum, Position.T)), \n" ^
42.401 + "(0, [], false ,i_model_empty, (Sup Extremum, Position.T)), \n" ^
42.402 + "(0, [], false ,i_model_empty, (Sup SideConditions [], Position.T)), \n" ^
42.403 + "(0, [], false ,i_model_empty, (Sup FunctionVariable, Position.T)), \n" ^
42.404 + "(0, [], false ,i_model_empty, (Sup Input_Descript.Domain, Position.T)), \n" ^
42.405 + "(0, [], false ,i_model_empty, (Sup ErrorBound, Position.T)), \n" ^
42.406 + "(0, [], false ,i_model_empty, (Sup AdditionalValues [], Position.T))]"
42.407 (*+*)then () else error "s_make_complete: i_from_met CHANGED";
42.408
42.409 val met_max_vnts = Model_Def.max_variants o_model i_from_met;
42.410 @@ -652,7 +652,7 @@
42.411
42.412 val max_vnt = hd met_max_vnts (*need only one for solve-phase*)
42.413 val met_from_pbl = map ((fn i_single as (_, _, _, _, (feedb, _)) =>
42.414 - if is_empty_single_POS i_single
42.415 + if is_empty_single i_single
42.416 then
42.417 case get_descr_vnt' feedb [max_vnt] o_model of
42.418 [] => raise ERROR (msg [max_vnt] feedb)
42.419 @@ -660,15 +660,15 @@
42.420 else [i_single (*fetched before from met_imod*)])) i_from_met |> flat
42.421
42.422 (*+*)val 1 = max_vnt;
42.423 -(*+*)if (met_from_pbl |> I_Model.to_string_POS @{context}) = "[\n" ^
42.424 - "(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n" ^
42.425 - "(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n" ^
42.426 - "(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.427 - "(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
42.428 - "(7, [1], true ,#undef, (Cor_POS FunctionVariable a , pen2str, Position.T)), \n" ^
42.429 - "(10, [1, 2], true ,#undef, (Cor_POS Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n" ^
42.430 - "(12, [1, 2, 3], true ,#undef, (Cor_POS ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n" ^
42.431 - "(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
42.432 +(*+*)if (met_from_pbl |> I_Model.to_string @{context}) = "[\n" ^
42.433 + "(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n" ^
42.434 + "(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n" ^
42.435 + "(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
42.436 + "(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
42.437 + "(7, [1], true ,#undef, (Cor FunctionVariable a , pen2str, Position.T)), \n" ^
42.438 + "(10, [1, 2], true ,#undef, (Cor Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n" ^
42.439 + "(12, [1, 2, 3], true ,#undef, (Cor ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n" ^
42.440 + "(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
42.441 (*+*)then () else error "s_make_complete: met_from_pbl CHANGED";
42.442
42.443 val return_s_make_complete_step as (pbl_imod_step, met_imod_step)=
42.444 @@ -679,10 +679,10 @@
42.445 then () else error "s_make_complete: stewise construction <> value of fun"
42.446 ;
42.447 (* final test ... ----------------------------------------------------------------------------*)
42.448 -val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
42.449 - = pbl_imod_step |> I_Model.to_string_POS @{context}
42.450 -val "[\n(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(7, [1], true ,#undef, (Cor_POS FunctionVariable a , pen2str, Position.T)), \n(10, [1, 2], true ,#undef, (Cor_POS Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n(12, [1, 2, 3], true ,#undef, (Cor_POS ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
42.451 - = met_imod_step |> I_Model.to_string_POS @{context};
42.452 +val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
42.453 + = pbl_imod_step |> I_Model.to_string @{context}
42.454 +val "[\n(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n(7, [1], true ,#undef, (Cor FunctionVariable a , pen2str, Position.T)), \n(10, [1, 2], true ,#undef, (Cor Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n(12, [1, 2, 3], true ,#undef, (Cor ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
42.455 + = met_imod_step |> I_Model.to_string @{context};
42.456
42.457
42.458
42.459 @@ -720,30 +720,30 @@
42.460 (*\\------------------ setup test data for item_to_add Maximum-exammple --------------------//*)
42.461
42.462 (** fun item_to_add: Constants [r = (7::real)] ============================================== **);
42.463 -val i_single : I_Model.single_POS =
42.464 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term Constants}, []) , Position.none)))
42.465 +val i_single : I_Model.single =
42.466 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term Constants}, []) , Position.none)))
42.467 val SOME ("#Given", "Constants [r = 7]") = item_to_add ctxt o_model_test [i_single];
42.468
42.469 (** fun item_to_add: Maximum A ============================================================== **);
42.470 -val i_single : I_Model.single_POS =
42.471 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term Maximum}, []) , Position.none)))
42.472 +val i_single : I_Model.single =
42.473 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term Maximum}, []) , Position.none)))
42.474 val SOME ("#Find", "Maximum A") = item_to_add ctxt o_model_test [i_single];
42.475
42.476 (** fun item_to_add: AdditionalValues [u] =================================================== **);
42.477 -val i_single : I_Model.single_POS =
42.478 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term AdditionalValues}, []) , Position.none)))
42.479 +val i_single : I_Model.single =
42.480 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term AdditionalValues}, []) , Position.none)))
42.481 val SOME ("#Find", "AdditionalValues [u]") = item_to_add ctxt o_model_test [i_single];
42.482
42.483 (** fun item_to_add: AdditionalValues [u, v] ================================================ **);
42.484 -val i_single : I_Model.single_POS =
42.485 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term AdditionalValues}, [@{term "[u::real]"}]) , Position.none)))
42.486 +val i_single : I_Model.single =
42.487 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term AdditionalValues}, [@{term "[u::real]"}]) , Position.none)))
42.488 (**)val SOME ("#Find", "AdditionalValues [u, v]") = item_to_add ctxt o_model_test [i_single];
42.489
42.490 (** fun item_to_add: AdditionalValues [v, u] ================================================ **);
42.491 (*/------------------- fun item_to_add: AdditionalValues [v, u] ----------------------------\\*)
42.492 -val i_single : I_Model.single_POS =
42.493 +val i_single : I_Model.single =
42.494 (*present [v, u] (reverse order), because second element has been input first ------vvvvvvvvvv*)
42.495 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term AdditionalValues}, [@{term "[v::real]"}]) , Position.none)))
42.496 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term AdditionalValues}, [@{term "[v::real]"}]) , Position.none)))
42.497
42.498 (**)val return_item_to_add as SOME ("#Find", "AdditionalValues [v, u]") = (**)
42.499 (** )val calling_code as SOME ("#Find", "AdditionalValues [v, u]") =( **)
42.500 @@ -754,12 +754,12 @@
42.501 (Model_Def.max_variants o_model i_model)
42.502 val o_vnts = filter (fn (_, vnts, _, _, _) => member op= vnts max_vnt) o_model
42.503 val i_to_select = i_model
42.504 - |> filter_out (fn (_, vnts, _, _, (I_Model.Cor_POS _, _)) => member op= vnts max_vnt | _ => false)
42.505 + |> filter_out (fn (_, vnts, _, _, (I_Model.Cor _, _)) => member op= vnts max_vnt | _ => false)
42.506 |> select_inc_lists
42.507 (*in*)
42.508 -(*+*)val "[\n(3, [1, 2, 3], false ,from o_model, (Inc_POS AdditionalValues [v] , pen2str, Position.T))]"
42.509 - = i_to_select |> I_Model.to_string_POS ctxt
42.510 -(*+*)val [(_, _, _, _, (Inc_POS (_, [Const ("List.list.Cons", _) $ Free ("v", _) $ _]), _))]
42.511 +(*+*)val "[\n(3, [1, 2, 3], false ,from o_model, (Inc AdditionalValues [v] , pen2str, Position.T))]"
42.512 + = i_to_select |> I_Model.to_string ctxt
42.513 +(*+*)val [(_, _, _, _, (Inc (_, [Const ("List.list.Cons", _) $ Free ("v", _) $ _]), _))]
42.514 = i_to_select
42.515
42.516 val false =
42.517 @@ -767,7 +767,7 @@
42.518
42.519 (** )val return_item_to_add =( **)
42.520 (**)val return_fill_from_o as
42.521 - SOME (_, _, _, _, (Cor_POS (Const ("Input_Descript.AdditionalValues", _), xxx), _)) =(**)
42.522 + SOME (_, _, _, _, (Cor (Const ("Input_Descript.AdditionalValues", _), xxx), _)) =(**)
42.523 (*I_Model.*)fill_from_o o_vnts (hd i_to_select) (*of*);
42.524 (*///----------------- step into fill_from_o -----------------------------------------------\\*)
42.525 "~~~~~ fun fill_from_o , args:"; val (o_model, (i, vnts, bool, _, (feedb, pos))) =
42.526 @@ -791,10 +791,10 @@
42.527 (*in*)
42.528 val true =
42.529 (*if*) length all_value = length ts
42.530 -val return_fill_from_o_STEP = SOME (i, vnts, bool, m_field, (Cor_POS (descr, [values_to_present ts]), pos))
42.531 +val return_fill_from_o_STEP = SOME (i, vnts, bool, m_field, (Cor (descr, [values_to_present ts]), pos))
42.532 (*\\\----------------- step into fill_from_o -----------------------------------------------//*)
42.533 val SOME (_, _, _, m_field, (feedb, _)) = return_fill_from_o
42.534 -(*+*)val Cor_POS (Const ("Input_Descript.AdditionalValues", _), xxx) = feedb;
42.535 +(*+*)val Cor (Const ("Input_Descript.AdditionalValues", _), xxx) = feedb;
42.536 (*+*)val xxx = xxx |> UnparseC.terms ctxt;
42.537
42.538 (*||------------------ contiue.. item_to_add -------------------------------------------------*)
42.539 @@ -802,7 +802,7 @@
42.540 SOME (m_field, feedb |>
42.541 (*I_Model.*)feedb_args_to_string ctxt);
42.542 (*///----------------- step into feedb_args_to_string --------------------------------------\\*)
42.543 -"~~~~~ fun feedb_args_to_string , args:"; val (ctxt, Cor_POS (descr, values)) = (ctxt, feedb);
42.544 +"~~~~~ fun feedb_args_to_string , args:"; val (ctxt, Cor (descr, values)) = (ctxt, feedb);
42.545 (** )val return_feedb_args_to_string =( **)
42.546 val return_feedb_args_to_string_STEP =
42.547 UnparseC.term ctxt (descr $ values_to_present values);
42.548 @@ -813,20 +813,20 @@
42.549
42.550
42.551 (** fun item_to_add: Constants Extremum (A = 2 * u * v - u \<up> 2) ============================= **);
42.552 -val i_single : I_Model.single_POS =
42.553 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term Extremum}, []) , Position.none)))
42.554 +val i_single : I_Model.single =
42.555 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term Extremum}, []) , Position.none)))
42.556 val SOME ("#Relate", "Extremum (A = 2 * u * v - u \<up> 2)")
42.557 = item_to_add ctxt o_model_test [i_single];
42.558
42.559 (** fun item_to_add: Constants SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] ============ **);
42.560 -val i_single : I_Model.single_POS =
42.561 -((3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term SideConditions}, []) , Position.none)))
42.562 +val i_single : I_Model.single =
42.563 +((3, [1, 2, 3], false, "from o_model", (Inc (@{term SideConditions}, []) , Position.none)))
42.564 val SOME ("#Relate", "SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]")
42.565 = item_to_add ctxt o_model_test [i_single];
42.566
42.567 (** fun item_to_add: Solutions L ============================================================ **);
42.568 -val i_single : I_Model.single_POS =
42.569 -(3, [1, 2, 3], false, "from o_model", (Inc_POS (@{term solutions}, []) , Position.none))
42.570 +val i_single : I_Model.single =
42.571 +(3, [1, 2, 3], false, "from o_model", (Inc (@{term solutions}, []) , Position.none))
42.572 val SOME ("#Find", "solutions L") = item_to_add ctxt o_model_test [i_single];
42.573
42.574
42.575 @@ -843,18 +843,18 @@
42.576 = make_values (descr, t)
42.577
42.578 val o_model_test : O_Model.T = [(0, [1], "#Given", descr, make_values (descr, t))]
42.579 -val i_model_test : I_Model.T_POS = [
42.580 - (0, [1], false, "get-from-o_model", (Inc_POS (descr, []) , Position.none))]
42.581 +val i_model_test : I_Model.T = [
42.582 + (0, [1], false, "get-from-o_model", (Inc (descr, []) , Position.none))]
42.583 val SOME ("#Given", "solveForVars [c]") = item_to_add ctxt o_model_test i_model_test;
42.584
42.585 (** fun item_to_add: solveForVars [c, c_2] ================================================== **);
42.586 -val i_model_test : I_Model.T_POS = [
42.587 - (0, [1], false, "get-from-o_model", (Inc_POS (descr,
42.588 +val i_model_test : I_Model.T = [
42.589 + (0, [1], false, "get-from-o_model", (Inc (descr,
42.590 [nth 1 (make_values (descr, t))]) , Position.none))]
42.591 val SOME ("#Given", "solveForVars [c, c_2]") = item_to_add ctxt o_model_test i_model_test;
42.592
42.593 (** fun item_to_add: solveForVars [c, c_2, c_3] ============================================= **);
42.594 -val i_model_test : I_Model.T_POS = [
42.595 - (0, [1], false, "get-from-o_model", (Inc_POS (descr,
42.596 +val i_model_test : I_Model.T = [
42.597 + (0, [1], false, "get-from-o_model", (Inc (descr,
42.598 (nth 1 (make_values (descr, t))) :: (nth 2 (make_values (descr, t))) :: []) , Position.none))]
42.599 val SOME ("#Given", "solveForVars [c, c_2, c_3]") = item_to_add ctxt o_model_test i_model_test;
43.1 --- a/test/Tools/isac/Specify/m-match.sml Mon Dec 11 16:18:42 2023 +0100
43.2 +++ b/test/Tools/isac/Specify/m-match.sml Mon Dec 11 17:26:30 2023 +0100
43.3 @@ -45,9 +45,9 @@
43.4 val is_complete as true = map (fn (_, (descr, _)) => contains_o descr o_model_vnt) model_patt
43.5 |> curry (foldl and_) true
43.6 val i_model = (*in order to match sig of Pre_Conds.check*)
43.7 - map (fn (a, b, c, d, e) => (a, b, true, c, (I_Model.Cor_POS (d, e), Position.none))) o_model_vnt
43.8 -(*+*)val "[\n(1, [1], true ,#Given, (Cor_POS equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor_POS solveFor x , pen2str, Position.T)), \n(3, [1], true ,#undef, (Cor_POS errorBound (eps = (0::'a)) , pen2str, Position.T)), \n(4, [1], true ,#Find, (Cor_POS solutions L , pen2str, Position.T))]"
43.9 - = i_model |> I_Model.to_string_POS ctxt
43.10 + map (fn (a, b, c, d, e) => (a, b, true, c, (I_Model.Cor (d, e), Position.none))) o_model_vnt
43.11 +(*+*)val "[\n(1, [1], true ,#Given, (Cor equality (sqrt (9 + 4 * x) = sqrt x + sqrt (5 + x)) , pen2str, Position.T)), \n(2, [1], true ,#Given, (Cor solveFor x , pen2str, Position.T)), \n(3, [1], true ,#undef, (Cor errorBound (eps = (0::'a)) , pen2str, Position.T)), \n(4, [1], true ,#Find, (Cor solutions L , pen2str, Position.T))]"
43.12 + = i_model |> I_Model.to_string ctxt
43.13
43.14 val (pre_conds_check, pre_conds) = Pre_Conds.check ctxt where_rls where_ (model_patt, i_model)
43.15 val return_data_by_o_STEP = (is_complete andalso pre_conds_check, (i_model, pre_conds))
44.1 --- a/test/Tools/isac/Specify/pre-conditions.sml Mon Dec 11 16:18:42 2023 +0100
44.2 +++ b/test/Tools/isac/Specify/pre-conditions.sml Mon Dec 11 17:26:30 2023 +0100
44.3 @@ -1,6 +1,6 @@
44.4 (* Title: "Specify/pre-conditions.sml"
44.5 Author: Walther Neuper
44.6 - (c) due to copyright terms
44.7 + (c) due to copyright terms
44.8 *)
44.9
44.10 "-----------------------------------------------------------------------------------------------";
44.11 @@ -29,22 +29,22 @@
44.12 val {origin = (o_model, o_ref, _), spec = spec_ref, probl, meth, ctxt, ...} =
44.13 CTbasic.get_obj I state [(*Pos will become variable*)] |> CTbasic.rep_specify_data
44.14 ;
44.15 -(*+*)if (probl |> I_Model.to_string_POS @{context}) = "[\n" ^
44.16 - "(1, [1, 2, 3], false ,#Given, (Inc_POS Constants [] [__=__, __=__], Position.T)), \n" ^
44.17 - "(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n" ^
44.18 - "(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n" ^
44.19 - "(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n" ^
44.20 - "(5, [1, 2], false ,#Relate, (Inc_POS SideConditions [] [__=__, __=__], Position.T))]"
44.21 +(*+*)if (probl |> I_Model.to_string @{context}) = "[\n" ^
44.22 + "(1, [1, 2, 3], false ,#Given, (Inc Constants [] [__=__, __=__], Position.T)), \n" ^
44.23 + "(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n" ^
44.24 + "(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n" ^
44.25 + "(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n" ^
44.26 + "(5, [1, 2], false ,#Relate, (Inc SideConditions [] [__=__, __=__], Position.T))]"
44.27 then () else error "probl FROM state CHANGED";
44.28
44.29 -(* probl_POS from above, #1 and #2 replaced by complete items, in order to evaluate to true*)
44.30 -val probl_POS =
44.31 +(* probl from above, #1 and #2 replaced by complete items, in order to evaluate to true*)
44.32 +val probl =
44.33 (1, [1,2,3], true, "#Given",
44.34 - (Cor_POS ((@{term "Constants"}, [@{term "[r = (7::real)]"(*should be "r = (7::real)"*)}])), Position.none )) ::
44.35 + (Cor ((@{term "Constants"}, [@{term "[r = (7::real)]"(*should be "r = (7::real)"*)}])), Position.none )) ::
44.36 nth 2 probl :: nth 3 probl :: nth 4 probl ::
44.37 (5, [1,2], true, "#Relate",
44.38 - (Cor_POS ((@{term "SideConditions"}, [@{term "[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]"}])), Position.none ))
44.39 - :: [] : I_Model.T_POS;
44.40 + (Cor ((@{term "SideConditions"}, [@{term "[(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2]"}])), Position.none ))
44.41 + :: [] : I_Model.T;
44.42 val probl_OLD = probl
44.43
44.44 val {model = model_patt, where_rls, where_ = where_OLD, ...} = (*from_store without Position.T-vv*)
44.45 @@ -60,34 +60,34 @@
44.46 val "[0 < fixes]" = (where_OLD |> UnparseC.terms @{context})
44.47
44.48 (*prepare check input with Position.T-------------------------------------------------------------*)
44.49 -val where_POS = [(@{term "0 < (r::real)"}, Position.none)];
44.50 +val where_ = [(@{term "0 < (r::real)"}, Position.none)];
44.51 (*\\------------------ test data setup -----------------------------------------------------//*)
44.52
44.53 (*//------------------ build new code (with Position.T) ------------------------------------\\*)
44.54 - Pre_Conds.check_pos ctxt where_rls where_POS (model_patt, probl);
44.55 -"~~~~~ fun check_pos , args:"; val (ctxt, where_rls, where_POS, (model_patt, i_model)) =
44.56 - (ctxt, where_rls, where_POS, (model_patt, probl_POS));
44.57 + Pre_Conds.check_pos ctxt where_rls where_ (model_patt, probl);
44.58 +"~~~~~ fun check_pos , args:"; val (ctxt, where_rls, where_, (model_patt, i_model)) =
44.59 + (ctxt, where_rls, where_, (model_patt, probl));
44.60
44.61 -(*+*)val [(prec, _)] = where_POS;
44.62 +(*+*)val [(prec, _)] = where_;
44.63 (*+*)val "0 < r" = prec |> UnparseC.term @{context} (* 1st substitution already done*)
44.64
44.65 -(*+*)val ((1, [1, 2, 3], false, "#Given", (Inc_POS _, _)) :: _) = probl
44.66 +(*+*)val (1, [1, 2, 3], true, "#Given", (Cor _, _)) :: _ = probl
44.67 (*+*)val 5 = length probl;
44.68 -(*!!!*)val ((1, [1, 2, 3], true, "#Given", (Cor_POS _, _)) :: _) = probl_POS
44.69 -(*!!!*)val 5 = length probl_POS; (*thus subst_atomic_all \<longrightarrow> false, replaces for test -------vvvv*)
44.70 +(*!!!*)val ((1, [1, 2, 3], true, "#Given", (Cor _, _)) :: _) = probl
44.71 +(*!!!*)val 5 = length probl; (*thus subst_atomic_all \<longrightarrow> false, replaces for test -------vvvv*)
44.72
44.73
44.74 val (env_model, (env_subst, env_eval)) = make_environments model_patt
44.75 ((*filter (fn (_, _, _, m_field ,_) => m_field = "#Given")*) i_model)
44.76 ;
44.77 -(*+*)(probl_POS |> I_Model.to_string_POS @{context}) = "[\n" ^
44.78 - "(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n" ^
44.79 +(*+*)(probl |> I_Model.to_string @{context}) = "[\n" ^
44.80 + "(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n" ^
44.81 (*--------------------------------------------------^^^^^^^--- FROM test data setup -----------*)
44.82 - "(2, [1, 2, 3], false ,#Find, (Inc_POS Maximum __, Position.T)), \n" ^
44.83 - "(3, [1, 2, 3], false ,#Find, (Inc_POS AdditionalValues [] [__, __], Position.T)), \n" ^
44.84 - "(4, [1, 2, 3], false ,#Relate, (Inc_POS Extremum (__=__), Position.T)), \n" ^
44.85 + "(2, [1, 2, 3], false ,#Find, (Inc Maximum __, Position.T)), \n" ^
44.86 + "(3, [1, 2, 3], false ,#Find, (Inc AdditionalValues [] [__, __], Position.T)), \n" ^
44.87 + "(4, [1, 2, 3], false ,#Relate, (Inc Extremum (__=__), Position.T)), \n" ^
44.88 (*------------------------------------------------------vvvvvvv--- FROM test data setup -------*)
44.89 - "(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
44.90 + "(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T))]"
44.91 ;
44.92 (*+*)val "[\"\n(fixes, [r = 7])\", \"\n(sideconds, [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2])\"]"
44.93 = env_model |> Subst.to_string ctxt
44.94 @@ -95,8 +95,8 @@
44.95 (*+*)val "[\"\n(r, 7)\"]" = env_eval |> Subst.to_string @{context}
44.96
44.97 val full_subst = if env_eval = []
44.98 - then map (fn (t, pos) => ((true, t), pos)) where_POS
44.99 - else map (fn (t, pos) => (TermC.subst_atomic_all env_eval t, pos)) where_POS;
44.100 + then map (fn (t, pos) => ((true, t), pos)) where_
44.101 + else map (fn (t, pos) => (TermC.subst_atomic_all env_eval t, pos)) where_;
44.102
44.103 (*+*)val [((true, precond), pos)] = full_subst;
44.104 (*+*)val "0 < 7" = precond |> UnparseC.term @{context}
44.105 @@ -108,7 +108,7 @@
44.106 (*+*)val [((true, precond), pos)] = evals
44.107 (*+*)val "0 < 7" = precond |> UnparseC.term @{context}
44.108
44.109 - val display = map (fn ((t, pos), ((bool, _), _)) => (bool, (t, pos))) (where_POS ~~ evals)
44.110 + val display = map (fn ((t, pos), ((bool, _), _)) => (bool, (t, pos))) (where_ ~~ evals)
44.111 (*
44.112 NOTE ON IMPROVEMENT: one could do all subst + eval without Position.T and by ------ ^^^
44.113 finally pair with bool (! the sequence of list items is NOT changed)
45.1 --- a/test/Tools/isac/Specify/refine.sml Mon Dec 11 16:18:42 2023 +0100
45.2 +++ b/test/Tools/isac/Specify/refine.sml Mon Dec 11 17:26:30 2023 +0100
45.3 @@ -388,7 +388,7 @@
45.4 |> map (fn (_, (descr, _)) => contains_o descr o_model_vnt)
45.5 |> curry (foldl and_) true
45.6 val i_model = (*in order to match sig of Pre_Conds.check*)
45.7 - map (fn (a, b, c, d, e) => (a, b, true, c, (I_Model.Cor_POS (d, e), Position.none))) o_model_vnt
45.8 + map (fn (a, b, c, d, e) => (a, b, true, c, (I_Model.Cor (d, e), Position.none))) o_model_vnt
45.9
45.10
45.11 val (pb as true, (** )_( **)where_'(**)) =
45.12 @@ -412,7 +412,7 @@
45.13 make_envs_preconds equal_givens;
45.14 "~~~~~ fun make_envs_preconds , args:"; val (equal_givens) = (equal_givens);
45.15 "~~~~~ fun xxx , args:"; val ((_, (_, id)), (_, _, _, _, (feedb, _))) = (nth 1 equal_givens);
45.16 -"~~~~~ fun discern_feedback , args:"; val (id, (Model_Def.Cor_POS ((descr, ts)))) =
45.17 +"~~~~~ fun discern_feedback , args:"; val (id, (Model_Def.Cor ((descr, ts)))) =
45.18 (id, feedb);
45.19
45.20 val return_discern_typ as [] =
46.1 --- a/test/Tools/isac/Specify/specify.sml Mon Dec 11 16:18:42 2023 +0100
46.2 +++ b/test/Tools/isac/Specify/specify.sml Mon Dec 11 17:26:30 2023 +0100
46.3 @@ -128,7 +128,7 @@
46.4 | _ => raise ERROR "LI.by_tactic: no PblObj"
46.5 val (_, pbl_id', met_id') = References.select_input o_refs spec
46.6 val (pbl_imod, met_imod) = I_Model.s_make_complete ctxt oris
46.7 - (I_Model.OLD_to_POS probl, I_Model.OLD_to_POS itms) (pbl_id', met_id')
46.8 + (I_Model.OLD_to probl, I_Model.OLD_to itms) (pbl_id', met_id')
46.9 ;
46.10 (*-------------------- stop step into do_all -------------------------------------------------*)
46.11 (*/------------------- check result of I_Model.complete' ------------------------------------\*)
46.12 @@ -142,15 +142,15 @@
46.13 "(#Given, (ErrorBound, err))\", \"" ^
46.14 "(#Find, (AdditionalValues, vals))\"]"
46.15 (*+*)then () else error "mod_pat CHANGED";
46.16 -(*+*)if I_Model.to_string_POS @{context} met_imod = "[\n" ^
46.17 - "(1, [1, 2, 3], true ,#Given, (Cor_POS Constants [r = 7] , pen2str, Position.T)), \n" ^
46.18 - "(2, [1, 2, 3], true ,#Find, (Cor_POS Maximum A , pen2str, Position.T)), \n" ^
46.19 - "(4, [1, 2, 3], true ,#Relate, (Cor_POS Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
46.20 - "(5, [1, 2], true ,#Relate, (Cor_POS SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
46.21 - "(7, [1], true ,#undef, (Cor_POS FunctionVariable a , pen2str, Position.T)), \n" ^
46.22 - "(10, [1, 2], true ,#undef, (Cor_POS Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n" ^
46.23 - "(12, [1, 2, 3], true ,#undef, (Cor_POS ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n" ^
46.24 - "(3, [1, 2, 3], true ,#Find, (Cor_POS AdditionalValues [u, v] , pen2str, Position.T))]"
46.25 +(*+*)if I_Model.to_string @{context} met_imod = "[\n" ^
46.26 + "(1, [1, 2, 3], true ,#Given, (Cor Constants [r = 7] , pen2str, Position.T)), \n" ^
46.27 + "(2, [1, 2, 3], true ,#Find, (Cor Maximum A , pen2str, Position.T)), \n" ^
46.28 + "(4, [1, 2, 3], true ,#Relate, (Cor Extremum (A = 2 * u * v - u \<up> 2) , pen2str, Position.T)), \n" ^
46.29 + "(5, [1, 2], true ,#Relate, (Cor SideConditions [(u / 2) \<up> 2 + (2 / v) \<up> 2 = r \<up> 2] , pen2str, Position.T)), \n" ^
46.30 + "(7, [1], true ,#undef, (Cor FunctionVariable a , pen2str, Position.T)), \n" ^
46.31 + "(10, [1, 2], true ,#undef, (Cor Input_Descript.Domain {0<..<r} , pen2str, Position.T)), \n" ^
46.32 + "(12, [1, 2, 3], true ,#undef, (Cor ErrorBound (\<epsilon> = 0) , pen2str, Position.T)), \n" ^
46.33 + "(3, [1, 2, 3], true ,#Find, (Cor AdditionalValues [u, v] , pen2str, Position.T))]"
46.34 (*+*)then () else error "met_imod CHANGED";
46.35 (*\------------------- check result of I_Model.complete' ------------------------------------/*)
46.36 (*\\------------------ step into do_all ----------------------------------------------------//*)
46.37 @@ -472,7 +472,7 @@
46.38 (oris, (o_refs, refs), (pbl, met));
46.39 val cmI = if mI = MethodC.id_empty then mI' else mI;
46.40 val {model = mpc, where_rls, where_, ...} = MethodC.from_store ctxt cmI;
46.41 - val (preok, _) = Pre_Conds.check ctxt where_rls where_ (mpc, I_Model.OLD_to_POS met);
46.42 + val (preok, _) = Pre_Conds.check ctxt where_rls where_ (mpc, I_Model.OLD_to met);
46.43 "~~~~~ from fun find_next_step \<longrightarrow>fun specify_do_next , return:"; val (_, (p_', tac)) = (return);
46.44 (*/------------------- check within find_next_step -----------------------------------------\*)
46.45 (*+*)Model_Pattern.to_string @{context} (MethodC.from_store ctxt mI' |> #model) = "[\"" ^
46.46 @@ -775,7 +775,7 @@
46.47 "(3, [\"1\"], #Find, Funktionen, [\"funs'''\"]), \n" ^
46.48 "(4, [\"1\"], #Find, Biegelinie, [\"y\"]), \n" ^
46.49 "(5, [\"1\"], #Given, AbleitungBiegelinie, [\"dy\"])]";
46.50 -(*+*)val (true, []) = Pre_Conds.check_internal ctxt (I_Model.OLD_to_POS pbl) (Pos.Met, mI');
46.51 +(*+*)val (true, []) = Pre_Conds.check_internal ctxt (I_Model.OLD_to pbl) (Pos.Met, mI');
46.52 (*+*)I_Model.to_string @{context} met = "[\n" ^
46.53 "(1 ,[1] ,true ,#Given ,Cor Streckenlast q_0 ,(q_q, [q_0])), \n" ^
46.54 "(2 ,[1] ,true ,#Given ,Cor FunktionsVariable x ,(v_v, [x])), \n" ^