doc-src/TutorialI/todo.tobias
author nipkow
Fri, 20 Oct 2000 14:17:08 +0200
changeset 10283 ff003e2b790c
parent 10281 9554ce1c2e54
child 10340 0a380ac80e7d
permissions -rw-r--r--
*** empty log message ***
     1 Implementation
     2 ==============
     3 
     4 Hide global names like Node.
     5 Why is comp needed in addition to op O?
     6 Explain in syntax section!
     7 
     8 defs with = and pattern matching
     9 
    10 replace "simp only split" by "split_tac".
    11 
    12 arithmetic: allow mixed nat/int formulae
    13 -> simplify proof of part1 in Inductive/AB.thy
    14 
    15 Add map_cong?? (upto 10% slower)
    16 
    17 Recdef: Get rid of function name in header.
    18 Support mutual recursion (Konrad?)
    19 
    20 use arith_tac in recdef to solve termination conditions?
    21 -> new example in Recdef/termination
    22 
    23 a tactic for replacing a specific occurrence:
    24 apply(substitute [2] thm)
    25 
    26 it would be nice if @term could deal with ?-vars.
    27 then a number of (unchecked!) @texts could be converted to @terms.
    28 
    29 it would be nice if one could get id to the enclosing quotes in the [source] option.
    30 
    31 More predefined functions for datatypes: map?
    32 
    33 Induction rules for int: int_le/ge_induct?
    34 Needed for ifak example. But is that example worth it?
    35 
    36 
    37 Minor fixes in the tutorial
    38 ===========================
    39 
    40 explanation of absence of contrapos_pn in Rules?
    41 
    42 get rid of use_thy in tutorial?
    43 
    44 Explain typographic conventions?
    45 
    46 an example of induction: !y. A --> B --> C ??
    47 
    48 Appendix: Lexical: long ids.
    49 
    50 Warning: infixes automatically become reserved words!
    51 
    52 Forward ref from blast proof of Puzzle (AdvancedInd) to Isar proof?
    53 
    54 mention split_split in advanced pair section.
    55 
    56 recdef with nested recursion: either an example or at least a pointer to the
    57 literature. In Recdef/termination.thy, at the end.
    58 %FIXME, with one exception: nested recursion.
    59 
    60 Syntax section: syntax annotations nor just for consts but also for constdefs and datatype.
    61 
    62 Appendix with list functions.
    63 
    64 
    65 Minor additions to the tutorial, unclear where
    66 ==============================================
    67 
    68 Tacticals: , ? +
    69 
    70 Mention that simp etc (big step tactics) insist on change?
    71 
    72 Rules: Introduce "by" (as a kind of shorthand for apply+done, except that it
    73 does more.)
    74 
    75 A list of further useful commands (rules? tricks?)
    76 prefer, defer, print_simpset (-> print_simps?)
    77 
    78 An overview of the automatic methods: simp, auto, fast, blast, force,
    79 clarify, clarsimp (intro, elim?)
    80 
    81 Advanced Ind expects rule_format incl (no_asm) (which it currently explains!)
    82 Where explained? Should go into a separate section as Inductive needs it as
    83 well.
    84 
    85 Where is "simplified" explained? Needed by Inductive/AB.thy
    86 
    87 demonstrate x : set xs in Sets. Or Tricks chapter?
    88 
    89 Appendix with HOL keywords. Say something about other keywords.
    90 
    91 
    92 Possible exercises
    93 ==================
    94 
    95 Exercises
    96 %\begin{exercise}
    97 %Extend expressions by conditional expressions.
    98 braucht wfrec!
    99 %\end{exercise}
   100 
   101 Nested inductive datatypes: another example/exercise:
   102  size(t) <= size(subst s t)?
   103 
   104 insertion sort: primrec, later recdef
   105 
   106 OTree:
   107  first version only for non-empty trees:
   108  Tip 'a | Node tree tree
   109  Then real version?
   110  First primrec, then recdef?
   111 
   112 Ind. sets: define ABC inductively and prove
   113 ABC = {rep A n @ rep B n @ rep C n. True}
   114 
   115 Possible examples/case studies
   116 ==============================
   117 
   118 Trie: Define functional version
   119 datatype ('a,'b)trie = Trie ('b option) ('a => ('a,'b)trie option)
   120 lookup t [] = value t
   121 lookup t (a#as) = case tries t a of None => None | Some s => lookup s as
   122 Maybe as an exercise?
   123 
   124 Trie: function for partial matches (prefixes). Needs sets for spec/proof.
   125 
   126 Sets via ordered list of intervals. (Isa/Interval(2))
   127 
   128 propositional logic (soundness and completeness?),
   129 predicate logic (soundness?),
   130 
   131 Tautology checker. Based on Ifexpr or prop.logic?
   132 Include forward reference in relevant section.
   133 
   134 Sorting with comp-parameter and with type class (<)
   135 
   136 New book by Bird?
   137 
   138 Steps Towards Mechanizing Program Transformations Using PVS by N. Shankar,
   139       Science of Computer Programming, 26(1-3):33-57, 1996. 
   140 You can get it from http://www.csl.sri.com/scp95.html
   141 
   142 J Moore article Towards a ...
   143 Mergesort, JVM
   144 
   145 
   146 Additional topics
   147 =================
   148 
   149 Recdef with nested recursion?
   150 
   151 Extensionality: applications in
   152 - boolean expressions: valif o bool2if = value
   153 - Advanced datatypes exercise subst (f o g) = subst f o subst g
   154 
   155 A look at the library?
   156 Map.
   157 If WF is discussed, make a link to it from AdvancedInd.
   158 
   159 Prototyping?
   160 
   161 ==============================================================
   162 Recdef:
   163 
   164 nested recursion
   165 more example proofs:
   166  if-normalization with measure function,
   167  nested if-normalization,
   168  quicksort
   169  Trie?
   170 a case study?
   171 
   172 ----------
   173 
   174 Partial rekursive functions / Nontermination
   175 
   176 What appears to be the problem:
   177 axiom f n = f n + 1
   178 lemma False
   179 apply(cut_facts_tac axiom, simp).
   180 
   181 1. Guarded recursion
   182 
   183 Scheme:
   184 f x = if $x \in dom(f)$ then ... else arbitrary
   185 
   186 Example: sum/fact: int -> int (for no good reason because we have nat)
   187 
   188 Exercise: ?! f. !i. f i = if i=0 then 1 else i*f(i-1)
   189 (What about sum? Is there one, a unique one?)
   190 
   191 [Alternative: include argument that is counted down
   192  f x n = if n=0 then None else ...
   193 Refer to Boyer and Moore]
   194 
   195 More complex: same_fst
   196 
   197 chase(f,x) = if wf{(f x,x) . f x ~= x}
   198              then if f x = x then x else chase(f,f x)
   199              else arb
   200 
   201 Prove wf ==> f(chase(f,x)) = chase(f,x)
   202 
   203 2. While / Tail recursion
   204 
   205 chase f x = fst(while (%(x,fx). x=fx) (%(x,fx). (fx,f fx)) (x,f x))
   206 
   207 ==> unfold eqn for chase? Prove fixpoint property?
   208 
   209 Better(?) sum i = fst(while (%(s,i). i=0) (%(s,i). (s+i,i-1)) (0,i))
   210 Prove 0 <= i ==> sum i = i*(i+1) via while-rule
   211 
   212 Mention prototyping?
   213 ==============================================================