test/Tools/isac/Test_Isac.thy
author Walther Neuper <neuper@ist.tugraz.at>
Thu, 25 Jul 2013 07:36:31 +0200
changeset 52073 f709e6ab4e09
parent 52068 8ec8824f61de
child 52079 0e17ac93bbed
permissions -rwxr-xr-x
restructured files concerning "fun gcd_poly"

# GCD_Poly --mv-> GCD_Poly_ML: imported in Rational.thy
# GCD_Poly_FP: first trials with fun pack kept for review
# GCD_Poly: development toward project RISC - Isabelle

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