src/Tools/isac/Build_Isac.thy
author Walther Neuper <walther.neuper@jku.at>
Mon, 24 Feb 2020 17:51:26 +0100
changeset 59814 665dd868d4e2
parent 59801 17d807bf28fb
child 59833 9331e61f55dd
permissions -rw-r--r--
prep.: add test-code and test, cleanup
     1 (*  Title:  build the Isac-Kernel: MathEngine & Knowledge
     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 For debugging see text at begin below, e.g. theory dependencies:
     7   ~$ evince file:///home/wneuper/.isabelle/isabisac/browser_info/Unsorted/Isac/session_graph.pdf &
     8 
     9 ATTENTION: no errors in this theory do not mean that there are no errors in Isac ..
    10 .. open theories collecting files from folders: CalcElements.thy, ProgLang.thy etc.
    11 Errors are rigorously detected by isabelle build.
    12 *)
    13 
    14 theory Build_Isac 
    15 imports
    16 (*  theory KEStore imports Complex_Main
    17       ML_file libraryC.sml
    18       ML_file rule.sml
    19       ML_file calcelems.sml
    20   theory CalcElements imports KEStore
    21     ML_file termC.sml
    22     ML_file contextC.sml
    23     ML_file environment.sml
    24 *)        "CalcElements/CalcElements"
    25 
    26 (*    theory Calculate imports "~~/src/Tools/isac/CalcElements/CalcElements"
    27         ML_file calculate.sml
    28 
    29       theory ListC imports "~~/src/Tools/isac/CalcElements/CalcElements"
    30     theory Prog_Expr imports Calculate ListC
    31       theory Program imports "~~/src/Tools/isac/CalcElements/CalcElements"
    32       theory Prog_Tac imports "~~/src/Tools/isac/CalcElements/CalcElements"
    33       theory Tactical imports "~~/src/Tools/isac/CalcElements/CalcElements"
    34     theory Auto_Prog imports Program Prog_Tac Tactical begin
    35   theory ProgLang imports Prog_Expr Auto_Prog
    36     ML_file rewrite.sml
    37 *)        "ProgLang/ProgLang"
    38 (*
    39   theory MathEngBasic imports
    40     "~~/src/Tools/isac/ProgLang/ProgLang" "~~/src/Tools/isac/Specify/Input_Descript"
    41     ML_file "calc-tree-elem.sml"
    42     ML_file model.sml
    43     ML_file mstools.sml
    44     ML_file "specification-elems.sml"
    45     ML_file "istate-def.sml"
    46     ML_file tactic.sml
    47     ML_file position.sml
    48     ML_file "ctree-basic.sml"
    49     ML_file "ctree-access.sml"
    50     ML_file "ctree-navi.sml"
    51     ML_file ctree.sml
    52   (*ML_file tactic.sml*)
    53     ML_file calculation.sml
    54 *)        "MathEngBasic/MathEngBasic"
    55 (*
    56     theory Input_Descript imports "~~/src/Tools/isac/CalcElements/CalcElements"
    57   theory Specify imports "~~/src/Tools/isac/ProgLang/ProgLang" Input_Descript
    58     ML_file ptyps.sml
    59     ML_file generate.sml
    60     ML_file calchead.sml
    61     ML_file appl.sml
    62     ML_file "step-specify.sml"
    63     ML_file specify.sml
    64 *)        "Specify/Specify"
    65 (*
    66   theory Interpret imports "~~/src/Tools/isac/Specify/Specify"
    67     ML_file istate.sml
    68     ML_file rewtools.sml
    69     ML_file "li-tool.sml"
    70     ML_file inform.sml
    71     ML_file "lucas-interpreter.sml"
    72     ML_file "step-solve.sml"
    73 *)        "Interpret/Interpret"
    74 (*
    75   theory MathEngine imports "~~/src/Tools/isac/Interpret/Interpret"
    76     ML_file solve.sml
    77     ML_file step.sml
    78     ML_file "mathengine-stateless.sml"
    79     ML_file messages.sml
    80     ML_file states.sml
    81 *)        "MathEngine/MathEngine"
    82 (*
    83   theory Test_Code imports "~~/src/Tools/isac/MathEngine/MathEngine"
    84     ML_file "test-code.sml"
    85 *)        "Test_Code/Test_Code"
    86 (*
    87   theory BridgeLibisabelle imports "~~/src/Tools/isac/MathEngine/MathEngine"
    88     ML_file mathml.sml
    89     ML_file datatypes.sml
    90     ML_file "pbl-met-hierarchy.sml"
    91     ML_file "thy-hierarchy.sml" 
    92     ML_file "interface-xml.sml"
    93     ML_file interface.sml
    94 *)        "BridgeLibisabelle/BridgeLibisabelle"
    95 
    96           "Knowledge/Build_Thydata" (*imports Isac.thy etc*)
    97 
    98 (*//-----------------------------------------------------------------------------------------\\*)
    99 (*\\-----------------------------------------------------------------------------------------//*)
   100 begin
   101 
   102 text \<open>
   103   show theory dependencies using the graph browser, 
   104   open "browser_info/HOL/Isac/session.graph"
   105   and proceed from the ancestors towards the siblings.
   106 \<close>
   107 
   108 section \<open>check presence of definitions from directories\<close>
   109 
   110 (*declare [[ML_print_depth = 999]]*)
   111 ML \<open>
   112 \<close> ML \<open>
   113 parseNEW @{context} "xxx #> aaa bbb"
   114 \<close> ML \<open>
   115 #> : ('a -> 'b) * ('b -> 'c) -> 'a -> 'c
   116 \<close> ML \<open>
   117 \<close>
   118 ML \<open>Num_Calc.adhoc_thm; (*from "ProgLang/calculate.sml" *)\<close>
   119 ML \<open>Rewrite.rewrite_; (*from "ProgLang/rewrite.sml" *)\<close>
   120 ML \<open>Input_Descript.is_reall_dsc; (*from "ProgLang/scrtools.sml" *)\<close>
   121 ML \<open>Test_Code.me;\<close>
   122 text \<open>contextthyOK2xml; (*"xmlsrc/interface-xml.sml"*)\<close>
   123 ML \<open>prog_expr\<close>
   124                                                          
   125 ML \<open>Prog_Expr.eval_occurs_in\<close>
   126 ML \<open>@{thm last_thmI}\<close>
   127 ML \<open>@{thm Querkraft_Belastung}\<close>
   128 
   129 ML \<open>Celem.check_guhs_unique := false;\<close>
   130 ML \<open>writeln "**** isac kernel = math-engine + Knowledge complete ******"\<close>
   131 ML \<open>@{theory "Isac_Knowledge"}\<close>
   132 ML \<open>(*get_the ["IsacKnowledge", "Diff", "Theorems", "diff_sin_chain"]
   133   ERROR: app_py: not found: ["IsacKnowledge","Diff","Theorems","diff_sin_chain"]*)\<close>
   134 
   135 section \<open>State of approaching Isabelle by Isac\<close>
   136 text \<open>
   137   Mathias Lehnfeld gives the following list in his thesis in section 
   138   4.2.3 Relation to Ongoing Isabelle Development.
   139 \<close>
   140 subsection \<open>(0) Survey on remaining Unsynchronized.ref\<close>
   141 text \<open>
   142   REPLACE BY KEStore... (has been overlooked)
   143     calcelems.sml:val rew_ord' = Unsynchronized.ref ...
   144   KEEP FOR TRACING
   145     calcelems.sml:val trace_rewrite = Unsynchronized.ref false;
   146     calcelems.sml:val depth = Unsynchronized.ref 99999;
   147     calcelems.sml:val lim_rewrite = Unsynchronized.ref 99999;
   148     calcelems.sml:val lim_deriv = Unsynchronized.ref 100;
   149     Interpret/script.sml:val trace_script = Unsynchronized.ref false;
   150   KEEP FOR EASIER DEVELOPMENT
   151     calcelems.sml:val check_guhs_unique = Unsynchronized.ref true;
   152   KEEP FOR DEMOS
   153     Knowledge/GCD_Poly_ML.thy:  val trace_div = Unsynchronized.ref true;
   154     Knowledge/GCD_Poly_ML.thy:  val trace_div_invariant = Unsynchronized.ref false;
   155     Knowledge/GCD_Poly_ML.thy:  val trace_Euclid = Unsynchronized.ref true;
   156 \<close>
   157 subsection \<open>(1) Exploit parallelism for concurrent session management\<close>
   158 subsection \<open>(2) Make Isac’s programming language usable\<close>
   159 subsection \<open>(3) Adopt Isabelle’s numeral computation for Isac\<close>
   160 text \<open>
   161   In 2002 isac already strived for floating point numbers. Since that time
   162   isac represents numerals as "Free", see below (*1*). These experiments are
   163   unsatisfactory with respect to logical soundness.
   164   Since Isabelle now has started to care about floating point numbers, it is high 
   165   time to adopt these together with the other numerals. Isabelle2012/13's numerals
   166   are different from Isabelle2011, see "test/Tools/isac/ProgLang/termC.sml".
   167   
   168   The transition from "Free" to standard numerals is a task to be scheduled for 
   169   several weeks. The urgency of this task follows from the experience, 
   170   that (1.2) for "thehier" is very hard, because "num_str" seems to destroy 
   171   some of the long identifiers of theorems which would tremendously simplify
   172   building a hierarchy of theorems according to (1.2), see (*2*) below.
   173 \<close>
   174 ML \<open>(*1*) Free ("123.456", HOLogic.realT)\<close>
   175 
   176 subsection \<open>(4) Improve the efficiency of Isac’s rewrite-engine\<close>
   177 subsection \<open>(5) Adopt Isabelle/jEdit for Isac\<close>
   178 
   179 end