src/Tools/isac/TODO.thy
author Walther Neuper <wneuper@ist.tugraz.at>
Fri, 26 Jul 2019 16:34:41 +0200
changeset 59575 beb3e6dd497d
parent 59574 d1e857c374e2
child 59577 60d191402598
permissions -rw-r--r--
lucin: prep. test for further improving sig. for locate_input_tactic
     1 (* Title:  todo's for isac core
     2    Author: Walther Neuper 111013
     3    (c) copyright due to lincense terms.
     4 *)
     5 theory TODO
     6 imports "~~/src/Doc/Prog_Prove/LaTeXsugar"
     7 begin
     8 
     9 section \<open>TODOs from current changesets\<close>
    10 text\<open>
    11   Shift more complicated issues from the next subsection to the next but one!
    12 \<close>
    13 subsection \<open>Current changeset\<close>
    14 text \<open>
    15   \begin{itemize}
    16   \item xxx
    17   \item introduce simple type names to LUCAS_INTERPRETER <-?-> readable paper
    18   \item check in states: length ?? > 1 with tracing these cases
    19   \item xxx
    20   \item xxx
    21   \item xxx
    22   \end{itemize}
    23 \<close>
    24 subsection \<open>Postponed from current changeset\<close>
    25 text \<open>
    26   \begin{itemize}
    27   \item language definition: use (f #> g) x = x |> f |> g instead of @
    28     see implementation.pdf p.16
    29   \item xxx
    30   \item xxx
    31   \item pull update of Ctree.state out of 2 Lucin funs (locate_input_formula is different))
    32     \begin{itemize}
    33     \item 1. check if Ctree.state can be updated OUTSIDE determine_next_step
    34     \item 2. fun locate_input_tactic: pull generate1 out (because it stores ctxt also in cstate)
    35     \item xxx
    36     \item xxx
    37     \end{itemize}
    38   \item xxx
    39   \item xxx
    40   \item inform: TermC.parse (Celem.assoc_thy "Isac") istr --> parseNEW context istr
    41   \item extract common code from associate.. stac2tac_
    42   \end{itemize}
    43 \<close>
    44 
    45 section \<open>Separated tasks\<close>
    46 text \<open>
    47 \<close>
    48 subsection \<open>Simple\<close>
    49 text \<open>
    50   \begin{itemize}
    51   \item Diff.thy: differentiateX --> differentiate after removal of script-constant
    52   \item Test.thy: met_test_sqrt2: deleted?!
    53   \item xxx
    54   \item xxx
    55   \item xxx
    56   \end{itemize}
    57 \<close>
    58 subsection \<open>Simple but laborous\<close>
    59 text \<open>
    60   \begin{itemize}
    61   \item rename rename field scr in meth
    62   \item prep_met: check match between args of partial_function and model-pattern of meth;
    63      provide error message.
    64   \item xxx
    65   \item xxx
    66   \item xxx
    67   \item xxx
    68   \end{itemize}
    69 \<close>
    70 subsection \<open>Questionable\<close>
    71 text \<open>
    72   \begin{itemize}
    73   \item finish output of trace_script with Check_Postcond (useful for SubProblem)
    74   \item unify in signature LANGUAGE_TOOLS =\\
    75     val pblterm: Rule.domID -> Celem.pblID -> term     vvv        vvv\\
    76     val subpbl: string -> string list -> term          unify with ^^^
    77   \item xxx
    78   \item xxx
    79   \item xxx
    80   \item xxx
    81   \end{itemize}
    82 \<close>
    83 section \<open>Complex, related to --> other tasks\<close>
    84 text \<open>
    85 \<close>
    86 subsection \<open>review all signatures wrt. implementation.pdf canonical argument order\<close>
    87 text \<open>
    88 \<close>
    89 subsection \<open>solve, loc_solve_, ...\<close>
    90 text \<open>
    91   unify to calcstate, calcstate'
    92   \begin{itemize}
    93   \item ? rename begin_end_prog -> check_switch_prog
    94   \item adopt the same for specification phase
    95   \item xxx
    96   \end{itemize}
    97 \<close>
    98 subsection \<open>Review modelling- + specification-phase\<close>
    99 text \<open>
   100   \begin{itemize}
   101   \item "--- hack for funpack: generalise handling of meths which extend problem items ---"
   102     \begin{itemize}
   103     \item see several locations of hack in code
   104     \item these locations are NOT sufficient, see
   105       test/../biegelinie-3.sml --- IntegrierenUndKonstanteBestimmen2: Bsp.7.70. auto ---
   106     \item "fun associate" "match_ags ..dI" instead "..pI" breaks many tests, however,
   107       this would be according to survey Notes (3) in src/../calchead.sml.
   108     \end{itemize}
   109   \item see "failed trial to generalise handling of meths"98298342fb6d
   110   \item abstract specify + nxt_specif to common aux-funs;
   111     see e.g. "--- hack for funpack: generalise handling of meths which extend problem items ---"
   112   \item xxx
   113   \item type model = itm list ?
   114   \item review survey Notes in src/../calchead.sml: they are questionable
   115   \item review copy-named, probably two issues commingled 
   116     \begin{itemize}
   117     \item special handling of "#Find#, because it is not a formal argument of partial_function
   118     \item special naming for solutions of equation solving: x_1, x_2, ...
   119     \end{itemize}
   120   \item xxx
   121   \item this has been written in one go:
   122     \begin{itemize}
   123     \item reconsidering Model.max_vt, use problem with meth ["DiffApp","max_by_calculus"]
   124     \item reconsider add_field': where is it used for what? Shift into mk_oris
   125     \item reconsider match_itms_oris: where is it used for what? max_vt ONLY???
   126     \item in Specify_Method search root-oris for items (e.g. "errorBound"), #1# in survey
   127     \item Specify_Problem, Specify_Method: check respective identifiers after re-Specify_
   128       (relevant for pre-condition)
   129     \item unify match_ags to mk_oris1..N with different args (fmz | pat list, pbl | meth
   130     \item 
   131     \end{itemize}
   132   \end{itemize}
   133 \<close>
   134 subsection \<open>taci list, type step\<close>
   135 text \<open>
   136   \begin{itemize}
   137   \item states.sml: check, when "length tacis > 1"
   138   \item in Test_Isac.thy there is only 1 error in Interpret/inform.sml
   139   \item (*WN190713 REMOVE: "creating a new node" was never implemented for more than one node?!?
   140   \item xxx
   141   \end{itemize}
   142 \<close>
   143 subsection \<open>Cleanup signatures\<close>
   144 text \<open>
   145   \begin{itemize}
   146   \item there are comments in several signatures
   147   \item ML_file "~~/src/Tools/isac/Interpret/specification-elems.sml" can be (almost) deleted
   148   \item src/../Frontend/: signatures missing
   149   \item xxx
   150   \end{itemize}
   151 \<close>
   152 subsection \<open>Ctree\<close>
   153 text \<open>
   154   \begin{itemize}
   155   \item review get_ctxt, update_ctxt, get_istate, upd_istate, upd_ctxt,
   156     <---> update_loc', repl_loc (remove the latter)
   157   \item delete field ctxt in PblObj in favour of loc
   158   \item xxx
   159   \item xxx
   160   \end{itemize}
   161 \<close>
   162 subsection \<open>replace theory/thy by context/ctxt\<close>
   163 text \<open>
   164   \begin{itemize}
   165   \item 1. Rewrite.eval_true_, then
   166     Lucin.handle_leaf, Rewrite.eval_listexpr_, Generate.generate1, Lucin.stac2tac.
   167   \item xxx
   168   \item xxx
   169   \end{itemize}
   170 \<close>
   171 subsection \<open>Rfuns, Begin_/End_Detail', Rrls\<close>
   172 text \<open>
   173   \begin{itemize}
   174   \item removing from_pblobj_or_detail' causes many strange errors
   175   \item ^^^+ see from_pblobj_or_detail_thm, from_pblobj_or_detail_calc, ...
   176   \item xxx
   177   \item probably only "normal_form" seems to be needed
   178   \item deleted Rfuns in NEW "locate_input_tactic": no active test for "locate_rule"
   179     but that seems desirable
   180   \item ?how is the relation to reverse-rewriting ???
   181   \item "Rfuns" markers in test/../rational
   182   \item xxx
   183   \item datatype istate (Istate.T): remove RrlsState, scrstate: use Rrls only for creating results beyond
   184     rewriting and/or respective intermediate steps (e.g. cancellation of fractions).
   185     Thus we get a 1-step-action which does NOT require a state beyond istate(?).
   186     Thus we drastically reduce complexity, also get rid of "fun from_pblobj_or_detail_calc" , etc.
   187   \item debug ^^^ related: is there an occurence of Steps with more than 1 element?
   188   \item xxx
   189   \item and do_solve_step (* WN1907: ?only for Begin_/End_Detail' DEL!!!*)
   190   \item xxx
   191   \item shouldn't go Rfuns from Rewrite --> Rewrite_Set; they behave similar to "fun interSteps" ?
   192   \end{itemize}
   193 \<close>
   194 subsection \<open>Inverse_Z_Transform.thy\<close>
   195 text \<open>
   196   \begin{itemize}
   197   \item\label{new-var-rhs} rule1..6, ruleZY introduce new variables on the rhs of the rewrite-rule.
   198   ? replace rewriting with substitution ?!?
   199   The problem is related to the decision of typing for "d_d" and making bound variables free (while
   200   shifting specific handling in equation solving etc. to the meta-logic). 
   201   \item Find "stepResponse (x[n::real]::bool)" is superfluous, because immediately used by
   202     rewrite-rules; see \ref{new-var-rhs}.
   203   \item Reconsider whole problem:
   204     input only the polynomial as argument of partial_function, in ([1], Frm) compile lhs "X z" ?
   205   \end{itemize}
   206 \<close>
   207 subsection \<open>Adopt Isabelle's numerals for Isac\<close>
   208 text \<open>
   209   \begin{itemize}
   210   \item replace numerals of type "real" by "nat" in some specific functions from ListC.thy
   211     and have both representations in parallel for "nat".
   212   \item xxx
   213   \item xxx
   214   \end{itemize}
   215 \<close>
   216 subsection \<open>Finetunig required for xmldata\<close>
   217 text \<open>
   218   See xmldata https://intra.ist.tugraz.at/hg/isac/rev/5b222a649390
   219   and in kbase html-representation generated from these xmldata.
   220   Notes in ~~/xmldata/TODO.txt.
   221 \<close>
   222 
   223 section \<open>Hints for further development\<close>
   224 text \<open>
   225 \<close>
   226 subsection \<open>get proof-state\<close>
   227 text \<open>
   228   Re: [isabelle] Programatically get "this"
   229   ----------------------------------------------------
   230   So here is my (Makarius') version of your initial example, following these principles:
   231   begin{verbatim}
   232     notepad
   233     begin
   234       assume a: A
   235       ML_val \<open>
   236         val ctxt = @{context};
   237     
   238         val this_name =
   239           Name_Space.full_name (Proof_Context.naming_of ctxt) (Binding.name
   240     Auto_Bind.thisN);
   241         val this = #thms (the (Proof_Context.lookup_fact ctxt this_name));
   242       \<close>
   243     end
   244   end{verbatim}
   245 \<close>
   246 subsection \<open>write Specification to jEdit\<close>
   247 text \<open>
   248   Re: [isabelle] Printing terms with type annotations
   249   ----------------------------------------------------
   250   On 06/02/2019 17:52, Moa Johansson wrote:
   251   >
   252   > I’m writing some code that should create a snippet of Isar script.
   253   
   254   This is how Sledgehammer approximates this:
   255   
   256   http://isabelle.in.tum.de/repos/isabelle/file/Isabelle2018/src/HOL/Tools/Sledgehammer/sledgehammer_isar_proof.ML#l299
   257   
   258   (The module name already shows that the proper terminology is "Isar
   259   proof" (or "Isar proof text").  Proof scripts are a thing from the past,
   260   before Isar. You can emulate old-style proof scripts via a sequence of
   261   'apply' commands, but this is improper Isar.)
   262   
   263   Note that there is no standard function in Isabelle/Pure, because the
   264   problem to print just the right amount of type information is very
   265   complex and not fully solved. One day, after 1 or 2 rounds of
   266   refinements over the above approach, it might become generally available.
   267 \<close>
   268 subsection \<open>follow Isabelle conventions (*Does not yet work in Isabelle2018\<close>
   269 text \<open>
   270   isabelle update -u path_cartouches
   271   isabelle update -u inner_syntax_cartouches
   272 \<close>
   273 section \<open>For copy & paste\<close>
   274 text \<open>
   275   \begin{itemize}
   276   \item xxx
   277     \begin{itemize}
   278     \item xxx
   279       \begin{itemize}
   280       \item xxx
   281         \begin{itemize}
   282         \item xxx
   283         \end{itemize}
   284       \end{itemize}
   285     \end{itemize}
   286   \end{itemize}
   287 \end{itemize}
   288 \<close>
   289 subsection \<open>xxx\<close>
   290 subsubsection \<open>xxx\<close>
   291 end