doc-src/TutorialI/todo.tobias
author nipkow
Thu, 29 Nov 2001 21:12:37 +0100
changeset 12332 aea72a834c85
parent 12328 7c4ec77a8715
child 12473 f41e477576b9
permissions -rw-r--r--
*** empty log message ***
nipkow@11548
     1
"You know my methods. Apply them!"
nipkow@11548
     2
nipkow@10281
     3
Implementation
nipkow@10281
     4
==============
nipkow@10177
     5
nipkow@11158
     6
- (#2 * x) = #2 * - x is not proved by arith
nipkow@11158
     7
nipkow@11160
     8
a simp command for terms
nipkow@11160
     9
nipkow@11160
    10
----------------------------------------------------------------------
nipkow@11160
    11
primrec 
nipkow@11160
    12
"(foorec [] []) = []"
nipkow@11160
    13
"(foorec [] (y # ys)) = (y # (foorec [] ys))"
nipkow@11160
    14
nipkow@11160
    15
*** Primrec definition error:
nipkow@11160
    16
*** extra variables on rhs: "y", "ys"
nipkow@11160
    17
*** in
nipkow@11160
    18
*** "((foorec [] ((y::'a_1) # (ys::'a_1 list))) = (y # (foorec [] ys)))"
nipkow@11160
    19
*** At command "primrec".
nipkow@11160
    20
nipkow@11160
    21
Bessere Fehlermeldung!
nipkow@11160
    22
----------------------------------------------------------------------
nipkow@11160
    23
nipkow@10608
    24
Relation: comp -> composition
nipkow@10177
    25
nipkow@10177
    26
Add map_cong?? (upto 10% slower)
nipkow@10177
    27
nipkow@10281
    28
Recdef: Get rid of function name in header.
nipkow@10281
    29
Support mutual recursion (Konrad?)
nipkow@10177
    30
nipkow@11282
    31
improve solver in simplifier: treat & and ! ...
nipkow@11282
    32
nipkow@11282
    33
better 1 point rules:
nipkow@11282
    34
!x. !y. x = f y --> P x y  should reduce to  !y. P (f y) y.
nipkow@11282
    35
nipkow@10177
    36
use arith_tac in recdef to solve termination conditions?
nipkow@10177
    37
-> new example in Recdef/termination
nipkow@10177
    38
nipkow@10177
    39
a tactic for replacing a specific occurrence:
nipkow@10654
    40
apply(subst [2] thm)
nipkow@10177
    41
nipkow@10186
    42
it would be nice if @term could deal with ?-vars.
nipkow@10186
    43
then a number of (unchecked!) @texts could be converted to @terms.
nipkow@10186
    44
nipkow@10189
    45
it would be nice if one could get id to the enclosing quotes in the [source] option.
nipkow@10189
    46
nipkow@10281
    47
More predefined functions for datatypes: map?
nipkow@10281
    48
nipkow@10281
    49
Induction rules for int: int_le/ge_induct?
nipkow@10281
    50
Needed for ifak example. But is that example worth it?
nipkow@10281
    51
nipkow@10608
    52
Komischerweise geht das Splitten von _Annahmen_ auch mit simp_tac, was
nipkow@10608
    53
ein generelles Feature ist, das man vielleicht mal abstellen sollte.
nipkow@10608
    54
nipkow@10520
    55
proper mutual simplification
nipkow@10520
    56
nipkow@10520
    57
defs with = and pattern matching??
nipkow@10340
    58
nipkow@10186
    59
nipkow@10177
    60
Minor fixes in the tutorial
nipkow@10177
    61
===========================
nipkow@10177
    62
nipkow@11561
    63
1/2 no longer abbrevs for Suc.
nipkow@11561
    64
Warning: needs simplification to turn 1 into Suc 0. arith does so
nipkow@11561
    65
automatically.
nipkow@11561
    66
nipkow@11282
    67
recdef: failed tcs no longer shown! (sec:Recursion over nested datatypes)
nipkow@11256
    68
say something about how conditions are proved?
nipkow@11256
    69
No, better show failed proof attempts.
nipkow@11160
    70
nipkow@11256
    71
Advanced recdef: explain recdef_tc? No. Adjust recdef!
nipkow@11160
    72
nipkow@10983
    73
Adjust FP textbook refs: new Bird, Hudak
nipkow@10983
    74
Discrete math textbook: Rosen?
nipkow@10983
    75
nipkow@10654
    76
adjust type of ^ in tab:overloading
nipkow@10654
    77
nipkow@10177
    78
an example of induction: !y. A --> B --> C ??
nipkow@10177
    79
nipkow@10509
    80
Explain type_definition and mention pre-proved thms in subset.thy?
nipkow@10509
    81
-> Types/typedef
nipkow@10509
    82
nipkow@10177
    83
Appendix: Lexical: long ids.
nipkow@10177
    84
nipkow@10177
    85
Warning: infixes automatically become reserved words!
nipkow@10177
    86
nipkow@10177
    87
Forward ref from blast proof of Puzzle (AdvancedInd) to Isar proof?
nipkow@10177
    88
nipkow@10177
    89
recdef with nested recursion: either an example or at least a pointer to the
nipkow@10177
    90
literature. In Recdef/termination.thy, at the end.
nipkow@10177
    91
%FIXME, with one exception: nested recursion.
nipkow@10177
    92
nipkow@11202
    93
Syntax section: syntax annotations not just for consts but also for constdefs and datatype.
nipkow@10186
    94
nipkow@10283
    95
Appendix with list functions.
nipkow@10283
    96
nipkow@11235
    97
All theory sources on the web?
nipkow@11235
    98
nipkow@10177
    99
nipkow@10177
   100
Minor additions to the tutorial, unclear where
nipkow@10177
   101
==============================================
nipkow@10177
   102
nipkow@10855
   103
unfold?
nipkow@10845
   104
nipkow@10177
   105
nipkow@10177
   106
Possible exercises
nipkow@10177
   107
==================
nipkow@10177
   108
nipkow@10177
   109
Exercises
nipkow@10971
   110
nipkow@10971
   111
For extensionality (in Sets chapter): prove
nipkow@10971
   112
valif o norm = valif
nipkow@10971
   113
in If-expression case study (Ifexpr)
nipkow@10177
   114
nipkow@10177
   115
Nested inductive datatypes: another example/exercise:
nipkow@10177
   116
 size(t) <= size(subst s t)?
nipkow@10177
   117
nipkow@10177
   118
insertion sort: primrec, later recdef
nipkow@10177
   119
nipkow@10177
   120
OTree:
nipkow@10177
   121
 first version only for non-empty trees:
nipkow@10177
   122
 Tip 'a | Node tree tree
nipkow@10177
   123
 Then real version?
nipkow@10177
   124
 First primrec, then recdef?
nipkow@10177
   125
nipkow@10177
   126
Ind. sets: define ABC inductively and prove
nipkow@10177
   127
ABC = {rep A n @ rep B n @ rep C n. True}
nipkow@10177
   128
nipkow@10654
   129
Partial rekursive functions / Nontermination:
nipkow@10654
   130
nipkow@10654
   131
Exercise: ?! f. !i. f i = if i=0 then 1 else i*f(i-1)
nipkow@10654
   132
(What about sum? Is there one, a unique one?)
nipkow@10654
   133
nipkow@10654
   134
Exercise
nipkow@10654
   135
Better(?) sum i = fst(while (%(s,i). i=0) (%(s,i). (s+i,i-1)) (0,i))
nipkow@10654
   136
Prove 0 <= i ==> sum i = i*(i+1) via while-rule
nipkow@10654
   137
nipkow@10177
   138
Possible examples/case studies
nipkow@10177
   139
==============================
nipkow@10177
   140
nipkow@10177
   141
Trie: Define functional version
nipkow@10177
   142
datatype ('a,'b)trie = Trie ('b option) ('a => ('a,'b)trie option)
nipkow@10177
   143
lookup t [] = value t
nipkow@10177
   144
lookup t (a#as) = case tries t a of None => None | Some s => lookup s as
nipkow@10177
   145
Maybe as an exercise?
nipkow@10177
   146
nipkow@10177
   147
Trie: function for partial matches (prefixes). Needs sets for spec/proof.
nipkow@10177
   148
nipkow@10177
   149
Sets via ordered list of intervals. (Isa/Interval(2))
nipkow@10177
   150
nipkow@10177
   151
propositional logic (soundness and completeness?),
nipkow@10177
   152
predicate logic (soundness?),
nipkow@10177
   153
nipkow@10177
   154
Tautology checker. Based on Ifexpr or prop.logic?
nipkow@10177
   155
Include forward reference in relevant section.
nipkow@10177
   156
nipkow@10177
   157
Sorting with comp-parameter and with type class (<)
nipkow@10177
   158
nipkow@10654
   159
Recdef:more example proofs:
nipkow@10654
   160
 if-normalization with measure function,
nipkow@10654
   161
 nested if-normalization,
nipkow@10654
   162
 quicksort
nipkow@10654
   163
 Trie?
nipkow@10654
   164
nipkow@10177
   165
New book by Bird?
nipkow@10177
   166
nipkow@10177
   167
Steps Towards Mechanizing Program Transformations Using PVS by N. Shankar,
nipkow@10177
   168
      Science of Computer Programming, 26(1-3):33-57, 1996. 
nipkow@10177
   169
You can get it from http://www.csl.sri.com/scp95.html
nipkow@10177
   170
nipkow@10177
   171
J Moore article Towards a ...
nipkow@10177
   172
Mergesort, JVM
nipkow@10177
   173
nipkow@10177
   174
nipkow@10177
   175
Additional topics
nipkow@10177
   176
=================
nipkow@10177
   177
nipkow@10281
   178
Recdef with nested recursion?
nipkow@10177
   179
nipkow@10177
   180
Extensionality: applications in
nipkow@10177
   181
- boolean expressions: valif o bool2if = value
nipkow@10177
   182
- Advanced datatypes exercise subst (f o g) = subst f o subst g
nipkow@10177
   183
nipkow@10177
   184
A look at the library?
nipkow@10281
   185
Map.
nipkow@10177
   186
nipkow@10177
   187
Prototyping?
nipkow@10177
   188
nipkow@10177
   189
==============================================================