test/Tools/isac/Test_Isac.thy
author Walther Neuper <neuper@ist.tugraz.at>
Fri, 13 Sep 2013 18:57:11 +0200
changeset 52102 cd5494eb08fd
parent 52101 c3f399ce32af
child 52105 2786cc9704c8
permissions -rwxr-xr-x
Test_Theory without session Isac has limitations
     1 (* Title:  All tests on isac (some outcommented since Isabelle2002-->2009-2)
     2    Author: Walther Neuper 101001
     3    (c) copyright due to lincense terms.
     4 
     5    Isac's tests are organised parallel to sources: 
     6      "~~/test/Tools/isac" has same directory structure as "~~/src/Tools/isac"
     7    plus
     8      ~~/test/Tools/isac/ADDTESTS
     9      ~~/test/Tools/isac/Minisubpbl: the Lucas-Interpreter's core functionality
    10 
    11 $ cd /usr/local/isabisac/
    12 $ ./bin/isabelle jedit -l Isac test/Tools/isac/Test_Isac.thy &
    13 *)
    14 
    15 (* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! *)
    16 (* !!!!! wait a minute until Isac and the theories below are loaded !!!!! *)
    17 (* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! *)
    18 
    19 theory Test_Isac imports Isac
    20   "ADDTESTS/Ctxt"
    21   "ADDTESTS/test-depend/Build_Test"
    22   "ADDTESTS/All_Ctxt"
    23   "ADDTESTS/course/phst11/T1_Basics"
    24   "ADDTESTS/course/phst11/T2_Rewriting"
    25   "ADDTESTS/course/phst11/T3_MathEngine"
    26   "ADDTESTS/file-depend/BuildC_Test"
    27   "ADDTESTS/session-get_theory/Foo"
    28 (*"ADDTESTS/course/SignalProcess/Build_Inverse_Z_Transform"*)
    29   "~~/test/Pure/Isar/Test_Parsers"
    30 (*"~~/test/Pure/Isar/Pure/Isar/Struct_Deriv" lost at update 2009-2-->2011*)
    31   "~~/test/Pure/Isar/Test_Parse_Term"
    32   "~~/test/HOL/Library/Test_Polynomial"
    33 
    34   "~~/src/Tools/isac/Knowledge/GCD_Poly"    (*not imported by Isac.thy*)
    35   "~~/src/Tools/isac/Knowledge/GCD_Poly_FP" (*not imported by Isac.thy*)
    36 
    37 begin
    38 section {* test ML Code of isac *}
    39   ML {*"%%%%%%%%%%%%%%%%% start ProgLang.thy %%%%%%%%%%%%%%%%%%%";*}
    40   ML_file          "library.sml"
    41   ML_file          "calcelems.sml"
    42   ML_file "ProgLang/termC.sml"
    43   ML_file "ProgLang/calculate.sml"
    44   ML_file "ProgLang/rewrite.sml"
    45 (*ML_file "ProgLang/listC.sml"            2002*)
    46   ML_file "ProgLang/scrtools.sml"
    47   ML_file "ProgLang/tools.sml"
    48   ML {*"%%%%%%%%%%%%%%%%% end ProgLang.thy %%%%%%%%%%%%%%%%%%%%%";*}
    49   ML {*"%%%%%%%%%%%%%%%%% start Minisubpbl %%%%%%%%%%%%%%%%%%%%%";*}
    50   ML_file "Minisubpbl/000-comments.sml"
    51   ML_file "Minisubpbl/100-init-rootpbl.sml"
    52   ML_file "Minisubpbl/150-add-given.sml"
    53   ML_file "Minisubpbl/200-start-method.sml"
    54   ML_file "Minisubpbl/300-init-subpbl.sml"
    55   ML_file "Minisubpbl/400-start-meth-subpbl.sml"
    56   ML_file "Minisubpbl/490-nxt-Check_Postcond.sml"
    57   ML_file "Minisubpbl/500-met-sub-to-root.sml"
    58   ML_file "Minisubpbl/530-error-Check_Elementwise.sml"
    59   ML_file "Minisubpbl/600-postcond.sml"
    60   ML {*"%%%%%%%%%%%%%%%%% end Minisubpbl.thy %%%%%%%%%%%%%%%%%%%%%%%";*}
    61   ML {*"%%%%%%%%%%%%%%%%% start Interpret.thy %%%%%%%%%%%%%%%%%%";*}
    62   ML_file "Interpret/mstools.sml"
    63   ML_file "Interpret/ctree.sml"         (*!...!see(25)*)
    64   ML_file "Interpret/ptyps.sml"
    65   ML {* (*check_unsynchronized_ref (); ==== trick on error: CUT AND PASTE THIS LINE =========*) *}
    66 (*TRICK DOESN'T WORK: get_pbt not found: ["IsacKnowledge","Diff","Theorems","diff_sin_chain"]*)
    67   ML_file "Interpret/generate.sml"
    68 (*WITHOUT inhibit exn WN1130621 Isabelle2012-->13 !thehier! THIS ERROR OCCURS:
    69   ... SAME ERROR HERE ON ISABELLE2012 AS IN ISAC ON ISABELLE2011*)
    70   ML_file "Interpret/calchead.sml"
    71   ML_file "Interpret/appl.sml"          (*complete "WEGEN INTERMED TESTCODE"                          *)
    72   ML_file "Interpret/rewtools.sml"      (*complete, isac's Context broken at 2009-2 --> 2011, thehier!*)
    73   ML_file "Interpret/script.sml"
    74   ML_file "Interpret/solve.sml"
    75   ML_file "Interpret/inform.sml"
    76 (*WITHOUT inhibit exn WN1130621 Isabelle2012-->13 !thehier! THIS ERROR OCCURS:
    77   ... SAME ERROR HERE ON ISABELLE2012 AS IN ISAC ON ISABELLE2011*)
    78   ML_file "Interpret/mathengine.sml"    (*!part.*)
    79   ML {*"%%%%%%%%%%%%%%%%% end Interpret.thy %%%%%%%%%%%%%%%%%%%%";*}
    80   ML {*"%%%%%%%%%%%%%%%%% start xmlsrc.thy %%%%%%%%%%%%%%%%%%%%%";*}
    81   ML_file "xmlsrc/mathml.sml"           (*part.*)
    82   ML_file "xmlsrc/datatypes.sml"        (*TODO/part.*)
    83   ML_file "xmlsrc/pbl-met-hierarchy.sml"(*TODO after 2009-2/part.*)
    84 (*ML_file "xmlsrc/thy-hierarchy.sml"      TODO after 2009-2/part | Isabelle2012-->13 !thehier! *)
    85 (*WITHOUT inhibit exn WN1130621 Isabelle2012-->13 !thehier! THIS ERROR OCCURS:
    86 val it = "----------- ### thes2file ... Exception- Match raised -----------": string
    87 :
    88 val it = "~~~~~ fun thes2file, args:": string
    89 val p = "../../tmp/": path
    90 val it = (): unit
    91  exception Bind raised (line 359 of "~~/test/Tools/isac/xmlsrc/thy-hierarchy.sml")
    92                                                  ...CONCERNED WITH thehier
    93 *)
    94   ML_file "xmlsrc/interface-xml.sml"     (*TODO after 2009-2*)
    95   ML {*"%%%%%%%%%%%%%%%%% end xmlsrc.thy %%%%%%%%%%%%%%%%%%%%%%%";*}
    96   ML {*"%%%%%%%%%%%%%%%%% start Frontend.thy %%%%%%%%%%%%%%%%%%%";*}
    97   ML_file "Frontend/messages.sml"
    98   ML_file "Frontend/states.sml"
    99   ML_file "Frontend/interface.sml"
   100 (*WITHOUT inhibit exn WN1130621 Isabelle2012-->13 !thehier! THIS ERROR OCCURS:
   101   ... SAME ERROR HERE ON ISABELLE2012 AS IN ISAC ON ISABELLE2011*)
   102   ML_file          "print_exn_G.sml"
   103   ML {*"%%%%%%%%%%%%%%%%% end Frontend.thy %%%%%%%%%%%%%%%%%%%%%";*}
   104   ML {*"%%%%%%%%%%%%%%%%% start Knowledge %%%%%%%%%%%%%%%%%%%%%%";*}
   105   ML_file "Knowledge/delete.sml"
   106   ML_file "Knowledge/descript.sml"
   107   ML_file "Knowledge/atools.sml"
   108   ML_file "Knowledge/simplify.sml"
   109   ML_file "Knowledge/poly.sml"
   110   ML_file "Knowledge/gcd_poly_ml.sml"
   111   ML_file "Knowledge/gcd_poly_winkler.sml" (*must be after gcd_poly_ml.sml: redefines functions*)
   112   ML_file "Knowledge/rational.sml"
   113   ML_file "Knowledge/equation.sml"
   114   ML_file "Knowledge/root.sml"
   115   ML_file "Knowledge/lineq.sml"
   116 (*ML_file "Knowledge/rooteq.sml"    some complicated equations not recovered from 2002 *)
   117   ML_file "Knowledge/rateq.sml"   (*some complicated equations not recovered from 2002 *)
   118   ML_file "Knowledge/rootrat.sml"
   119   ML_file "Knowledge/rootrateq.sml"(*ome complicated equations not recovered from 2002 *)
   120   ML_file "Knowledge/partial_fractions.sml"
   121   ML_file "Knowledge/polyeq.sml" (*-----------------works if cut into parts !!!!!!!!!!!*)
   122 (*ML_file "Knowledge/rlang.sml"     much to clean up, not urgent due to similar tests  *)
   123   ML_file "Knowledge/calculus.sml"
   124   ML_file "Knowledge/trig.sml"
   125 (*ML_file "Knowledge/logexp.sml"    not included as stuff for presentation of authoring*) 
   126   ML_file "Knowledge/diff.sml"
   127   ML_file "Knowledge/integrate.sml"
   128   ML_file "Knowledge/eqsystem.sml"
   129   ML_file "Knowledge/test.sml"
   130   ML_file "Knowledge/polyminus.sml"
   131   ML_file "Knowledge/vect.sml"
   132   ML_file "Knowledge/diffapp.sml"        (* postponed to dev. specification | TP-prog. *)
   133   ML_file "Knowledge/biegelinie.sml"
   134   ML_file "Knowledge/algein.sml"
   135   ML_file "Knowledge/diophanteq.sml"
   136   ML_file "Knowledge/Inverse_Z_Transform/inverse_z_transform.sml"
   137   ML_file "Knowledge/isac.sml"
   138   ML_file "Knowledge/build_thydata.sml"
   139   ML {*"%%%%%%%%%%%%%%%%% end Knowledge %%%%%%%%%%%%%%%%%%%%%%%%";*}
   140   ML {*"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%";*}
   141   ML {*"%%%%%%%%%%%%%%%%% all tests successful %%%%%%%%%%%%%%%%%";*}
   142   ML {*"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%";*}
   143 
   144 section {* history of tests *}
   145 text {*
   146   Systematic regression tests have been introduced to isac development in 2003.
   147   Sanity of the regression test suffered from updates following Isabelle development,
   148   which mostly exceeded the resources available in isac's development.
   149 
   150   The survey below shall support to efficiently use the tests for isac 
   151   on different Isabelle versions. Conclusion in most cases will be: 
   152 
   153   !!! Use most recent tests or go back to the old notebook
   154       with isac on Isabelle2002. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   155 *}
   156 
   157 subsection {* isac on Isabelle2013 *}
   158 subsubsection {* Summary of development *}
   159 text {*
   160 *}
   161 subsubsection {* Run tests *}
   162 text {*
   163 *}
   164 subsubsection {* State of tests *}
   165 text {*
   166 *}
   167 subsubsection {* Changesets of begin and end *}
   168 text {*
   169   TODO
   170   :
   171   : isac on Isablle2013 
   172   :
   173   Changeset: 52061 (4ecea2fcdc2c) --- Build_Isac.thy runs on Isabelle2013
   174   User: Walther Neuper <neuper@ist.tugraz.at>
   175   Date: 2013-07-15 08:28:50 +0200 (4 weeks)
   176 *}
   177 
   178 subsection {* isac on Isabelle2012 *}
   179 subsubsection {* Summary of development *}
   180 text {*
   181   isac on Isabelle2012 is considered just a transitional stage
   182   within the update from Isabelle2011 to Isabelle2013; thus no further development of isac;
   183   For considerations on the transition see 
   184   ~~/src/Tools/isac/Knowledge/Build_Thydata/thy, section "updating isac..".
   185 *}
   186 subsubsection {* Run tests *}
   187 text {*
   188 $ cd /usr/local/isabisac12/
   189 $ ./bin/isabelle jedit -l HOL src/Tools/isac/Build_Isac.thy
   190 $ ./bin/isabelle jedit -l Isac test/Tools/isac/Test_Isac.thy
   191 *}
   192 subsubsection {* State of tests *}
   193 text {*
   194   At least the tests from isac on Isabelle2011 run again.
   195   However, Test_Isac.thy shows erratic behaviour; no errors are obtained when scrolling 
   196   in parallel with evaluation.
   197 
   198   Counting "error in kernel" for Frontend/interface.sml (the tests considered most significant)
   199   yields 69 hits, some of which were already present before Isabelle2002-->2009-2
   200   (i.e. on the old notebook from 2002).
   201 
   202   Now many tests with (*...=== inhibit exn ...*) give a reason or at least the origin:
   203   # === inhibit exn WN1130621 Isabelle2012-->13 !thehier! === ...see Build_Thydata.thy
   204   # === inhibit exn AK110726 === ...reliable work by Alexander Kargl, most likely go back to 2002
   205   # === inhibit exn WN1130701 broken at Isabelle2002 --> 2009-2 === , most likely go back to 2002
   206   Reasons for outcommented tests are also found in Test_Isac.thy near the respective file.sml.
   207 
   208   Some tests have been re-activated (e.g. error patterns, fill patterns).
   209 *}
   210 subsubsection {* Changesets of begin and end *}
   211 text {*  
   212   Changeset: 52051 (35751d90365e) end of improving tests for isac on Isabelle2012
   213   User: Walther Neuper <neuper@ist.tugraz.at>
   214   Date: 2013-07-11 16:58:31 +0200 (4 weeks)
   215   :
   216   : isac on Isablle2012 
   217   :
   218   Changeset: 48757 (74eb3dfc33cc) updated src from Isabelle2011 to Isabelle2012
   219   User: Walther Neuper <neuper@ist.tugraz.at>
   220   Date: 2012-09-24 18:35:13 +0200 (8 months)
   221   ------------------------------------------------------------------------------
   222   Changeset: 48756 (7443906996a8) merged
   223   User: Walther Neuper <neuper@ist.tugraz.at>
   224   Date: 2012-09-24 18:15:49 +0200 (8 months)
   225 *}
   226 
   227 subsection {* isac on Isabelle2011 *}
   228 subsubsection {* Summary of development *}
   229 text {*
   230   isac's mathematics engine has been extended by two developments:
   231   (1) Isabelle's contexts were introduced by Mathias Lehnfeld
   232   (2) "error patterns" were introduced by Gabriella Daroczy
   233   Regressions tests have been added for both.
   234 *}
   235 subsubsection {* Run tests *}
   236 text {*
   237   $ cd /usr/local/isabisac11/
   238   $ ./bin/isabelle jedit -l HOL src/Tools/isac/Build_Isac.thy
   239   $ ./bin/isabelle jedit -l Isac test/Tools/isac/Test_Isac.thy
   240 *}
   241 subsubsection {* State of tests *}
   242 text {* 
   243   Systematic efforts outcommented less significant tests by (*...=== inhibit exn ...*) 
   244   and sometimes give reasons for failing tests.
   245   (*...=== inhibit exn AK...*) was done by Alexander Kargl; this is reliable
   246   work, some of which couldn't be revised (and renamed) by WN and thus survived some time.
   247 
   248   Tests with functions decomposed for single-stepping are marked with
   249   "~~~~~ fun , args:"; val 
   250 
   251   The most signification tests (in particular Frontend/interface.sml) run,
   252   however, many "error in kernel" are not caught by an exception.
   253   ------------------------------------------------------------------------------
   254   After the changeset below Test_Isac worked with check_unsynchronized_ref ():
   255   ------------------------------------------------------------------------------
   256   Changeset: 42457 (ca691a84b81a) PROVISIONALLY MADE TESTS RUN with Unsynchronized.ref
   257   User: Walther Neuper <neuper@ist.tugraz.at>
   258   Date: 2012-08-06 10:38:11 +0200 (11 months)
   259 *}
   260 subsubsection {* Changesets of begin and end *}
   261 text {*
   262   isac development was done between these changesets:
   263   ------------------------------------------------------------------------------
   264   Changeset: 42519 (1f3b4270363e) meeting dmeindl: added missing files
   265   User: Walther Neuper <neuper@ist.tugraz.at>
   266   Date: 2012-09-24 16:39:30 +0200 (8 months)
   267   :
   268   : isac on Isablle2011
   269   :
   270   Changeset:41897 (355be7f60389) merged isabisac with Isabelle2011
   271   Branch: decompose-isar 
   272   User: Walther Neuper <neuper@ist.tugraz.at>
   273   Date: 2011-02-25 13:04:56 +0100 (2011-02-25)
   274   ------------------------------------------------------------------------------
   275 *}
   276 
   277 subsection {* isac on Isabelle2009-2 *}
   278 subsubsection {* Summary of development *}
   279 text {*
   280   In 2009 the update of isac from Isabelle2002 started with switching from CVS to hg.
   281   The update was painful (bridging 7 years of Isabelle development) and cut short 
   282   due to the start of introducing Isabelle's contexts (Mathias Lehnfeld) and
   283   going on to Isabelle2011 although most of the tests did not run.
   284 *}
   285 subsubsection {* Run tests *}
   286 text {*
   287   $ cd /usr/local/isabisac09-2/
   288   $ ./bin/isabelle emacs -l HOL src/Tools/isac/Build_Isac.thy
   289   $ ./bin/isabelle emacs -l Isac src/Tools/isac/Test_Isac.thy
   290   NOT THE RIGHT VERSION.....    test/Tools/isac/Test_Isac.thy !!!
   291 *}
   292 subsubsection {* State of tests *}
   293 text {* 
   294   Most tests are broken by the update from Isabelle2002 to Isabelle2009-2.
   295   If really necessary, go back to the old notebook with Isabelle2002.
   296 *}
   297 subsubsection {* Changesets of begin and end *}
   298 text {*
   299   isac development was done between these changesets:
   300   ------------------------------------------------------------------------------
   301   Changeset: 38115 (940a5feea094) Little improvements of isac-plugin
   302   Branch: decompose-isar 
   303   User: Marco Steger <m.steger@student.tugraz.at>
   304   Date: 2011-02-06 18:30:28 +0100 (2011-02-06)
   305   :
   306   : isac on Isablle2009-2
   307   :
   308   Changeset: 37870 (5100a9c3abf8) created branch isac-from-Isabelle2009-2
   309   Branch: isac-from-Isabelle2009-2 
   310   User: Walther Neuper <neuper@ist.tugraz.at>
   311   Date: 2010-07-21 09:59:35 +0200 (2010-07-21)
   312   ------------------------------------------------------------------------------
   313 *}
   314 
   315 subsection {* isac on Isabelle2002 *}
   316 subsubsection {* Summary of development *}
   317 text {*
   318   From 1999 to 2010 all the basic functionality (except "ctxt" and "error pattern")
   319   of isac's mathematics engine has been implemented.
   320 *}
   321 subsubsection {* Run tests *}
   322 subsubsection {* State of tests *}
   323 text {* 
   324   All tests work on an old notebook (the right PolyML coudn't be upgraded to more
   325   recent Linux versions)
   326 *}
   327 subsubsection {* Changesets of begin and end *}
   328 text {*
   329   Up to the above Mercurial changeset 5100a9c3abf8 isac used CVS;
   330   see https://intra.ist.tugraz.at/hg/isac containing a conversion to Mercurial.
   331 *}
   332 
   333 end
   334 (*========== inhibit exn 130719 Isabelle2013 ===================================
   335 ============ inhibit exn 130719 Isabelle2013 =================================*)
   336 
   337 (*-.-.-.-.-.-isolate response.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
   338   -.-.-.-.-.-.-isolate response.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*)
   339