src/HOL/ex/Refute_Examples.thy
author webertj
Tue, 26 Jul 2005 12:13:35 +0200
changeset 16910 19b4bf469fb2
parent 16050 828fc32f390f
child 18774 7cf74a743c32
permissions -rw-r--r--
minor parameter changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     1
(*  Title:      HOL/ex/Refute_Examples.thy
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     2
    ID:         $Id$
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     3
    Author:     Tjark Weber
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
     4
    Copyright   2003-2005
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     5
*)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     6
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     7
(* See 'HOL/Refute.thy' for help. *)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     8
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     9
header {* Examples for the 'refute' command *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    10
15297
0aff5d912422 imports (new syntax for theory headers)
webertj
parents: 15161
diff changeset
    11
theory Refute_Examples imports Main
0aff5d912422 imports (new syntax for theory headers)
webertj
parents: 15161
diff changeset
    12
0aff5d912422 imports (new syntax for theory headers)
webertj
parents: 15161
diff changeset
    13
begin
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    14
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    15
lemma "P \<and> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    16
  apply (rule conjI)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    17
  refute 1  -- {* refutes @{term "P"} *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    18
  refute 2  -- {* refutes @{term "Q"} *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    19
  refute    -- {* equivalent to 'refute 1' *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    20
    -- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *}
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
    21
  refute [maxsize=5]           -- {* we can override parameters ... *}
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
    22
  refute [satsolver="dpll"] 2  -- {* ... and specify a subgoal at the same time *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    23
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    24
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    25
section {* Examples and Test Cases *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    26
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    27
subsection {* Propositional logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    28
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    29
lemma "True"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    30
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    31
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    32
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    33
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    34
lemma "False"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    35
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    36
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    37
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    38
lemma "P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    39
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    40
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    41
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    42
lemma "~ P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    43
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    44
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    45
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    46
lemma "P & Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    47
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    48
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    49
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    50
lemma "P | Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    51
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    52
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    53
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    54
lemma "P \<longrightarrow> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    55
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    56
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    57
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    58
lemma "(P::bool) = Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    59
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    60
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    61
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    62
lemma "(P | Q) \<longrightarrow> (P & Q)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    63
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    64
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    65
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    66
subsection {* Predicate logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    67
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    68
lemma "P x y z"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    69
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    70
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    71
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    72
lemma "P x y \<longrightarrow> P y x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    73
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    74
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    75
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    76
lemma "P (f (f x)) \<longrightarrow> P x \<longrightarrow> P (f x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    77
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    78
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    79
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    80
subsection {* Equality *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    81
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    82
lemma "P = True"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    83
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    84
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    85
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    86
lemma "P = False"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    87
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    88
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    89
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    90
lemma "x = y"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    91
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    92
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    93
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    94
lemma "f x = g x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    95
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    96
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    97
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    98
lemma "(f::'a\<Rightarrow>'b) = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    99
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   100
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   101
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   102
lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   103
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   104
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   105
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   106
lemma "distinct [a,b]"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   107
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   108
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   109
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   110
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   111
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   112
subsection {* First-Order Logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   113
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   114
lemma "\<exists>x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   115
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   116
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   117
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   118
lemma "\<forall>x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   119
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   120
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   121
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   122
lemma "EX! x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   123
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   124
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   125
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   126
lemma "Ex P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   127
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   128
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   129
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   130
lemma "All P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   131
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   132
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   133
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   134
lemma "Ex1 P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   135
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   136
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   137
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   138
lemma "(\<exists>x. P x) \<longrightarrow> (\<forall>x. P x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   139
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   140
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   141
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   142
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>y. \<forall>x. P x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   143
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   144
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   145
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   146
lemma "(\<exists>x. P x) \<longrightarrow> (EX! x. P x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   147
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   148
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   149
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   150
text {* A true statement (also testing names of free and bound variables being identical) *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   151
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   152
lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x"
16910
19b4bf469fb2 minor parameter changes
webertj
parents: 16050
diff changeset
   153
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   154
  apply fast
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   155
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   156
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   157
text {* "A type has at most 5 elements." *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   158
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   159
lemma "a=b | a=c | a=d | a=e | a=f | b=c | b=d | b=e | b=f | c=d | c=e | c=f | d=e | d=f | e=f"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   160
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   161
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   162
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   163
lemma "\<forall>a b c d e f. a=b | a=c | a=d | a=e | a=f | b=c | b=d | b=e | b=f | c=d | c=e | c=f | d=e | d=f | e=f"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   164
  refute  -- {* quantification causes an expansion of the formula; the
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   165
                previous version with free variables is refuted much faster *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   166
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   167
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   168
text {* "Every reflexive and symmetric relation is transitive." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   169
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   170
lemma "\<lbrakk> \<forall>x. P x x; \<forall>x y. P x y \<longrightarrow> P y x \<rbrakk> \<Longrightarrow> P x y \<longrightarrow> P y z \<longrightarrow> P x z"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   171
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   172
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   173
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   174
text {* The "Drinker's theorem" ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   175
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   176
lemma "\<exists>x. f x = g x \<longrightarrow> f = g"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   177
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   178
  apply (auto simp add: ext)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   179
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   180
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   181
text {* ... and an incorrect version of it *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   182
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   183
lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   184
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   185
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   186
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   187
text {* "Every function has a fixed point." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   188
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   189
lemma "\<exists>x. f x = x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   190
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   191
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   192
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   193
text {* "Function composition is commutative." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   194
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   195
lemma "f (g x) = g (f x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   196
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   197
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   198
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   199
text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   200
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   201
lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   202
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   203
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   204
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   205
subsection {* Higher-Order Logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   206
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   207
lemma "\<exists>P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   208
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   209
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   210
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   211
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   212
lemma "\<forall>P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   213
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   214
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   215
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   216
lemma "EX! P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   217
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   218
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   219
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   220
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   221
lemma "EX! P. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   222
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   223
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   224
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   225
lemma "P Q | Q x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   226
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   227
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   228
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   229
lemma "P All"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   230
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   231
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   232
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   233
lemma "P Ex"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   234
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   235
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   236
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   237
lemma "P Ex1"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   238
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   239
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   240
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   241
text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   242
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   243
constdefs
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   244
  "trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   245
  "trans P == (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   246
  "subset" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   247
  "subset P Q == (ALL x y. P x y \<longrightarrow> Q x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   248
  "trans_closure" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   249
  "trans_closure P Q == (subset Q P) & (trans P) & (ALL R. subset Q R \<longrightarrow> trans R \<longrightarrow> subset P R)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   250
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   251
lemma "trans_closure T P \<longrightarrow> (\<exists>x y. T x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   252
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   253
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   254
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   255
text {* "The union of transitive closures is equal to the transitive closure of unions." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   256
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   257
lemma "(\<forall>x y. (P x y | R x y) \<longrightarrow> T x y) \<longrightarrow> trans T \<longrightarrow> (\<forall>Q. (\<forall>x y. (P x y | R x y) \<longrightarrow> Q x y) \<longrightarrow> trans Q \<longrightarrow> subset T Q)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   258
        \<longrightarrow> trans_closure TP P
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   259
        \<longrightarrow> trans_closure TR R
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   260
        \<longrightarrow> (T x y = (TP x y | TR x y))"
16910
19b4bf469fb2 minor parameter changes
webertj
parents: 16050
diff changeset
   261
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   262
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   263
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   264
text {* "Every surjective function is invertible." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   265
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   266
lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   267
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   268
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   269
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   270
text {* "Every invertible function is surjective." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   271
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   272
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   273
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   274
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   275
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   276
text {* Every point is a fixed point of some function. *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   277
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   278
lemma "\<exists>f. f x = x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   279
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   280
  apply (rule_tac x="\<lambda>x. x" in exI)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   281
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   282
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   283
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   284
text {* Axiom of Choice: first an incorrect version ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   285
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   286
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   287
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   288
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   289
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   290
text {* ... and now two correct ones *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   291
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   292
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   293
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   294
  apply (simp add: choice)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   295
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   296
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   297
lemma "(\<forall>x. EX!y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   298
  refute [maxsize=2]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   299
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   300
    apply (simp add: ex1_implies_ex choice)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   301
  apply (fast intro: ext)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   302
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   303
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   304
subsection {* Meta-logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   305
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   306
lemma "!!x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   307
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   308
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   309
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   310
lemma "f x == g x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   311
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   312
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   313
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   314
lemma "P \<Longrightarrow> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   315
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   316
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   317
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   318
lemma "\<lbrakk> P; Q; R \<rbrakk> \<Longrightarrow> S"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   319
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   320
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   321
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   322
subsection {* Schematic variables *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   323
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   324
lemma "?P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   325
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   326
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   327
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   328
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   329
lemma "x = ?y"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   330
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   331
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   332
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   333
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   334
subsection {* Abstractions *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   335
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   336
lemma "(\<lambda>x. x) = (\<lambda>x. y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   337
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   338
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   339
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   340
lemma "(\<lambda>f. f x) = (\<lambda>f. True)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   341
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   342
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   343
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   344
lemma "(\<lambda>x. x) = (\<lambda>y. y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   345
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   346
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   347
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   348
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   349
subsection {* Sets *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   351
lemma "P (A::'a set)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   352
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   353
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   354
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   355
lemma "P (A::'a set set)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   356
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   357
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   358
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   359
lemma "{x. P x} = {y. P y}"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   360
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   361
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   362
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   363
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   364
lemma "x : {x. P x}"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   365
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   366
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   367
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   368
lemma "P op:"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   369
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   370
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   371
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   372
lemma "P (op: x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   373
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   374
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   375
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   376
lemma "P Collect"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   377
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   378
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   379
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   380
lemma "A Un B = A Int B"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   381
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   382
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   383
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   384
lemma "(A Int B) Un C = (A Un C) Int B"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   385
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   386
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   387
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   388
lemma "Ball A P \<longrightarrow> Bex A P"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   389
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   390
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   391
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   392
subsection {* arbitrary *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   393
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   394
lemma "arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   395
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   396
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   397
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   398
lemma "P arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   399
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   400
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   401
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   402
lemma "arbitrary x"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   403
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   404
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   405
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   406
lemma "arbitrary arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   407
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   408
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   409
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   410
subsection {* The *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   411
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   412
lemma "The P"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   413
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   414
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   415
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   416
lemma "P The"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   417
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   418
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   419
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   420
lemma "P (The P)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   421
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   422
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   423
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   424
lemma "(THE x. x=y) = z"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   425
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   426
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   427
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   428
lemma "Ex P \<longrightarrow> P (The P)"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   429
  refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   430
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   431
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   432
subsection {* Eps *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   433
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   434
lemma "Eps P"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   435
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   436
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   437
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   438
lemma "P Eps"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   439
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   440
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   441
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   442
lemma "P (Eps P)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   443
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   444
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   445
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   446
lemma "(SOME x. x=y) = z"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   447
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   448
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   449
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   450
lemma "Ex P \<longrightarrow> P (Eps P)"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   451
  refute [maxsize=3]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   452
  apply (auto simp add: someI)
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   453
done
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   454
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   455
(******************************************************************************)
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   456
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   457
subsection {* Subtypes (typedef), typedecl *}
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   458
15161
065ce5385a06 comment modified
webertj
parents: 14809
diff changeset
   459
text {* A completely unspecified non-empty subset of @{typ "'a"}: *}
065ce5385a06 comment modified
webertj
parents: 14809
diff changeset
   460
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   461
typedef 'a myTdef = "insert (arbitrary::'a) (arbitrary::'a set)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   462
  by auto
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   463
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   464
lemma "(x::'a myTdef) = y"
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   465
  refute
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   466
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   467
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   468
typedecl myTdecl
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   469
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   470
typedef 'a T_bij = "{(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   471
  by auto
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   472
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   473
lemma "P (f::(myTdecl myTdef) T_bij)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   474
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   475
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   476
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   477
(******************************************************************************)
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   478
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   479
subsection {* Inductive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   480
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   481
text {* With quick\_and\_dirty set, the datatype package does not generate
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   482
  certain axioms for recursion operators.  Without these axioms, refute may
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   483
  find spurious countermodels. *}
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   484
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   485
ML {* reset quick_and_dirty; *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   486
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   487
subsubsection {* unit *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   488
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   489
lemma "P (x::unit)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   490
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   491
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   492
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   493
lemma "\<forall>x::unit. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   494
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   495
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   496
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   497
lemma "P ()"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   498
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   499
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   500
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   501
lemma "P (unit_rec u x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   502
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   503
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   504
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   505
lemma "P (case x of () \<Rightarrow> u)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   506
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   507
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   508
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   509
subsubsection {* option *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   510
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   511
lemma "P (x::'a option)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   512
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   513
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   514
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   515
lemma "\<forall>x::'a option. P x"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   516
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   517
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   518
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   519
lemma "P None"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   520
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   521
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   522
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   523
lemma "P (Some x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   524
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   525
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   526
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   527
lemma "P (option_rec n s x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   528
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   529
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   530
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   531
lemma "P (case x of None \<Rightarrow> n | Some u \<Rightarrow> s u)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   532
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   533
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   534
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   535
subsubsection {* * *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   536
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   537
lemma "P (x::'a*'b)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   538
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   539
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   540
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   541
lemma "\<forall>x::'a*'b. P x"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   542
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   543
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   544
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   545
lemma "P (x,y)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   546
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   547
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   548
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   549
lemma "P (fst x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   550
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   551
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   552
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   553
lemma "P (snd x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   554
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   555
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   556
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   557
lemma "P Pair"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   558
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   559
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   560
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   561
lemma "P (prod_rec p x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   562
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   563
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   564
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   565
lemma "P (case x of Pair a b \<Rightarrow> p a b)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   566
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   567
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   568
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   569
subsubsection {* + *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   570
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   571
lemma "P (x::'a+'b)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   572
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   573
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   574
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   575
lemma "\<forall>x::'a+'b. P x"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   576
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   577
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   578
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   579
lemma "P (Inl x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   580
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   581
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   582
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   583
lemma "P (Inr x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   584
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   585
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   586
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   587
lemma "P Inl"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   588
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   589
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   590
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   591
lemma "P (sum_rec l r x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   592
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   593
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   594
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   595
lemma "P (case x of Inl a \<Rightarrow> l a | Inr b \<Rightarrow> r b)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   596
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   597
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   598
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   599
subsubsection {* Non-recursive datatypes *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   600
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   601
datatype T1 = A | B
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   602
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   603
lemma "P (x::T1)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   604
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   605
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   606
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   607
lemma "\<forall>x::T1. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   608
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   609
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   610
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   611
lemma "P A"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   612
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   613
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   614
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   615
lemma "P (T1_rec a b x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   616
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   617
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   618
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   619
lemma "P (case x of A \<Rightarrow> a | B \<Rightarrow> b)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   620
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   621
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   622
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   623
datatype 'a T2 = C T1 | D 'a
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   624
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   625
lemma "P (x::'a T2)"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   626
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   627
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   628
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   629
lemma "\<forall>x::'a T2. P x"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   630
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   631
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   632
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   633
lemma "P D"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   634
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   635
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   636
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   637
lemma "P (T2_rec c d x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   638
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   639
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   640
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   641
lemma "P (case x of C u \<Rightarrow> c u | D v \<Rightarrow> d v)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   642
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   643
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   644
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   645
datatype ('a,'b) T3 = E "'a \<Rightarrow> 'b"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   646
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   647
lemma "P (x::('a,'b) T3)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   648
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   649
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   650
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   651
lemma "\<forall>x::('a,'b) T3. P x"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   652
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   653
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   654
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   655
lemma "P E"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   656
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   657
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   658
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   659
lemma "P (T3_rec e x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   660
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   661
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   662
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   663
lemma "P (case x of E f \<Rightarrow> e f)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   664
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   665
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   666
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   667
subsubsection {* Recursive datatypes *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   668
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   669
text {* nat *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   670
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   671
lemma "P (x::nat)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   672
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   673
oops
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   674
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   675
lemma "\<forall>x::nat. P x"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   676
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   677
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   678
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   679
lemma "P (Suc 0)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   680
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   681
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   682
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   683
lemma "P Suc"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   684
  refute  -- {* @{term "Suc"} is a partial function (regardless of the size
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   685
                of the model), hence @{term "P Suc"} is undefined, hence no
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   686
                model will be found *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   687
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   688
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   689
lemma "P (nat_rec zero suc x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   690
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   691
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   692
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   693
lemma "P (case x of 0 \<Rightarrow> zero | Suc n \<Rightarrow> suc n)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   694
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   695
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   696
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   697
text {* 'a list *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   698
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   699
lemma "P (xs::'a list)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   700
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   701
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   702
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   703
lemma "\<forall>xs::'a list. P xs"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   704
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   705
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   706
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   707
lemma "P [x, y]"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   708
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   709
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   710
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   711
lemma "P (list_rec nil cons xs)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   712
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   713
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   714
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   715
lemma "P (case x of Nil \<Rightarrow> nil | Cons a b \<Rightarrow> cons a b)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   716
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   717
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   718
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   719
lemma "(xs::'a list) = ys"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   720
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   721
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   722
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   723
lemma "a # xs = b # xs"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   724
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   725
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   726
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   727
datatype 'a BinTree = Leaf 'a | Node "'a BinTree" "'a BinTree"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   728
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   729
lemma "P (x::'a BinTree)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   730
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   731
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   732
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   733
lemma "\<forall>x::'a BinTree. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   734
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   735
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   736
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   737
lemma "P (Node (Leaf x) (Leaf y))"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   738
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   739
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   740
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   741
lemma "P (BinTree_rec l n x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   742
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   743
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   744
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   745
lemma "P (case x of Leaf a \<Rightarrow> l a | Node a b \<Rightarrow> n a b)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   746
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   747
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   748
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   749
subsubsection {* Mutually recursive datatypes *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   750
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   751
datatype 'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   752
     and 'a bexp = Equal "'a aexp" "'a aexp"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   753
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   754
lemma "P (x::'a aexp)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   755
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   756
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   757
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   758
lemma "\<forall>x::'a aexp. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   759
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   760
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   761
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   762
lemma "P (ITE (Equal (Number x) (Number y)) (Number x) (Number y))"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   763
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   764
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   765
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   766
lemma "P (x::'a bexp)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   767
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   768
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   769
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   770
lemma "\<forall>x::'a bexp. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   771
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   772
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   773
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   774
lemma "P (aexp_bexp_rec_1 number ite equal x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   775
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   776
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   777
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   778
lemma "P (case x of Number a \<Rightarrow> number a | ITE b a1 a2 \<Rightarrow> ite b a1 a2)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   779
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   780
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   781
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   782
lemma "P (aexp_bexp_rec_2 number ite equal x)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   783
  refute
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   784
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   785
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   786
lemma "P (case x of Equal a1 a2 \<Rightarrow> equal a1 a2)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   787
  refute
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   788
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   789
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   790
subsubsection {* Other datatype examples *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   791
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   792
datatype Trie = TR "Trie list"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   793
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   794
lemma "P (x::Trie)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   795
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   796
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   797
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   798
lemma "\<forall>x::Trie. P x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   799
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   800
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   801
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   802
lemma "P (TR [TR []])"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   803
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   804
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   805
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   806
lemma "P (Trie_rec_1 a b c x)"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   807
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   808
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   809
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   810
lemma "P (Trie_rec_2 a b c x)"
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   811
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   812
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   813
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   814
datatype InfTree = Leaf | Node "nat \<Rightarrow> InfTree"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   815
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   816
lemma "P (x::InfTree)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   817
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   818
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   819
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   820
lemma "\<forall>x::InfTree. P x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   821
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   822
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   823
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   824
lemma "P (Node (\<lambda>n. Leaf))"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   825
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   826
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   827
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   828
lemma "P (InfTree_rec leaf node x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   829
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   830
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   831
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   832
datatype 'a lambda = Var 'a | App "'a lambda" "'a lambda" | Lam "'a \<Rightarrow> 'a lambda"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   833
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   834
lemma "P (x::'a lambda)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   835
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   836
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   837
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   838
lemma "\<forall>x::'a lambda. P x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   839
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   840
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   841
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   842
lemma "P (Lam (\<lambda>a. Var a))"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   843
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   844
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   845
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   846
lemma "P (lambda_rec v a l x)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   847
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   848
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   849
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   850
text {* Taken from "Inductive datatypes in HOL", p.8: *}
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   851
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   852
datatype ('a, 'b) T = C "'a \<Rightarrow> bool" | D "'b list"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   853
datatype 'c U = E "('c, 'c U) T"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   854
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   855
lemma "P (x::'c U)"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   856
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   857
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   858
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   859
lemma "\<forall>x::'c U. P x"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   860
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   861
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   862
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   863
lemma "P (E (C (\<lambda>a. True)))"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   864
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   865
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   866
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   867
lemma "P (U_rec_1 e f g h i x)"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   868
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   869
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   870
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   871
lemma "P (U_rec_2 e f g h i x)"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   872
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   873
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   874
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   875
lemma "P (U_rec_3 e f g h i x)"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   876
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   877
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   878
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   879
(******************************************************************************)
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   880
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   881
subsection {* Records *}
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   882
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   883
(*TODO: make use of pair types, rather than typedef, for record types*)
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   884
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   885
record ('a, 'b) point =
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   886
  xpos :: 'a
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   887
  ypos :: 'b
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   888
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   889
lemma "(x::('a, 'b) point) = y"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   890
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   891
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   892
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   893
record ('a, 'b, 'c) extpoint = "('a, 'b) point" +
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   894
  ext :: 'c
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   895
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   896
lemma "(x::('a, 'b, 'c) extpoint) = y"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   897
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   898
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   899
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   900
(******************************************************************************)
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   901
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   902
subsection {* Inductively defined sets *}
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   903
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   904
consts
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   905
  arbitrarySet :: "'a set"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   906
inductive arbitrarySet
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   907
intros
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   908
  "arbitrary : arbitrarySet"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   909
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   910
lemma "x : arbitrarySet"
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   911
  refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   912
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   913
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   914
consts
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   915
  evenCard :: "'a set set"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   916
inductive evenCard
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   917
intros
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   918
  "{} : evenCard"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   919
  "\<lbrakk> S : evenCard; x \<notin> S; y \<notin> S; x \<noteq> y \<rbrakk> \<Longrightarrow> S \<union> {x, y} : evenCard"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   920
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   921
lemma "S : evenCard"
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   922
  refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   923
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   924
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   925
consts
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   926
  even :: "nat set"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   927
  odd  :: "nat set"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   928
inductive even odd
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   929
intros
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   930
  "0 : even"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   931
  "n : even \<Longrightarrow> Suc n : odd"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   932
  "n : odd \<Longrightarrow> Suc n : even"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   933
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   934
lemma "n : odd"
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   935
  (*refute*)  -- {* unfortunately, this little example already takes too long *}
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   936
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   937
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   938
(******************************************************************************)
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   939
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   940
subsection {* Examples involving special functions *}
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   941
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   942
lemma "card x = 0"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   943
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   944
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   945
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   946
lemma "finite x"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   947
  refute  -- {* no finite countermodel exists *}
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   948
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   949
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   950
lemma "(x::nat) + y = 0"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   951
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   952
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   953
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   954
lemma "(x::nat) = x + x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   955
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   956
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   957
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   958
lemma "(x::nat) - y + y = x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   959
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   960
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   961
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   962
lemma "(x::nat) = x * x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   963
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   964
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   965
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   966
lemma "(x::nat) < x + y"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   967
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   968
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   969
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   970
lemma "a @ [] = b @ []"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   971
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   972
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   973
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   974
lemma "a @ b = b @ a"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   975
  refute
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   976
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   977
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   978
lemma "f (lfp f) = lfp f"
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   979
  refute
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   980
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   981
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   982
lemma "f (gfp f) = gfp f"
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   983
  refute
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   984
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   985
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   986
lemma "lfp f = gfp f"
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   987
  refute
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   988
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
   989
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   990
(******************************************************************************)
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   991
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   992
subsection {* Axiomatic type classes and overloading *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   993
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   994
text {* A type class without axioms: *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   995
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   996
axclass classA
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   997
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   998
lemma "P (x::'a::classA)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   999
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1000
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1001
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1002
text {* The axiom of this type class does not contain any type variables, but is internally converted into one that does: *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1003
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1004
axclass classB
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1005
  classB_ax: "P | ~ P"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1006
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1007
lemma "P (x::'a::classB)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1008
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1009
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1010
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1011
text {* An axiom with a type variable (denoting types which have at least two elements): *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1012
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1013
axclass classC < type
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1014
  classC_ax: "\<exists>x y. x \<noteq> y"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1015
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1016
lemma "P (x::'a::classC)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1017
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1018
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1019
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1020
lemma "\<exists>x y. (x::'a::classC) \<noteq> y"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1021
  refute  -- {* no countermodel exists *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1022
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1023
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1024
text {* A type class for which a constant is defined: *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1025
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1026
consts
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1027
  classD_const :: "'a \<Rightarrow> 'a"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1028
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1029
axclass classD < type
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1030
  classD_ax: "classD_const (classD_const x) = classD_const x"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1031
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1032
lemma "P (x::'a::classD)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1033
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1034
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1035
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1036
text {* A type class with multiple superclasses: *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1037
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1038
axclass classE < classC, classD
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1039
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1040
lemma "P (x::'a::classE)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1041
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1042
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1043
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1044
lemma "P (x::'a::{classB, classE})"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1045
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1046
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1047
15547
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1048
text {* OFCLASS: *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1049
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1050
lemma "OFCLASS('a::type, type_class)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1051
  refute  -- {* no countermodel exists *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1052
  apply intro_classes
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1053
done
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1054
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1055
lemma "OFCLASS('a::classC, type_class)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1056
  refute  -- {* no countermodel exists *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1057
  apply intro_classes
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1058
done
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1059
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1060
lemma "OFCLASS('a, classB_class)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1061
  refute  -- {* no countermodel exists *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1062
  apply intro_classes
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1063
  apply simp
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1064
done
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1065
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1066
lemma "OFCLASS('a::type, classC_class)"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1067
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1068
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1069
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1070
text {* Overloading: *}
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1071
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1072
consts inverse :: "'a \<Rightarrow> 'a"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1073
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1074
defs (overloaded)
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1075
  inverse_bool: "inverse (b::bool)   == ~ b"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1076
  inverse_set : "inverse (S::'a set) == -S"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1077
  inverse_pair: "inverse p           == (inverse (fst p), inverse (snd p))"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1078
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1079
lemma "inverse b"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1080
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1081
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1082
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1083
lemma "P (inverse (S::'a set))"
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1084
  refute
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1085
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1086
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1087
lemma "P (inverse (p::'a\<times>'b))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1088
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1089
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1090
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1091
end