src/Tools/isac/Interpret/Interpret.thy
author wneuper <Walther.Neuper@jku.at>
Wed, 19 Oct 2022 10:43:04 +0200
changeset 60567 bb3140a02f3d
parent 60545 30b1475b2295
child 60569 f5454fd2e013
permissions -rw-r--r--
eliminate term2str in src, Prog_Tac.*_adapt_to_type
     1 (* Title:  Interpret/Interpret.thy
     2    Author: Walther Neuper 110226
     3    (c) due to copyright terms
     4 
     5 Collect all defitions for the Lucas-Interpreter
     6 *)
     7 
     8 theory Interpret
     9 imports Specify.Specify
    10 begin
    11   ML_file istate.sml
    12   ML_file "sub-problem.sml"
    13   ML_file "thy-read.sml"
    14   ML_file "li-tool.sml"
    15   ML_file "solve-step.sml"
    16   ML_file "error-pattern.sml"
    17   ML_file derive.sml
    18   ML_file "lucas-interpreter.sml"
    19   ML_file "step-solve.sml"
    20 
    21 ML \<open>
    22 local
    23   val thys_known_sofar = Theory.nodes_of @{theory}
    24   val isac_thys_known_sofar = take (
    25     find_index (curry Context.eq_thy ThyC.last_isabelle_thy) thys_known_sofar,
    26     thys_known_sofar)
    27   val isac_names_known_sofar = map Context.theory_name isac_thys_known_sofar
    28 in
    29   val compare_dependencies__ThyC =
    30     if isac_names_known_sofar = ThyC.session_interpret_names @ ThyC.session_specify_names then ()
    31     else raise ERROR "theory dependencies not as anticipated in ThyC"
    32 end
    33 \<close> ML \<open>
    34 \<close> ML \<open>
    35 \<close> ML \<open>
    36 fun tac_from_prog _ thy (Const (\<^const_name>\<open>Prog_Tac.Rewrite_Inst\<close>, _) $ sub $ thmID $ _) =
    37     let
    38       val tid = HOLogic.dest_string thmID
    39       val sub' = (**)Subst.program_to_input(** )Prog_Tac.Rewrite_Inst_adapt_to_type thy( **) sub
    40     in (Tactic.Rewrite_Inst (sub', (tid, ThmC.thm_from_thy thy tid))) end
    41   | tac_from_prog _ _ (Const (\<^const_name>\<open>Prog_Tac.Rewrite_Set\<close>,_) $ rls $ _) =
    42      (Tactic.Rewrite_Set (HOLogic.dest_string rls))
    43   | tac_from_prog _ thy (Const (\<^const_name>\<open>Prog_Tac.Rewrite_Set_Inst\<close>, _) $ sub $ rls $ _) =
    44     let
    45       val sub' = (**)Subst.program_to_input(** )Prog_Tac.Rewrite_Inst_adapt_to_type thy( **) sub
    46     in (Tactic.Rewrite_Set_Inst (sub', HOLogic.dest_string rls)) end
    47 \<close> ML \<open>
    48 \<close> ML \<open>
    49 \<close> ML \<open>
    50 \<close>
    51 end