src/Tools/isac/Build_Isac.thy
author Walther Neuper <neuper@ist.tugraz.at>
Sun, 15 Jun 2014 18:39:59 +0200
changeset 55449 b218049a9b4e
parent 55447 aafc20218dac
parent 55448 dd65e9fe85a7
child 55450 a7c61c0bd437
permissions -rw-r--r--
merged
     1 (*  Title:  build and test isac on Isabelle2013
     2     Author: Walther Neuper, TU Graz, 100808
     3    (c) due to copyright terms
     4 
     5 For creating a heap image of isac see ~~/ROOT.
     6 
     7 ATTENTION: no errors in this theory do not mean that there are no errors in Isac;
     8 errors are rigorously detected when creating a heap.
     9 *)
    10 
    11 header {* Loading the isac mathengine;
    12   for debugging see text at begin (theory dependencies!) *}
    13 
    14 theory Build_Isac 
    15 imports Complex_Main
    16 (* use    "library.sml"
    17    use    "calcelems.sml"
    18 
    19    use    "ProgLang/termC.sml"
    20    use    "ProgLang/calculate.sml"
    21    use    "ProgLang/rewrite.sml"
    22   "use_thy ProgLang/ListC"
    23   "use_thy ProgLang/Tools"                                                 
    24   "use_thy ProgLang/Script"
    25    use    "ProgLang/scrtools.sml"
    26 *)        "ProgLang/ProgLang"
    27 
    28 (* use    "Interpret/mstools.sml"
    29    use    "Interpret/ctree.sml"
    30    use    "Interpret/ptyps.sml"
    31    use    "Interpret/generate.sml"
    32    use    "Interpret/calchead.sml"
    33    use    "Interpret/appl.sml"
    34    use    "Interpret/rewtools.sml"
    35    use    "Interpret/script.sml"
    36    use    "Interpret/solve.sml"
    37    use    "Interpret/inform.sml"
    38    use    "Interpret/mathengine.sml"
    39 *)        "Interpret/Interpret"
    40 
    41 (* use    "xmlsrc/mathml.sml"
    42    use    "xmlsrc/datatypes.sml"
    43    use    "xmlsrc/pbl-met-hierarchy.sml"
    44    use    "xmlsrc/thy-hierarchy.sml"                               
    45    use    "xmlsrc/interface-xml.sml"
    46 *)        "xmlsrc/xmlsrc"
    47 
    48 (* use     "Frontend/messages.sml"
    49    use     "Frontend/states.sml"
    50    use     "Frontend/interface.sml"
    51 
    52    use     "print_exn_G.sml"
    53 *)         "Frontend/Frontend"
    54 
    55            "Knowledge/Build_Thydata" (*imports Isac.thy etc*)
    56 
    57 begin
    58 
    59 text {* 
    60   show theory dependencies using the graph browser, 
    61   open "browser_info/HOL/Isac/session.graph"
    62   and proceed from the ancestors towards the siblings.
    63 *}
    64 
    65 section {*check presence of definitions from directories*}
    66 
    67 ML {* is_reall_dsc; (*from "ProgLang/scrtools.sml" *) *}
    68 ML {* me; (*from "Interpret/mathengine.sml"*) *}
    69 ML {* contextthyOK2xml; (*"xmlsrc/interface-xml.sml"*) *}
    70 ML {* print_exn_unit *}
    71 ML {* list_rls (*from Atools.thy WN130615??? or ProgLang???*) *}
    72 
    73 ML {* eval_occurs_in (*from Atools.thy*) *}
    74 ML {* @{thm last_thmI} (*from Atools.thy*) *}
    75 ML {*@{thm Querkraft_Belastung}*}
    76 
    77 ML {* check_guhs_unique := false; *}
    78 ML {* writeln "**** isac kernel = math-engine + Knowledge complete ******" *}
    79 ML {* @{theory "Isac"} *}
    80 ML {* CHECK_FILLPATS "at end of Build_Isac";
    81 (*"CHECK_FILLPATS: diff_sin_chain exists, fillpat --> NOT empty !!!"*)*}
    82 
    83 section {* State of approaching Isabelle by Isac *}
    84 text {* 
    85   Mathias Lehnfeld gives the following list in his thesis in section 
    86   4.2.3 Relation to Ongoing Isabelle Development.
    87 *}
    88 subsection {* (0) Survey on remaining Unsynchronized.ref *}
    89 text {*
    90   REMOVE WITHOUT REPLACEMENT (requires some efforts)
    91     calcelems.sml:val theory'  = Unsynchronized.ref ([]:(theory' * theory) list);
    92     calcelems.sml:val isab_thm_thy = Unsynchronized.ref ([] : (thmDeriv * term) list);
    93     calcelems.sml:val isabthys = Unsynchronized.ref ([] : theory list);
    94   REPLACE BY KEStore... (has been overlooked)
    95     calcelems.sml:val rew_ord' = Unsynchronized.ref ...
    96   KEEP FOR TRACING
    97     calcelems.sml:val trace_rewrite = Unsynchronized.ref false;
    98     calcelems.sml:val depth = Unsynchronized.ref 99999;
    99     calcelems.sml:val lim_rewrite = Unsynchronized.ref 99999;
   100     calcelems.sml:val lim_deriv = Unsynchronized.ref 100;
   101     Interpret/script.sml:val trace_script = Unsynchronized.ref false;
   102   KEEP FOR EASIER DEVELOPMENT
   103     calcelems.sml:val check_guhs_unique = Unsynchronized.ref true;
   104   KEEP FOR DEMOS
   105     Knowledge/GCD_Poly_ML.thy:  val trace_div = Unsynchronized.ref true;
   106     Knowledge/GCD_Poly_ML.thy:  val trace_div_invariant = Unsynchronized.ref false;
   107     Knowledge/GCD_Poly_ML.thy:  val trace_Euclid = Unsynchronized.ref true;
   108 *}
   109 subsection {* (1) Exploit parallelism for concurrent session management *}
   110 subsection {* (2) Make Isac’s programming language usable *}
   111 subsection {* (3) Adopt Isabelle’s numeral computation for Isac *}
   112 text {* 
   113   In 2002 isac already strived for floating point numbers. Since that time
   114   isac represents numerals as "Free", see below (*1*). These experiments are
   115   unsatisfactory with respect to logical soundness.
   116   Since Isabelle now has started to care about floating point numbers, it is high 
   117   time to adopt these together with the other numerals. Isabelle2012/13's numerals
   118   are different from Isabelle2011, see "test/Tools/isac/ProgLang/termC.sml".
   119   
   120   The transition from "Free" to standard numerals is a task to be scheduled for 
   121   several weeks. The urgency of this task follows from the experience, 
   122   that (1.2) for "thehier" is very hard, because "num_str" seems to destroy 
   123   some of the long identifiers of theorems which would tremendously simplify
   124   building a hierarchy of theorems according to (1.2), see (*2*) below.
   125 *}
   126 ML {*(*1*) Free ("123.456", HOLogic.realT) *}
   127 ML {*(*2*)
   128 val unknown = filter ((curry op= "??.unknown") o fst) isacrlsthms';
   129 unknown |> nth 1 |> snd |> term_to_string''' @{theory};
   130 unknown |> nth 2 |> snd |> term_to_string''' @{theory};
   131 (*but these seem ok:*)
   132   Thm.get_name_hint @{thm add_0};
   133   Thm.get_name_hint (num_str @{thm add_0});
   134 *}
   135 subsection {* (4) Improve the efficiency of Isac’s rewrite-engine *}
   136 subsection {* (5) Adopt Isabelle/jEdit for Isac *}
   137 
   138 end