src/HOL/ex/Refute_Examples.thy
author webertj
Fri, 12 Oct 2007 22:00:47 +0200
changeset 25014 b711b0af178e
parent 24447 fbd6d7cbf6dd
child 25031 4d1271cc42ea
permissions -rw-r--r--
significant code overhaul, bugfix for inductive data types
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
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
     4
    Copyright   2003-2007
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
begin
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    13
18774
7cf74a743c32 works with DPLL solver now
webertj
parents: 16910
diff changeset
    14
refute_params [satsolver="dpll"]
7cf74a743c32 works with DPLL solver now
webertj
parents: 16910
diff changeset
    15
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    16
lemma "P \<and> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    17
  apply (rule conjI)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    18
  refute 1  -- {* refutes @{term "P"} *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    19
  refute 2  -- {* refutes @{term "Q"} *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    20
  refute    -- {* equivalent to 'refute 1' *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    21
    -- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *}
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
    22
  refute [maxsize=5]           -- {* we can override parameters ... *}
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
    23
  refute [satsolver="dpll"] 2  -- {* ... and specify a subgoal at the same time *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    24
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    25
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
    26
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
    27
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
    28
subsection {* Examples and Test Cases *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    29
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
    30
subsubsection {* Propositional logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    31
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    32
lemma "True"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    33
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    34
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    35
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    36
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    37
lemma "False"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    38
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    39
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    40
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    41
lemma "P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    42
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    43
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    44
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    45
lemma "~ P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    46
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    47
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    48
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    49
lemma "P & Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    50
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    51
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    52
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    53
lemma "P | Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    54
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    55
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    56
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    57
lemma "P \<longrightarrow> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    58
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    59
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    60
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    61
lemma "(P::bool) = Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    62
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    63
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    64
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    65
lemma "(P | Q) \<longrightarrow> (P & Q)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    66
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    67
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    68
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
    69
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
    70
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
    71
subsubsection {* Predicate logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    72
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    73
lemma "P x y z"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    74
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    75
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    76
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    77
lemma "P x y \<longrightarrow> P y x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    78
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    79
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    80
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    81
lemma "P (f (f x)) \<longrightarrow> P x \<longrightarrow> P (f x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    82
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    83
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    84
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
    85
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
    86
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
    87
subsubsection {* Equality *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    88
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    89
lemma "P = True"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    90
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    91
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    92
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    93
lemma "P = False"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    94
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    95
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    96
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    97
lemma "x = y"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    98
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    99
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   100
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   101
lemma "f x = g x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   102
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   103
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   104
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   105
lemma "(f::'a\<Rightarrow>'b) = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   106
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   107
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   108
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   109
lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   110
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   111
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   112
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   113
lemma "distinct [a,b]"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   114
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   115
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   116
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   117
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   118
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   119
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   120
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   121
subsubsection {* First-Order Logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   122
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   123
lemma "\<exists>x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   124
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   125
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   126
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   127
lemma "\<forall>x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   128
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   129
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   130
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   131
lemma "EX! x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   132
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   133
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   134
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   135
lemma "Ex P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   136
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   137
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   138
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   139
lemma "All P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   140
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   141
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   142
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   143
lemma "Ex1 P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   144
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   145
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   146
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   147
lemma "(\<exists>x. P x) \<longrightarrow> (\<forall>x. P x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   148
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   149
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   150
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   151
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
   152
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   153
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   154
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   155
lemma "(\<exists>x. P x) \<longrightarrow> (EX! x. P x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   156
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   157
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   158
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   159
text {* A true statement (also testing names of free and bound variables being identical) *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   160
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   161
lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x"
18774
7cf74a743c32 works with DPLL solver now
webertj
parents: 16910
diff changeset
   162
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   163
  apply fast
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   164
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   165
18789
8a5c6fc3ad27 smaller example to prevent timeout
webertj
parents: 18774
diff changeset
   166
text {* "A type has at most 4 elements." *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   167
18789
8a5c6fc3ad27 smaller example to prevent timeout
webertj
parents: 18774
diff changeset
   168
lemma "a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   169
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   170
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   171
18789
8a5c6fc3ad27 smaller example to prevent timeout
webertj
parents: 18774
diff changeset
   172
lemma "\<forall>a b c d e. a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e"
21559
d24fb16e1a1d outermost universal quantifiers are stripped
webertj
parents: 21502
diff changeset
   173
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   174
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   175
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   176
text {* "Every reflexive and symmetric relation is transitive." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   177
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   178
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
   179
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   180
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   181
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   182
text {* The "Drinker's theorem" ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   183
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   184
lemma "\<exists>x. f x = g x \<longrightarrow> f = g"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   185
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   186
  apply (auto simp add: ext)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   187
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   188
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   189
text {* ... and an incorrect version of it *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   190
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   191
lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   192
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   193
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   194
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   195
text {* "Every function has a fixed point." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   196
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   197
lemma "\<exists>x. f x = x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   198
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   199
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   200
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   201
text {* "Function composition is commutative." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   202
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   203
lemma "f (g x) = g (f x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   204
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   205
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   206
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   207
text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   208
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   209
lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   210
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   211
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   212
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   213
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   214
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   215
subsubsection {* Higher-Order Logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   216
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   217
lemma "\<exists>P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   218
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   219
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   220
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   221
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   222
lemma "\<forall>P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   223
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   224
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   225
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   226
lemma "EX! P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   227
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   228
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   229
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   230
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   231
lemma "EX! P. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   232
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   233
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   234
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   235
lemma "P Q | Q x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   236
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   237
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   238
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   239
lemma "x \<noteq> All"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   240
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   241
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   242
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   243
lemma "x \<noteq> Ex"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   244
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   245
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   246
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   247
lemma "x \<noteq> Ex1"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   248
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   249
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   250
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   251
text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   252
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   253
constdefs
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   254
  "trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   255
  "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
   256
  "subset" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   257
  "subset P Q == (ALL x y. P x y \<longrightarrow> Q x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   258
  "trans_closure" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   259
  "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
   260
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   261
lemma "trans_closure T P \<longrightarrow> (\<exists>x y. T x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   262
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   263
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   264
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   265
text {* "The union of transitive closures is equal to the transitive closure of unions." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   266
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   267
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
   268
        \<longrightarrow> trans_closure TP P
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   269
        \<longrightarrow> trans_closure TR R
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   270
        \<longrightarrow> (T x y = (TP x y | TR x y))"
16910
19b4bf469fb2 minor parameter changes
webertj
parents: 16050
diff changeset
   271
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   272
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   273
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   274
text {* "Every surjective function is invertible." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   275
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   276
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
   277
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   278
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   279
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   280
text {* "Every invertible function is surjective." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   281
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   282
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
   283
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   284
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   285
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   286
text {* Every point is a fixed point of some function. *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   287
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   288
lemma "\<exists>f. f x = x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   289
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   290
  apply (rule_tac x="\<lambda>x. x" in exI)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   291
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   292
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   293
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   294
text {* Axiom of Choice: first an incorrect version ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   295
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   296
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
   297
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   298
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   299
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   300
text {* ... and now two correct ones *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   301
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   302
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
   303
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   304
  apply (simp add: choice)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   305
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   306
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   307
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
   308
  refute [maxsize=2]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   309
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   310
    apply (simp add: ex1_implies_ex choice)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   311
  apply (fast intro: ext)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   312
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   313
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   314
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   315
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   316
subsubsection {* Meta-logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   317
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   318
lemma "!!x. P x"
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
lemma "f x == g x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   323
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   324
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   325
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   326
lemma "P \<Longrightarrow> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   327
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   328
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   329
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   330
lemma "\<lbrakk> P; Q; R \<rbrakk> \<Longrightarrow> S"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   331
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   332
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   333
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   334
lemma "(x == all) \<Longrightarrow> False"
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   335
  refute
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   336
oops
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   337
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   338
lemma "(x == (op ==)) \<Longrightarrow> False"
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   339
  refute
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   340
oops
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   341
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   342
lemma "(x == (op \<Longrightarrow>)) \<Longrightarrow> False"
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   343
  refute
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   344
oops
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   345
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   346
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   347
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   348
subsubsection {* Schematic variables *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   349
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   350
lemma "?P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   351
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   352
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   353
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   354
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   355
lemma "x = ?y"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   356
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   357
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   358
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   359
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   360
(******************************************************************************)
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   361
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   362
subsubsection {* Abstractions *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   363
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   364
lemma "(\<lambda>x. x) = (\<lambda>x. y)"
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
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   368
lemma "(\<lambda>f. f x) = (\<lambda>f. True)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   369
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   370
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   371
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   372
lemma "(\<lambda>x. x) = (\<lambda>y. y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   373
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   374
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   375
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   376
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   377
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   378
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   379
subsubsection {* Sets *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   380
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   381
lemma "P (A::'a set)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   382
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   383
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   384
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   385
lemma "P (A::'a set set)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   386
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   387
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   388
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   389
lemma "{x. P x} = {y. P y}"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   390
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   391
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   392
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   393
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   394
lemma "x : {x. P x}"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   395
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   396
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   397
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   398
lemma "P op:"
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 "P (op: 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 "P Collect"
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
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   410
lemma "A Un B = A Int B"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   411
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   412
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   413
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   414
lemma "(A Int B) Un C = (A Un C) Int B"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   415
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   416
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   417
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   418
lemma "Ball A P \<longrightarrow> Bex A P"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   419
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   420
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   421
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   422
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   423
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   424
subsubsection {* arbitrary *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   425
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   426
lemma "arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   427
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   428
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   429
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   430
lemma "P arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   431
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   432
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   433
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   434
lemma "arbitrary x"
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 "arbitrary arbitrary"
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
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   442
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   443
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   444
subsubsection {* The *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   445
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   446
lemma "The P"
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 "P The"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   451
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   452
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   453
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   454
lemma "P (The P)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   455
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   456
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   457
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   458
lemma "(THE x. x=y) = z"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   459
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   460
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   461
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   462
lemma "Ex P \<longrightarrow> P (The P)"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   463
  refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   464
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   465
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   466
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   467
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   468
subsubsection {* Eps *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   469
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   470
lemma "Eps P"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   471
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   472
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   473
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   474
lemma "P Eps"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   475
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   476
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   477
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   478
lemma "P (Eps P)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   479
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   480
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   481
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   482
lemma "(SOME x. x=y) = z"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   483
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   484
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   485
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   486
lemma "Ex P \<longrightarrow> P (Eps P)"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   487
  refute [maxsize=3]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   488
  apply (auto simp add: someI)
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   489
done
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   490
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   491
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   492
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   493
subsubsection {* Subtypes (typedef), typedecl *}
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   494
15161
065ce5385a06 comment modified
webertj
parents: 14809
diff changeset
   495
text {* A completely unspecified non-empty subset of @{typ "'a"}: *}
065ce5385a06 comment modified
webertj
parents: 14809
diff changeset
   496
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   497
typedef 'a myTdef = "insert (arbitrary::'a) (arbitrary::'a set)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   498
  by auto
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   499
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   500
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
   501
  refute
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   502
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   503
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   504
typedecl myTdecl
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   505
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   506
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
   507
  by auto
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   508
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   509
lemma "P (f::(myTdecl myTdef) T_bij)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   510
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   511
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   512
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   513
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   514
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   515
subsubsection {* Inductive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   516
21502
7f3ea2b3bab6 prefer antiquotations over LaTeX macros;
wenzelm
parents: 18789
diff changeset
   517
text {* With @{text quick_and_dirty} set, the datatype package does
7f3ea2b3bab6 prefer antiquotations over LaTeX macros;
wenzelm
parents: 18789
diff changeset
   518
  not generate certain axioms for recursion operators.  Without these
7f3ea2b3bab6 prefer antiquotations over LaTeX macros;
wenzelm
parents: 18789
diff changeset
   519
  axioms, refute may 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
   520
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   521
ML {* val Refute_Examples_qnd = !quick_and_dirty; reset quick_and_dirty; *}
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   522
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   523
text {* unit *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   524
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   525
lemma "P (x::unit)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   526
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   527
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   528
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   529
lemma "\<forall>x::unit. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   530
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   531
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   532
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   533
lemma "P ()"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   534
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   535
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   536
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   537
lemma "unit_rec u x = u"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   538
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   539
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   540
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   541
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
   542
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
   543
  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
   544
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
   545
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   546
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
   547
  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
   548
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
   549
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   550
text {* option *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   551
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   552
lemma "P (x::'a option)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   553
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   554
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   555
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   556
lemma "\<forall>x::'a option. P x"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   557
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   558
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   559
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   560
lemma "P None"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   561
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   562
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   563
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   564
lemma "P (Some x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   565
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   566
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   567
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   568
lemma "option_rec n s None = n"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   569
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   570
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   571
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   572
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   573
lemma "option_rec n s (Some x) = s x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   574
  refute [maxsize=4]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   575
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   576
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   577
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
   578
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
   579
  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
   580
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
   581
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   582
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
   583
  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
   584
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
   585
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   586
text {* * *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   587
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   588
lemma "P (x::'a*'b)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   589
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   590
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   591
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   592
lemma "\<forall>x::'a*'b. P x"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   593
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   594
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   595
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   596
lemma "P (x, y)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   597
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   598
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   599
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   600
lemma "P (fst x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   601
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   602
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   603
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   604
lemma "P (snd x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   605
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   606
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   607
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   608
lemma "P Pair"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   609
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   610
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   611
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   612
lemma "prod_rec p (a, b) = p a b"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   613
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   614
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   615
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   616
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
   617
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
   618
  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
   619
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
   620
f08e2d83681e major code change: 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
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
   622
  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
   623
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
   624
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   625
text {* + *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   626
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   627
lemma "P (x::'a+'b)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   628
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   629
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   630
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   631
lemma "\<forall>x::'a+'b. P x"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   632
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   633
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   634
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   635
lemma "P (Inl x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   636
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   637
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   638
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   639
lemma "P (Inr x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   640
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   641
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   642
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   643
lemma "P Inl"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   644
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   645
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   646
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   647
lemma "sum_rec l r (Inl x) = l x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   648
  refute [maxsize=3]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   649
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   650
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   651
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   652
lemma "sum_rec l r (Inr x) = r x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   653
  refute [maxsize=3]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   654
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   655
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   656
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
   657
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
   658
  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
   659
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
   660
f08e2d83681e major code change: 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
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
   662
  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
   663
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
   664
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   665
text {* Non-recursive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   666
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   667
datatype T1 = A | B
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   668
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   669
lemma "P (x::T1)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   670
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   671
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   672
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   673
lemma "\<forall>x::T1. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   674
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   675
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   676
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   677
lemma "P A"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   678
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   679
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   680
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   681
lemma "P B"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   682
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   683
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   684
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   685
lemma "T1_rec a b A = a"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   686
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   687
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   688
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   689
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   690
lemma "T1_rec a b B = b"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   691
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   692
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   693
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   694
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
   695
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
   696
  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
   697
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
   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 (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
   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
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   703
datatype 'a T2 = C T1 | D 'a
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   704
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   705
lemma "P (x::'a T2)"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   706
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   707
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   708
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   709
lemma "\<forall>x::'a T2. P x"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   710
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   711
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   712
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   713
lemma "P D"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   714
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   715
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   716
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   717
lemma "T2_rec c d (C x) = c x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   718
  refute [maxsize=4]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   719
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   720
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   721
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   722
lemma "T2_rec c d (D x) = d x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   723
  refute [maxsize=4]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   724
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   725
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   726
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
   727
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
   728
  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
   729
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
   730
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   731
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
   732
  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
   733
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
   734
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   735
datatype ('a,'b) T3 = E "'a \<Rightarrow> 'b"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   736
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   737
lemma "P (x::('a,'b) T3)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   738
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   739
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   740
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   741
lemma "\<forall>x::('a,'b) T3. P x"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   742
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   743
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   744
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   745
lemma "P E"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   746
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   747
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   748
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   749
lemma "T3_rec e (E x) = e x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   750
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   751
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   752
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   753
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
   754
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
   755
  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
   756
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
   757
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   758
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
   759
  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
   760
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
   761
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   762
text {* Recursive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   763
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
   764
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
   765
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   766
lemma "P (x::nat)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   767
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   768
oops
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   769
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   770
lemma "\<forall>x::nat. P x"
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
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   774
lemma "P (Suc 0)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   775
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   776
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   777
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   778
lemma "P Suc"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   779
  refute  -- {* @{term "Suc"} is a partial function (regardless of the size
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   780
                of the model), hence @{term "P Suc"} is undefined, hence no
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   781
                model will be found *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   782
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   783
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   784
lemma "nat_rec zero suc 0 = zero"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   785
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   786
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   787
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   788
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   789
lemma "nat_rec zero suc (Suc x) = suc x (nat_rec zero suc x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   790
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   791
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   792
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   793
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
   794
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
   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 "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
   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
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
   803
f08e2d83681e major code change: 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
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
   805
  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
   806
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
   807
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   808
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
   809
  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
   810
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
   811
f08e2d83681e major code change: 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
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
   813
  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
   814
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
   815
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   816
lemma "list_rec nil cons [] = nil"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   817
  refute [maxsize=3]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   818
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   819
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   820
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   821
lemma "list_rec nil cons (x#xs) = cons x xs (list_rec nil cons xs)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   822
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   823
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   824
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   825
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
   826
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
   827
  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
   828
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
   829
f08e2d83681e major code change: 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
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
   831
  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
   832
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
   833
f08e2d83681e major code change: 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 "(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
   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 "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
   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
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   842
datatype BitList = BitListNil | Bit0 BitList | Bit1 BitList
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   843
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   844
lemma "P (x::BitList)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   845
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   846
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   847
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   848
lemma "\<forall>x::BitList. P x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   849
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   850
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   851
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   852
lemma "P (Bit0 (Bit1 BitListNil))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   853
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   854
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   855
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   856
lemma "BitList_rec nil bit0 bit1 BitListNil = nil"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   857
  refute [maxsize=4]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   858
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   859
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   860
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   861
lemma "BitList_rec nil bit0 bit1 (Bit0 xs) = bit0 xs (BitList_rec nil bit0 bit1 xs)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   862
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   863
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   864
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   865
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   866
lemma "BitList_rec nil bit0 bit1 (Bit1 xs) = bit1 xs (BitList_rec nil bit0 bit1 xs)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   867
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   868
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   869
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   870
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   871
lemma "P (BitList_rec nil bit0 bit1 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   872
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   873
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   874
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   875
datatype 'a BinTree = Leaf 'a | Node "'a BinTree" "'a BinTree"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   876
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   877
lemma "P (x::'a BinTree)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   878
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   879
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   880
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   881
lemma "\<forall>x::'a BinTree. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   882
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   883
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   884
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   885
lemma "P (Node (Leaf x) (Leaf y))"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   886
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   887
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   888
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   889
lemma "BinTree_rec l n (Leaf x) = l x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   890
  refute [maxsize=1]  (* The "maxsize=1" tests are a bit pointless: for some formulae
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   891
                         below, refute will find no countermodel simply because this
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   892
                         size makes involved terms undefined.  Unfortunately, any
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   893
                         larger size already takes too long. *)
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   894
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   895
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   896
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   897
lemma "BinTree_rec l n (Node x y) = n x y (BinTree_rec l n x) (BinTree_rec l n y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   898
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   899
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   900
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   901
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
   902
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
   903
  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
   904
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
   905
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   906
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
   907
  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
   908
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
   909
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   910
text {* Mutually recursive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   911
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   912
datatype 'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   913
     and 'a bexp = Equal "'a aexp" "'a aexp"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   914
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   915
lemma "P (x::'a aexp)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   916
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   917
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   918
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   919
lemma "\<forall>x::'a aexp. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   920
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   921
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   922
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
   923
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
   924
  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
   925
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
   926
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   927
lemma "P (x::'a bexp)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   928
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   929
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   930
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   931
lemma "\<forall>x::'a bexp. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   932
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   933
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   934
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   935
lemma "aexp_bexp_rec_1 number ite equal (Number x) = number x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   936
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   937
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   938
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   939
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   940
lemma "aexp_bexp_rec_1 number ite equal (ITE x y z) = ite x y z (aexp_bexp_rec_2 number ite equal x) (aexp_bexp_rec_1 number ite equal y) (aexp_bexp_rec_1 number ite equal z)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   941
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   942
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   943
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   944
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
   945
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
   946
  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
   947
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
   948
f08e2d83681e major code change: 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
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
   950
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   951
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   952
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   953
lemma "aexp_bexp_rec_2 number ite equal (Equal x y) = equal x y (aexp_bexp_rec_1 number ite equal x) (aexp_bexp_rec_1 number ite equal y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   954
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   955
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   956
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   957
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
   958
lemma "P (aexp_bexp_rec_2 number ite equal x)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   959
  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
   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 "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
   963
  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
   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
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   966
datatype X = A | B X | C Y
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   967
     and Y = D X | E Y | F
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   968
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   969
lemma "P (x::X)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   970
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   971
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   972
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   973
lemma "P (y::Y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   974
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   975
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   976
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   977
lemma "P (B (B A))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   978
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   979
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   980
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   981
lemma "P (B (C F))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   982
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   983
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   984
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   985
lemma "P (C (D A))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   986
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   987
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   988
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   989
lemma "P (C (E F))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   990
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   991
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   992
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   993
lemma "P (D (B A))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   994
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   995
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   996
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   997
lemma "P (D (C F))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   998
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   999
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1000
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1001
lemma "P (E (D A))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1002
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1003
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1004
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1005
lemma "P (E (E F))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1006
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1007
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1008
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1009
lemma "P (C (D (C F)))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1010
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1011
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1012
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1013
lemma "X_Y_rec_1 a b c d e f A = a"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1014
  refute [maxsize=3]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1015
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1016
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1017
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1018
lemma "X_Y_rec_1 a b c d e f (B x) = b x (X_Y_rec_1 a b c d e f x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1019
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1020
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1021
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1022
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1023
lemma "X_Y_rec_1 a b c d e f (C y) = c y (X_Y_rec_2 a b c d e f y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1024
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1025
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1026
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1027
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1028
lemma "X_Y_rec_2 a b c d e f (D x) = d x (X_Y_rec_1 a b c d e f x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1029
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1030
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1031
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1032
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1033
lemma "X_Y_rec_2 a b c d e f (E y) = e y (X_Y_rec_2 a b c d e f y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1034
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1035
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1036
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1037
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1038
lemma "X_Y_rec_2 a b c d e f F = f"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1039
  refute [maxsize=3]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1040
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1041
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1042
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1043
lemma "P (X_Y_rec_1 a b c d e f x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1044
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1045
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1046
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1047
lemma "P (X_Y_rec_2 a b c d e f y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1048
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1049
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1050
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1051
text {* Other datatype examples *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1052
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1053
text {* Indirect recursion is implemented via mutual recursion. *}
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1054
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1055
datatype XOpt = CX "XOpt option" | DX "bool \<Rightarrow> XOpt option"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1056
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1057
lemma "P (x::XOpt)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1058
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1059
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1060
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1061
lemma "P (CX None)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1062
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1063
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1064
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1065
lemma "P (CX (Some (CX None)))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1066
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1067
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1068
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1069
lemma "XOpt_rec_1 cx dx n1 s1 n2 s2 (CX x) = cx x (XOpt_rec_2 cx dx n1 s1 n2 s2 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1070
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1071
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1072
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1073
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1074
lemma "XOpt_rec_1 cx dx n1 s1 n2 s2 (DX x) = dx x (\<lambda>b. XOpt_rec_3 cx dx n1 s1 n2 s2 (x b))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1075
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1076
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1077
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1078
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1079
lemma "XOpt_rec_2 cx dx n1 s1 n2 s2 None = n1"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1080
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1081
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1082
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1083
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1084
lemma "XOpt_rec_2 cx dx n1 s1 n2 s2 (Some x) = s1 x (XOpt_rec_1 cx dx n1 s1 n2 s2 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1085
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1086
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1087
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1088
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1089
lemma "XOpt_rec_3 cx dx n1 s1 n2 s2 None = n2"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1090
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1091
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1092
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1093
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1094
lemma "XOpt_rec_3 cx dx n1 s1 n2 s2 (Some x) = s2 x (XOpt_rec_1 cx dx n1 s1 n2 s2 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1095
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1096
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1097
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1098
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1099
lemma "P (XOpt_rec_1 cx dx n1 s1 n2 s2 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1100
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1101
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1102
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1103
lemma "P (XOpt_rec_2 cx dx n1 s1 n2 s2 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1104
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1105
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1106
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1107
lemma "P (XOpt_rec_3 cx dx n1 s1 n2 s2 x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1108
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1109
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1110
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1111
datatype 'a YOpt = CY "('a \<Rightarrow> 'a YOpt) option"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1112
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1113
lemma "P (x::'a YOpt)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1114
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1115
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1116
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1117
lemma "P (CY None)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1118
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1119
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1120
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1121
lemma "P (CY (Some (\<lambda>a. CY None)))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1122
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1123
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1124
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1125
lemma "YOpt_rec_1 cy n s (CY x) = cy x (YOpt_rec_2 cy n s x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1126
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1127
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1128
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1129
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1130
lemma "YOpt_rec_2 cy n s None = n"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1131
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1132
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1133
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1134
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1135
lemma "YOpt_rec_2 cy n s (Some x) = s x (\<lambda>a. YOpt_rec_1 cy n s (x a))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1136
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1137
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1138
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1139
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1140
lemma "P (YOpt_rec_1 cy n s x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1141
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1142
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1143
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1144
lemma "P (YOpt_rec_2 cy n s x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1145
  refute
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1146
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1147
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
  1148
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
  1149
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1150
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
  1151
  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
  1152
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
  1153
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1154
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
  1155
  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
  1156
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
  1157
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1158
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
  1159
  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
  1160
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
  1161
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1162
lemma "Trie_rec_1 tr nil cons (TR x) = tr x (Trie_rec_2 tr nil cons x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1163
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1164
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1165
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1166
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1167
lemma "Trie_rec_2 tr nil cons [] = nil"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1168
  refute [maxsize=3]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1169
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1170
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1171
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1172
lemma "Trie_rec_2 tr nil cons (x#xs) = cons x xs (Trie_rec_1 tr nil cons x) (Trie_rec_2 tr nil cons xs)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1173
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1174
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1175
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1176
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1177
lemma "P (Trie_rec_1 tr nil cons x)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1178
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1179
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1180
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1181
lemma "P (Trie_rec_2 tr nil cons 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
  1182
  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
  1183
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
  1184
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1185
datatype InfTree = Leaf | Node "nat \<Rightarrow> InfTree"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1186
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1187
lemma "P (x::InfTree)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1188
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1189
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1190
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
  1191
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
  1192
  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
  1193
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
  1194
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1195
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
  1196
  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
  1197
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
  1198
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1199
lemma "InfTree_rec leaf node Leaf = leaf"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1200
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1201
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1202
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1203
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1204
lemma "InfTree_rec leaf node (Node x) = node x (\<lambda>n. InfTree_rec leaf node (x n))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1205
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1206
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1207
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1208
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
  1209
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
  1210
  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
  1211
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
  1212
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1213
datatype 'a lambda = Var 'a | App "'a lambda" "'a lambda" | Lam "'a \<Rightarrow> 'a lambda"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1214
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
  1215
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
  1216
  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
  1217
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
  1218
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1219
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
  1220
  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
  1221
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
  1222
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1223
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
  1224
  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
  1225
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
  1226
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1227
lemma "lambda_rec var app lam (Var x) = var x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1228
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1229
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1230
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1231
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1232
lemma "lambda_rec var app lam (App x y) = app x y (lambda_rec var app lam x) (lambda_rec var app lam y)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1233
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1234
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1235
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1236
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1237
lemma "lambda_rec var app lam (Lam x) = lam x (\<lambda>a. lambda_rec var app lam (x a))"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1238
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1239
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1240
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1241
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
  1242
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
  1243
  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
  1244
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
  1245
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1246
text {* Taken from "Inductive datatypes in HOL", p.8: *}
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1247
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1248
datatype ('a, 'b) T = C "'a \<Rightarrow> bool" | D "'b list"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1249
datatype 'c U = E "('c, 'c U) T"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1250
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1251
lemma "P (x::'c U)"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1252
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1253
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1254
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1255
lemma "\<forall>x::'c U. P x"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1256
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1257
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1258
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1259
lemma "P (E (C (\<lambda>a. True)))"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1260
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1261
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1262
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1263
lemma "U_rec_1 e c d nil cons (E x) = e x (U_rec_2 e c d nil cons x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1264
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1265
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1266
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1267
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1268
lemma "U_rec_2 e c d nil cons (C x) = c x"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1269
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1270
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1271
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1272
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1273
lemma "U_rec_2 e c d nil cons (D x) = d x (U_rec_3 e c d nil cons x)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1274
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1275
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1276
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1277
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1278
lemma "U_rec_3 e c d nil cons [] = nil"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1279
  refute [maxsize=2]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1280
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1281
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1282
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1283
lemma "U_rec_3 e c d nil cons (x#xs) = cons x xs (U_rec_1 e c d nil cons x) (U_rec_3 e c d nil cons xs)"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1284
  refute [maxsize=1]
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1285
  apply simp
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1286
done
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1287
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1288
lemma "P (U_rec_1 e c d nil cons x)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1289
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1290
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1291
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1292
lemma "P (U_rec_2 e c d nil cons x)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1293
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1294
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1295
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1296
lemma "P (U_rec_3 e c d nil cons x)"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1297
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1298
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1299
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1300
ML {* quick_and_dirty := Refute_Examples_qnd; *}
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1301
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1302
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1303
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1304
subsubsection {* Records *}
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1305
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1306
(*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
  1307
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1308
record ('a, 'b) point =
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1309
  xpos :: 'a
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1310
  ypos :: 'b
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1311
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1312
lemma "(x::('a, 'b) point) = y"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1313
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1314
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1315
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1316
record ('a, 'b, 'c) extpoint = "('a, 'b) point" +
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1317
  ext :: 'c
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1318
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1319
lemma "(x::('a, 'b, 'c) extpoint) = y"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1320
  refute
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1321
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1322
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1323
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1324
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1325
subsubsection {* Inductively defined sets *}
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1326
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1327
inductive_set arbitrarySet :: "'a set"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1328
where
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1329
  "arbitrary : arbitrarySet"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1330
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1331
lemma "x : arbitrarySet"
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1332
  refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1333
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1334
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1335
inductive_set evenCard :: "'a set set"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1336
where
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1337
  "{} : evenCard"
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1338
| "\<lbrakk> S : evenCard; x \<notin> S; y \<notin> S; x \<noteq> y \<rbrakk> \<Longrightarrow> S \<union> {x, y} : evenCard"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1339
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1340
lemma "S : evenCard"
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1341
  refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1342
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1343
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1344
inductive_set
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1345
  even :: "nat set"
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1346
  and odd  :: "nat set"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1347
where
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1348
  "0 : even"
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1349
| "n : even \<Longrightarrow> Suc n : odd"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1350
| "n : odd \<Longrightarrow> Suc n : even"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1351
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1352
lemma "n : odd"
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1353
  (*refute*)  (* TODO: there seems to be an issue here with undefined terms
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1354
                       because of the recursive datatype "nat" *)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1355
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1356
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1357
consts f :: "'a \<Rightarrow> 'a"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1358
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1359
inductive_set
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1360
  a_even :: "'a set"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1361
  and a_odd :: "'a set"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1362
where
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1363
  "arbitrary : a_even"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1364
| "x : a_even \<Longrightarrow> f x : a_odd"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1365
| "x : a_odd \<Longrightarrow> f x : a_even"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1366
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1367
lemma "x : a_odd"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1368
  refute  -- {* finds a model of size 2, as expected *}
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1369
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1370
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1371
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1372
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1373
subsubsection {* 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
  1374
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1375
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
  1376
  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
  1377
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
  1378
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1379
lemma "finite x"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1380
  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
  1381
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
  1382
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1383
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
  1384
  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
  1385
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
  1386
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1387
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
  1388
  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
  1389
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
  1390
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1391
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
  1392
  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
  1393
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
  1394
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1395
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
  1396
  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
  1397
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
  1398
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1399
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
  1400
  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
  1401
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
  1402
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1403
(* TODO: an efficient interpreter for @ is needed here
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
  1404
lemma "xs @ [] = ys @ []"
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
  1405
  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
  1406
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
  1407
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
  1408
lemma "xs @ ys = ys @ xs"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1409
  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
  1410
oops
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1411
*)
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
  1412
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1413
lemma "f (lfp f) = lfp f"
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1414
  refute
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1415
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1416
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1417
lemma "f (gfp f) = gfp f"
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1418
  refute
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1419
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1420
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1421
lemma "lfp f = gfp f"
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1422
  refute
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1423
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1424
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1425
(*****************************************************************************)
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
  1426
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1427
subsubsection {* Axiomatic type classes and overloading *}
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
  1428
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1429
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
  1430
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1431
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
  1432
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1433
lemma "P (x::'a::classA)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1434
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1435
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1436
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
  1437
text {* The axiom of this type class does not contain any type variables: *}
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
  1438
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1439
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
  1440
  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
  1441
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1442
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
  1443
  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
  1444
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
  1445
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1446
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
  1447
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1448
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
  1449
  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
  1450
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1451
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
  1452
  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
  1453
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
  1454
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1455
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
  1456
  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
  1457
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
  1458
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1459
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
  1460
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1461
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
  1462
  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
  1463
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1464
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
  1465
  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
  1466
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1467
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
  1468
  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
  1469
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
  1470
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1471
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
  1472
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1473
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
  1474
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1475
lemma "P (x::'a::classE)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1476
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1477
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1478
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
  1479
lemma "P (x::'a::{classB, classE})"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1480
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1481
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1482
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
  1483
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
  1484
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1485
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
  1486
  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
  1487
  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
  1488
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
  1489
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1490
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
  1491
  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
  1492
  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
  1493
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
  1494
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1495
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
  1496
  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
  1497
  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
  1498
  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
  1499
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
  1500
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1501
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
  1502
  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
  1503
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
  1504
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1505
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
  1506
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1507
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
  1508
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1509
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
  1510
  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
  1511
  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
  1512
  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
  1513
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1514
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
  1515
  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
  1516
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
  1517
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1518
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
  1519
  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
  1520
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
  1521
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1522
lemma "P (inverse (p::'a\<times>'b))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1523
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1524
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1525
18774
7cf74a743c32 works with DPLL solver now
webertj
parents: 16910
diff changeset
  1526
refute_params [satsolver="auto"]
7cf74a743c32 works with DPLL solver now
webertj
parents: 16910
diff changeset
  1527
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1528
end