ProgTutorial/Package/Simple_Inductive_Package.thy
author Christian Urban <urbanc@in.tum.de>
Thu, 21 Jun 2012 08:39:02 +0100
changeset 532 8411f242e094
parent 514 7e25716c3744
child 538 e9fd5eff62c1
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
     1
theory Simple_Inductive_Package
164
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
     2
imports Main "../Base"
514
7e25716c3744 updated to outer syntax / parser changes
Christian Urban <urbanc@in.tum.de>
parents: 442
diff changeset
     3
keywords "simple_inductive" :: thy_decl
164
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
     4
uses "simple_inductive_package.ML"
32
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
     5
begin
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
     6
164
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
     7
(*
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
     8
simple_inductive
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
     9
  trcl :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    10
where
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    11
  base: "trcl R x x"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    12
| step: "trcl R x y \<Longrightarrow> R y z \<Longrightarrow> trcl R x z"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    13
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    14
thm trcl_def
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    15
thm trcl.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    16
thm trcl.intros
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    17
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    18
simple_inductive
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    19
  even and odd
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    20
where
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    21
  even0: "even 0"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    22
| evenS: "odd n \<Longrightarrow> even (Suc n)"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    23
| oddS: "even n \<Longrightarrow> odd (Suc n)"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    24
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    25
thm even_def odd_def
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    26
thm even.induct odd.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    27
thm even0
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    28
thm evenS
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    29
thm oddS
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    30
thm even_odd.intros
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    31
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    32
simple_inductive
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    33
  accpart for r :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    34
where
177
4e2341f6599d polishing
Christian Urban <urbanc@in.tum.de>
parents: 164
diff changeset
    35
  accpartI: "(\<And>y. r y x \<Longrightarrow> accpart r y) \<Longrightarrow> accpart r x"
164
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    36
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    37
thm accpart_def
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    38
thm accpart.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    39
thm accpartI
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    40
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    41
locale rel =
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    42
  fixes r :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    43
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    44
simple_inductive (in rel) accpart'
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    45
where
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    46
  accpartI': "\<And>x. (\<And>y. r y x \<Longrightarrow> accpart' y) \<Longrightarrow> accpart' x"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    47
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    48
context rel
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    49
begin
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    50
  thm accpartI'
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    51
  thm accpart'.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    52
end
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    53
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    54
thm rel.accpartI'
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    55
thm rel.accpart'.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    56
*)
159
64fa844064fa updated to chages in binding module
Christian Urban <urbanc@in.tum.de>
parents: 32
diff changeset
    57
32
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
    58
159
64fa844064fa updated to chages in binding module
Christian Urban <urbanc@in.tum.de>
parents: 32
diff changeset
    59
32
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
    60
end