src/Tools/isac/Knowledge/Simplify.thy
author wneuper <Walther.Neuper@jku.at>
Wed, 19 Oct 2022 10:43:04 +0200
changeset 60567 bb3140a02f3d
parent 60449 2406d378cede
child 60586 007ef64dbb08
permissions -rw-r--r--
eliminate term2str in src, Prog_Tac.*_adapt_to_type
     1 (* simplification of terms
     2    author: Walther Neuper 050912
     3    (c) due to copyright terms
     4 *)
     5 
     6 theory Simplify imports Base_Tools begin
     7 
     8 consts
     9 
    10   (*descriptions in the related problem*)
    11   Term        :: "real => una"   (*"term" is a keyword in *.thy*)
    12   normalform  :: "real => una"
    13 
    14   (*the CAS-command*)
    15   Simplify    :: "real => real"  (*"Simplify (1+2a+3+4a)*)
    16   Vereinfache :: "real => real"  (*"Vereinfache (1+2a+3+4a)*)
    17 
    18 (** problems **)
    19 
    20 problem pbl_simp : "simplification" =
    21   \<open>Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)]\<close>
    22   CAS: "Simplify t_t"
    23   Given: "Term t_t"
    24   Find: "normalform n_n"
    25 
    26 problem pbl_vereinfache : "vereinfachen" =
    27   \<open>Rule_Set.append_rules "empty" Rule_Set.empty [(*for preds in where_*)]\<close>
    28   CAS: "Vereinfache t_t"
    29   Given: "Term t_t"
    30   Find: "normalform n_n"
    31 
    32 (** methods **)
    33 
    34 method met_tsimp : "simplification" =
    35   \<open>{rew_ord'="tless_true", rls'= Rule_Set.empty, calc = [], srls = Rule_Set.empty, prls=Rule_Set.empty, crls = Rule_Set.empty,
    36     errpats = [], nrls = Rule_Set.empty}\<close>
    37   Given: "Term t_t"
    38   Find: "normalform n_n"
    39 
    40 ML \<open>
    41 
    42 (** CAS-command **)
    43 
    44 (*.function for handling the cas-input "Simplify (2*a + 3*a)":
    45    make a model which is already in ctree-internal format.*)
    46 (* val (h,argl) = strip_comb (TermC.parse_test @{context} "Simplify (2*a + 3*a)");
    47    val (h,argl) = strip_comb ((Thm.term_of o the o (parse (Thy_Info_get_theory "Simplify"))) 
    48 				  "Simplify (2*a + 3*a)");
    49    *)
    50 fun argl2dtss t =
    51     [((TermC.parseNEW''\<^theory>) "Term", t),
    52      ((TermC.parseNEW''\<^theory>) "normalform", 
    53      [(TermC.parseNEW''\<^theory>) "N"])
    54      ]
    55   (*| argl2dtss _ = raise ERROR "Simplify.ML: wrong argument for argl2dtss"*);
    56 \<close>
    57 cas Simplify = \<open>argl2dtss\<close>
    58   Problem_Ref: "simplification"
    59 cas Vereinfache = \<open>argl2dtss\<close>
    60   Problem_Ref: "vereinfachen"
    61 
    62 ML \<open>
    63 \<close> ML \<open>
    64 \<close> ML \<open>
    65 \<close>
    66 end