src/Tools/isac/MathEngBasic/MathEngBasic.thy
author wneuper <Walther.Neuper@jku.at>
Wed, 07 Sep 2022 10:58:12 +0200
changeset 60543 9555ee96e046
parent 60518 a4d8e2874627
child 60544 794948e61b46
permissions -rw-r--r--
eliminate KEStore_Elems.get_thes, add_thes 1: get_rls 1
walther@59894
     1
(* Title:  "MathEngBasic/MathEngBasic.thy"
walther@59674
     2
   Author: Walther Neuper 110226
walther@59674
     3
   (c) due to copyright terms
walther@59674
     4
walther@60366
     5
Definitions required for both, for Specify and for the Lucas-Interpreter.
walther@60366
     6
walther@60367
     7
Note (compare \<^ML>\<open>@{theory Know_Store}\<close> cf.03dea0a179d0):
walther@60366
     8
The files ("xxxxx-def.sml") contain definitions required for ML_structure\<open>Ctree\<close>;
walther@60366
     9
they also include minimal code required for other "xxxxx-def.sml" files.
walther@60366
    10
These files have companion files "xxxxx.sml" with all further code,
walther@60366
    11
located at appropriate positions in the file structure.
walther@60366
    12
walther@60366
    13
The separation of "xxxxx-def.sml" from "xxxxx.sml" should be overcome by
walther@60366
    14
appropriate use of polymorphic high order functions.
walther@59894
    15
*)
walther@59674
    16
theory MathEngBasic
wenzelm@60303
    17
  imports "$ISABELLE_ISAC/ProgLang/ProgLang" "$ISABELLE_ISAC/Specify/Input_Descript"
wenzelm@60306
    18
  keywords "problem" "method" :: thy_decl
Walther@60449
    19
    and "Author" "Theory_Ref" "Problem_Ref" "Method_Ref" 
Walther@60449
    20
    "CAS" "Program" "Given" "Where" "Find" "Relate"
walther@59674
    21
begin
walther@59865
    22
  ML_file thmC.sml
walther@59894
    23
  ML_file problem.sml
walther@59894
    24
  ML_file method.sml
walther@59894
    25
walther@59899
    26
  ML_file rewrite.sml
walther@59941
    27
walther@59952
    28
  ML_file "model-def.sml"
walther@59937
    29
  ML_file "istate-def.sml"
walther@59674
    30
  ML_file "calc-tree-elem.sml"
walther@59963
    31
  ML_file "pre-conds-def.sml"
walther@59937
    32
Walther@60449
    33
  ML_file tactic.sml                                     
walther@59920
    34
  ML_file applicable.sml
walther@59920
    35
walther@59693
    36
  ML_file position.sml
walther@59977
    37
  ML_file "specification-def.sml"
walther@59977
    38
walther@59674
    39
  ML_file "ctree-basic.sml"
walther@59674
    40
  ML_file "ctree-access.sml"
walther@59674
    41
  ML_file "ctree-navi.sml"
walther@59674
    42
  ML_file ctree.sml
walther@59937
    43
walther@59985
    44
  ML_file references.sml
walther@59908
    45
  ML_file "state-steps.sml"
walther@59773
    46
  ML_file calculation.sml
walther@59674
    47
walther@59674
    48
ML \<open>
walther@59737
    49
\<close> ML \<open>
Walther@60543
    50
fun lev_up [] = raise Ctree.PTREE "lev_up []"
Walther@60543
    51
  | lev_up p = (drop_last p);
Walther@60543
    52
\<close> ML \<open>
Walther@60543
    53
\<close> ML \<open>
Walther@60543
    54
open Ctree
Walther@60543
    55
\<close> ML \<open> (*postpone after successful test*)
Walther@60543
    56
fun parent_node _ [] = (true, [], Rule_Set.Empty)
Walther@60543
    57
  | parent_node pt p =
Walther@60543
    58
    let
Walther@60543
    59
      fun par _ [] = (true, [], Rule_Set.Empty)
Walther@60543
    60
        | par pt p =
Walther@60543
    61
            if is_pblobj (get_obj I pt p)
Walther@60543
    62
            then (true, p, Rule_Set.Empty)
Walther@60543
    63
  		      else 
Walther@60543
    64
              let
Walther@60543
    65
                val ctxt = p |> get_obj g_loc pt |> snd |> the |> snd (*???*)
Walther@60543
    66
              in
Walther@60543
    67
                case get_obj g_tac pt p of
Walther@60543
    68
      				    Tactic.Rewrite_Set rls' => (false, p, get_rls ctxt rls')
Walther@60543
    69
      			    | Tactic.Rewrite_Set_Inst (_, rls') => (false, p, get_rls ctxt rls')
Walther@60543
    70
      			    | _ => par pt (lev_up p)
Walther@60543
    71
              end
Walther@60543
    72
    in par pt (lev_up p) end; 
Walther@60432
    73
\<close> ML \<open>
Walther@60432
    74
\<close>
walther@59674
    75
end