ProgTutorial/Package/Simple_Inductive_Package.thy
author Norbert Schirmer <norbert.schirmer@web.de>
Tue, 14 May 2019 13:39:31 +0200
changeset 563 50d3059de9c6
parent 562 daf404920ab9
permissions -rw-r--r--
accomodate Parsing section to Isabelle 2018
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
32
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
     4
begin
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
     5
538
e9fd5eff62c1 removed "use" for "ML_file"
Christian Urban <urbanc@in.tum.de>
parents: 514
diff changeset
     6
ML_file "simple_inductive_package.ML"
e9fd5eff62c1 removed "use" for "ML_file"
Christian Urban <urbanc@in.tum.de>
parents: 514
diff changeset
     7
562
daf404920ab9 Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents: 538
diff changeset
     8
164
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
     9
simple_inductive
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    10
  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
    11
where
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    12
  base: "trcl R x x"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    13
| 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
    14
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    15
thm trcl_def
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    16
thm trcl.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    17
thm trcl.intros
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    18
562
daf404920ab9 Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents: 538
diff changeset
    19
(*
164
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    20
simple_inductive
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    21
  even and odd
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    22
where
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    23
  even0: "even 0"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    24
| evenS: "odd n \<Longrightarrow> even (Suc n)"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    25
| oddS: "even n \<Longrightarrow> odd (Suc n)"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    26
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    27
thm even_def odd_def
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    28
thm even.induct odd.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    29
thm even0
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    30
thm evenS
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    31
thm oddS
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    32
thm even_odd.intros
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    33
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    34
simple_inductive
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    35
  accpart for r :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    36
where
177
4e2341f6599d polishing
Christian Urban <urbanc@in.tum.de>
parents: 164
diff changeset
    37
  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
    38
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    39
thm accpart_def
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    40
thm accpart.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    41
thm accpartI
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    42
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    43
locale rel =
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    44
  fixes r :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    45
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    46
simple_inductive (in rel) accpart'
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    47
where
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    48
  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
    49
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    50
context rel
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    51
begin
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    52
  thm accpartI'
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    53
  thm accpart'.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    54
end
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    55
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    56
thm rel.accpartI'
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
diff changeset
    57
thm rel.accpart'.induct
3f617d7a2691 more work on simple_inductive
Christian Urban <urbanc@in.tum.de>
parents: 159
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
159
64fa844064fa updated to chages in binding module
Christian Urban <urbanc@in.tum.de>
parents: 32
diff changeset
    61
32
5bb2d29553c2 Added new chapter about writing packages.
berghofe
parents:
diff changeset
    62
end