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