src/HOL/ex/Refute_Examples.thy
author blanchet
Mon, 01 Sep 2014 17:34:03 +0200
changeset 58129 3ec65a7f2b50
parent 56851 35ff4ede3409
child 58143 7f7026ae9dc5
permissions -rw-r--r--
ported Refute to use new datatypes when possible
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
    Author:     Tjark Weber
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
     3
    Copyright   2003-2007
32968
wenzelm
parents: 28524
diff changeset
     4
wenzelm
parents: 28524
diff changeset
     5
See HOL/Refute.thy for help.
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     6
*)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     7
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     8
header {* Examples for the 'refute' command *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     9
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    10
theory Refute_Examples
49988
ef811090e106 fixes related to Refute's move
blanchet
parents: 49834
diff changeset
    11
imports "~~/src/HOL/Library/Refute"
15297
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
56851
35ff4ede3409 renamed 'dpll_p' to 'cdclite', to avoid confusion with the old 'dpll' and to reflect the idea that the new prover implements some ideas from CDCL not in DPLL -- this follows its author's, Sascha B.'s, wish
blanchet
parents: 56845
diff changeset
    14
refute_params [satsolver = "cdclite"]
18774
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    17
apply (rule conjI)
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    18
refute [expect = genuine] 1  -- {* refutes @{term "P"} *}
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    19
refute [expect = genuine] 2  -- {* refutes @{term "Q"} *}
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    20
refute [expect = genuine]    -- {* equivalent to 'refute 1' *}
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    21
  -- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *}
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    22
refute [maxsize = 5, expect = genuine]   -- {* we can override parameters ... *}
56851
35ff4ede3409 renamed 'dpll_p' to 'cdclite', to avoid confusion with the old 'dpll' and to reflect the idea that the new prover implements some ideas from CDCL not in DPLL -- this follows its author's, Sascha B.'s, wish
blanchet
parents: 56845
diff changeset
    23
refute [satsolver = "cdclite", expect = genuine] 2
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    24
  -- {* ... and specify a subgoal at the same time *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    25
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    26
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
    27
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
    28
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
    29
subsection {* Examples and Test Cases *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    30
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
    31
subsubsection {* Propositional logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    32
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    33
lemma "True"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    34
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    35
by auto
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    36
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    37
lemma "False"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    38
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    42
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    46
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    50
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    54
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    58
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    62
refute [expect = genuine]
14350
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)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    66
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    74
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    78
refute [expect = genuine]
14350
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)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    82
refute [expect = genuine]
14455
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    90
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    94
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
    98
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   102
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   106
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   110
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   111
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   112
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   113
lemma "distinct [a, b]"
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   114
(* refute *)
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   115
apply simp
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   116
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   124
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   128
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   132
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   136
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   140
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   144
refute [expect = genuine]
14350
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)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   148
refute [expect = genuine]
14350
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)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   152
refute [expect = genuine]
14350
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)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   156
refute [expect = genuine]
14350
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   162
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   163
by fast
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   164
18789
8a5c6fc3ad27 smaller example to prevent timeout
webertj
parents: 18774
diff changeset
   165
text {* "A type has at most 4 elements." *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   166
18789
8a5c6fc3ad27 smaller example to prevent timeout
webertj
parents: 18774
diff changeset
   167
lemma "a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   168
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   169
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   170
18789
8a5c6fc3ad27 smaller example to prevent timeout
webertj
parents: 18774
diff changeset
   171
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   172
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   173
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   174
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   175
text {* "Every reflexive and symmetric relation is transitive." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   176
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   177
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"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   178
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   179
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   180
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   181
text {* The "Drinker's theorem" ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   182
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   183
lemma "\<exists>x. f x = g x \<longrightarrow> f = g"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   184
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   185
by (auto simp add: ext)
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   186
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   187
text {* ... and an incorrect version of it *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   188
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   189
lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   190
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   191
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   192
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   193
text {* "Every function has a fixed point." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   194
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   195
lemma "\<exists>x. f x = x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   196
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   197
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   198
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   199
text {* "Function composition is commutative." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   200
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   201
lemma "f (g x) = g (f x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   202
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   203
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   204
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   205
text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   206
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   207
lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   208
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   209
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   210
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   211
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   212
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   213
subsubsection {* Higher-Order Logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   214
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   215
lemma "\<exists>P. P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   216
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   217
by auto
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   218
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   219
lemma "\<forall>P. P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   220
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   221
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   222
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   223
lemma "EX! P. P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   224
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   225
by auto
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   226
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   227
lemma "EX! P. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   228
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   229
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   230
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   231
lemma "P Q | Q x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   232
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   233
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   234
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   235
lemma "x \<noteq> All"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   236
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   237
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   238
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   239
lemma "x \<noteq> Ex"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   240
refute [expect = genuine]
14455
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> Ex1"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   244
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   245
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   246
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   247
text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   248
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35315
diff changeset
   249
definition "trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   250
  "trans P == (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)"
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35315
diff changeset
   251
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35315
diff changeset
   252
definition "subset" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   253
  "subset P Q == (ALL x y. P x y \<longrightarrow> Q x y)"
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35315
diff changeset
   254
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 35315
diff changeset
   255
definition "trans_closure" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   256
  "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
   257
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   258
lemma "trans_closure T P \<longrightarrow> (\<exists>x y. T x y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   259
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   260
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   261
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   262
text {* "The union of transitive closures is equal to the transitive closure of unions." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   263
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   264
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
   265
        \<longrightarrow> trans_closure TP P
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   266
        \<longrightarrow> trans_closure TR R
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   267
        \<longrightarrow> (T x y = (TP x y | TR x y))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   268
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   269
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   270
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   271
text {* "Every surjective function is invertible." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   272
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   273
lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   274
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   275
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   276
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   277
text {* "Every invertible function is surjective." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   278
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   279
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   280
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   281
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   282
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   283
text {* Every point is a fixed point of some function. *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   284
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   285
lemma "\<exists>f. f x = x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   286
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   287
apply (rule_tac x="\<lambda>x. x" in exI)
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   288
by simp
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   289
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   290
text {* Axiom of Choice: first an incorrect version ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   291
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   292
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   293
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   294
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   295
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   296
text {* ... and now two correct ones *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   297
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   298
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   299
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   300
by (simp add: choice)
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   301
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   302
lemma "(\<forall>x. EX!y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   303
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   304
apply auto
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   305
  apply (simp add: ex1_implies_ex choice)
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   306
by (fast intro: ext)
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   307
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   308
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   309
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   310
subsubsection {* Meta-logic *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   311
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   312
lemma "!!x. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   313
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   314
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   315
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   316
lemma "f x == g x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   317
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   318
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   319
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   320
lemma "P \<Longrightarrow> Q"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   321
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   322
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   323
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   324
lemma "\<lbrakk> P; Q; R \<rbrakk> \<Longrightarrow> S"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   325
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   326
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   327
56245
84fc7dfa3cd4 more qualified names;
wenzelm
parents: 55867
diff changeset
   328
lemma "(x == Pure.all) \<Longrightarrow> False"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   329
refute [expect = genuine]
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   330
oops
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   331
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   332
lemma "(x == (op ==)) \<Longrightarrow> False"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   333
refute [expect = genuine]
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   334
oops
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   335
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   336
lemma "(x == (op \<Longrightarrow>)) \<Longrightarrow> False"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   337
refute [expect = genuine]
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   338
oops
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   339
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   340
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   341
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   342
subsubsection {* Schematic variables *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   343
36319
8feb2c4bef1a mark schematic statements explicitly;
wenzelm
parents: 36131
diff changeset
   344
schematic_lemma "?P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   345
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   346
by auto
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   347
36319
8feb2c4bef1a mark schematic statements explicitly;
wenzelm
parents: 36131
diff changeset
   348
schematic_lemma "x = ?y"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   349
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   350
by auto
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   351
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   352
(******************************************************************************)
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   353
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   354
subsubsection {* Abstractions *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   355
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   356
lemma "(\<lambda>x. x) = (\<lambda>x. y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   357
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   358
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   359
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   360
lemma "(\<lambda>f. f x) = (\<lambda>f. True)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   361
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   362
oops
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>y. y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   365
refute
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   366
by simp
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   367
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   368
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   369
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   370
subsubsection {* Sets *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   371
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   372
lemma "P (A::'a set)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   373
refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   374
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   375
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   376
lemma "P (A::'a set set)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   377
refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   378
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   379
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   380
lemma "{x. P x} = {y. P y}"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   381
refute
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   382
by simp
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   383
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   384
lemma "x : {x. P x}"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   385
refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   386
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   387
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   388
lemma "P op:"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   389
refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   390
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   391
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   392
lemma "P (op: x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   393
refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   394
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   395
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   396
lemma "P Collect"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   397
refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   398
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   399
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   400
lemma "A Un B = A Int B"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   401
refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   402
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   403
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   404
lemma "(A Int B) Un C = (A Un C) Int B"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   405
refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   406
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   407
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   408
lemma "Ball A P \<longrightarrow> Bex A P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   409
refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   410
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   411
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   412
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   413
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
   414
subsubsection {* undefined *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   415
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
   416
lemma "undefined"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   417
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   418
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   419
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
   420
lemma "P undefined"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   421
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   422
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   423
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
   424
lemma "undefined x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   425
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   426
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   427
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
   428
lemma "undefined undefined"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   429
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   430
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   431
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   432
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   433
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   434
subsubsection {* The *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   435
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   436
lemma "The P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   437
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   438
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   439
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   440
lemma "P The"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   441
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   442
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   443
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   444
lemma "P (The P)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   445
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   446
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   447
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   448
lemma "(THE x. x=y) = z"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   449
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   450
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   451
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   452
lemma "Ex P \<longrightarrow> P (The P)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   453
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   454
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   455
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   456
(*****************************************************************************)
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
   457
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   458
subsubsection {* Eps *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   459
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   460
lemma "Eps P"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   461
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   462
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   463
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   464
lemma "P Eps"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   465
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   466
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   467
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   468
lemma "P (Eps P)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   469
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   470
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   471
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   472
lemma "(SOME x. x=y) = z"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   473
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   474
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   475
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   476
lemma "Ex P \<longrightarrow> P (Eps P)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   477
refute [maxsize = 3, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   478
by (auto simp add: someI)
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   479
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   480
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   481
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   482
subsubsection {* Subtypes (typedef), typedecl *}
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   483
15161
065ce5385a06 comment modified
webertj
parents: 14809
diff changeset
   484
text {* A completely unspecified non-empty subset of @{typ "'a"}: *}
065ce5385a06 comment modified
webertj
parents: 14809
diff changeset
   485
45694
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 37388
diff changeset
   486
definition "myTdef = insert (undefined::'a) (undefined::'a set)"
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 37388
diff changeset
   487
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 46099
diff changeset
   488
typedef 'a myTdef = "myTdef :: 'a set"
45694
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 37388
diff changeset
   489
  unfolding myTdef_def by auto
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   490
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   491
lemma "(x::'a myTdef) = y"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   492
refute
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   493
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   494
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   495
typedecl myTdecl
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   496
45694
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 37388
diff changeset
   497
definition "T_bij = {(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}"
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 37388
diff changeset
   498
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 46099
diff changeset
   499
typedef 'a T_bij = "T_bij :: ('a \<Rightarrow> 'a) set"
45694
4a8743618257 prefer typedef without extra definition and alternative name;
wenzelm
parents: 37388
diff changeset
   500
  unfolding T_bij_def by auto
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   501
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   502
lemma "P (f::(myTdecl myTdef) T_bij)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   503
refute
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   504
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   505
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   506
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
   507
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   508
subsubsection {* Inductive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   509
21502
7f3ea2b3bab6 prefer antiquotations over LaTeX macros;
wenzelm
parents: 18789
diff changeset
   510
text {* With @{text quick_and_dirty} set, the datatype package does
7f3ea2b3bab6 prefer antiquotations over LaTeX macros;
wenzelm
parents: 18789
diff changeset
   511
  not generate certain axioms for recursion operators.  Without these
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   512
  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
   513
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   514
text {* unit *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   515
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   516
lemma "P (x::unit)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   517
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   518
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   519
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   520
lemma "\<forall>x::unit. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   521
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   522
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   523
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   524
lemma "P ()"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   525
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   526
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   527
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
   528
lemma "P (case x of () \<Rightarrow> u)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   529
refute [expect = genuine]
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
   530
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
   531
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   532
text {* option *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   533
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   534
lemma "P (x::'a option)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   535
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   536
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   537
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   538
lemma "\<forall>x::'a option. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   539
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   540
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   541
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   542
lemma "P None"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   543
refute [expect = genuine]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   544
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   545
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   546
lemma "P (Some x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   547
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   548
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   549
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
   550
lemma "P (case x of None \<Rightarrow> n | Some u \<Rightarrow> s u)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   551
refute [expect = genuine]
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
   552
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
   553
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   554
text {* * *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   555
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   556
lemma "P (x::'a*'b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   557
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   558
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   559
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   560
lemma "\<forall>x::'a*'b. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   561
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   562
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   563
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   564
lemma "P (x, y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   565
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   566
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   567
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   568
lemma "P (fst x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   569
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   570
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   571
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   572
lemma "P (snd x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   573
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   574
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   575
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   576
lemma "P Pair"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   577
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   578
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   579
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
   580
lemma "P (case x of Pair a b \<Rightarrow> p a b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   581
refute [expect = genuine]
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
   582
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
   583
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   584
text {* + *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   585
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   586
lemma "P (x::'a+'b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   587
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   588
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   589
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   590
lemma "\<forall>x::'a+'b. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   591
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   592
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   593
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   594
lemma "P (Inl x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   595
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   596
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   597
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   598
lemma "P (Inr x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   599
refute [expect = genuine]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   600
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   601
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   602
lemma "P Inl"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   603
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   604
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   605
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
   606
lemma "P (case x of Inl a \<Rightarrow> l a | Inr b \<Rightarrow> r b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   607
refute [expect = genuine]
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
   608
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
   609
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   610
text {* Non-recursive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   611
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   612
datatype_new T1 = A | B
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   613
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   614
lemma "P (x::T1)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   615
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   616
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   617
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   618
lemma "\<forall>x::T1. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   619
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   620
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   621
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   622
lemma "P A"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   623
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   624
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   625
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   626
lemma "P B"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   627
refute [expect = genuine]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   628
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   629
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   630
lemma "rec_T1 a b A = a"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   631
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   632
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   633
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   634
lemma "rec_T1 a b B = b"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   635
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   636
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   637
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   638
lemma "P (rec_T1 a b x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   639
refute [expect = genuine]
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
   640
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
   641
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   642
lemma "P (case x of A \<Rightarrow> a | B \<Rightarrow> b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   643
refute [expect = genuine]
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
   644
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
   645
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   646
datatype_new 'a T2 = C T1 | D 'a
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   647
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   648
lemma "P (x::'a T2)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   649
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   650
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   651
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   652
lemma "\<forall>x::'a T2. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   653
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   654
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   655
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   656
lemma "P D"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   657
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   658
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   659
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   660
lemma "rec_T2 c d (C x) = c x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   661
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   662
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   663
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   664
lemma "rec_T2 c d (D x) = d x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   665
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   666
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   667
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   668
lemma "P (rec_T2 c d x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   669
refute [expect = genuine]
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
   670
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
   671
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   672
lemma "P (case x of C u \<Rightarrow> c u | D v \<Rightarrow> d v)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   673
refute [expect = genuine]
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
   674
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
   675
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   676
datatype_new ('a,'b) T3 = E "'a \<Rightarrow> 'b"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   677
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   678
lemma "P (x::('a,'b) T3)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   679
refute [expect = genuine]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   680
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   681
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   682
lemma "\<forall>x::('a,'b) T3. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   683
refute [expect = genuine]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   684
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   685
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   686
lemma "P E"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   687
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   688
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   689
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   690
lemma "rec_T3 e (E x) = e x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   691
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   692
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   693
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   694
lemma "P (rec_T3 e x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   695
refute [expect = genuine]
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
   696
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
   697
f08e2d83681e major code change: 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
lemma "P (case x of E f \<Rightarrow> e f)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   699
refute [expect = genuine]
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
   700
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
   701
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   702
text {* Recursive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   703
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
   704
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
   705
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   706
lemma "P (x::nat)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   707
refute [expect = potential]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   708
oops
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   709
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   710
lemma "\<forall>x::nat. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   711
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   712
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   713
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   714
lemma "P (Suc 0)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   715
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   716
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   717
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   718
lemma "P Suc"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   719
refute [maxsize = 3, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   720
-- {* @{term Suc} is a partial function (regardless of the size
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   721
      of the model), hence @{term "P Suc"} is undefined and no
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   722
      model will be found *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   723
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   724
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 55413
diff changeset
   725
lemma "rec_nat zero suc 0 = zero"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   726
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   727
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   728
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 55413
diff changeset
   729
lemma "rec_nat zero suc (Suc x) = suc x (rec_nat zero suc x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   730
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   731
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   732
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 55413
diff changeset
   733
lemma "P (rec_nat zero suc x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   734
refute [expect = potential]
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
   735
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
   736
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   737
lemma "P (case x of 0 \<Rightarrow> zero | Suc n \<Rightarrow> suc n)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   738
refute [expect = potential]
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
   739
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
   740
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   741
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
   742
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   743
lemma "P (xs::'a list)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   744
refute [expect = potential]
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
   745
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
   746
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   747
lemma "\<forall>xs::'a list. P xs"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   748
refute [expect = potential]
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
   749
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
   750
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   751
lemma "P [x, y]"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   752
refute [expect = potential]
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
   753
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
   754
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 55395
diff changeset
   755
lemma "rec_list nil cons [] = nil"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   756
refute [maxsize = 3, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   757
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   758
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 55395
diff changeset
   759
lemma "rec_list nil cons (x#xs) = cons x xs (rec_list nil cons xs)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   760
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   761
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   762
55413
a8e96847523c adapted theories to '{case,rec}_{list,option}' names
blanchet
parents: 55395
diff changeset
   763
lemma "P (rec_list nil cons xs)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   764
refute [expect = potential]
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
   765
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
   766
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   767
lemma "P (case x of Nil \<Rightarrow> nil | Cons a b \<Rightarrow> cons a b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   768
refute [expect = potential]
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
   769
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
   770
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   771
lemma "(xs::'a list) = ys"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   772
refute [expect = potential]
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
   773
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
   774
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   775
lemma "a # xs = b # xs"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   776
refute [expect = potential]
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
   777
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
   778
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   779
datatype_new BitList = BitListNil | Bit0 BitList | Bit1 BitList
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   780
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   781
lemma "P (x::BitList)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   782
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   783
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   784
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   785
lemma "\<forall>x::BitList. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   786
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   787
oops
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 "P (Bit0 (Bit1 BitListNil))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   790
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   791
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   792
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   793
lemma "rec_BitList nil bit0 bit1 BitListNil = nil"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   794
refute [maxsize = 4, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   795
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   796
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   797
lemma "rec_BitList nil bit0 bit1 (Bit0 xs) = bit0 xs (rec_BitList nil bit0 bit1 xs)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   798
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   799
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   800
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   801
lemma "rec_BitList nil bit0 bit1 (Bit1 xs) = bit1 xs (rec_BitList nil bit0 bit1 xs)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   802
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   803
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   804
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   805
lemma "P (rec_BitList nil bit0 bit1 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   806
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   807
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   808
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   809
datatype_new 'a BinTree = Leaf 'a | Node "'a BinTree" "'a BinTree"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   810
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   811
lemma "P (x::'a BinTree)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   812
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   813
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   814
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   815
lemma "\<forall>x::'a BinTree. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   816
refute [expect = potential]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   817
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   818
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   819
lemma "P (Node (Leaf x) (Leaf y))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   820
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   821
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   822
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   823
lemma "rec_BinTree l n (Leaf x) = l x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   824
  refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   825
  (* The "maxsize = 1" tests are a bit pointless: for some formulae
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   826
     below, refute will find no countermodel simply because this
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   827
     size makes involved terms undefined.  Unfortunately, any
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   828
     larger size already takes too long. *)
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   829
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   830
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   831
lemma "rec_BinTree l n (Node x y) = n x y (rec_BinTree l n x) (rec_BinTree l n y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   832
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   833
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   834
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   835
lemma "P (rec_BinTree l n x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   836
refute [expect = potential]
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
   837
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
   838
f08e2d83681e major code change: 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
lemma "P (case x of Leaf a \<Rightarrow> l a | Node a b \<Rightarrow> n a b)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   840
refute [expect = potential]
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
   841
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
   842
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   843
text {* Mutually recursive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   844
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   845
datatype_new
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   846
  'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp" and
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   847
  'a bexp = Equal "'a aexp" "'a aexp"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   848
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   849
lemma "P (x::'a aexp)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   850
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   851
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   852
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   853
lemma "\<forall>x::'a aexp. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   854
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   855
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   856
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
   857
lemma "P (ITE (Equal (Number x) (Number y)) (Number x) (Number y))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   858
refute [expect = potential]
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
   859
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
   860
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   861
lemma "P (x::'a bexp)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   862
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   863
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   864
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   865
lemma "\<forall>x::'a bexp. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   866
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   867
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   868
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   869
lemma "rec_aexp number ite equal (Number x) = number x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   870
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   871
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   872
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   873
lemma "rec_aexp number ite equal (ITE x y z) = ite x y z (rec_bexp number ite equal x) (rec_aexp number ite equal y) (rec_aexp number ite equal z)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   874
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   875
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   876
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   877
lemma "P (rec_aexp number ite equal x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   878
refute [expect = potential]
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
   879
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
   880
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   881
lemma "P (case x of Number a \<Rightarrow> number a | ITE b a1 a2 \<Rightarrow> ite b a1 a2)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   882
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   883
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   884
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   885
lemma "rec_bexp number ite equal (Equal x y) = equal x y (rec_aexp number ite equal x) (rec_aexp number ite equal y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   886
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   887
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   888
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   889
lemma "P (rec_bexp number ite equal x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   890
refute [expect = potential]
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
   891
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
   892
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
   893
lemma "P (case x of Equal a1 a2 \<Rightarrow> equal a1 a2)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   894
refute [expect = potential]
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
   895
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
   896
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   897
datatype_new
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   898
  X = A | B X | C Y and
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   899
  Y = D X | E Y | F
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   900
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   901
lemma "P (x::X)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   902
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   903
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   904
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   905
lemma "P (y::Y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   906
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   907
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   908
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   909
lemma "P (B (B A))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   910
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   911
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   912
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   913
lemma "P (B (C F))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   914
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   915
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   916
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   917
lemma "P (C (D A))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   918
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   919
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   920
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   921
lemma "P (C (E F))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   922
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   923
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   924
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   925
lemma "P (D (B A))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   926
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   927
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   928
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   929
lemma "P (D (C F))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   930
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   931
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   932
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   933
lemma "P (E (D A))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   934
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   935
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   936
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   937
lemma "P (E (E F))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   938
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   939
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   940
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   941
lemma "P (C (D (C F)))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   942
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   943
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   944
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   945
lemma "rec_X a b c d e f A = a"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   946
refute [maxsize = 3, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   947
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   948
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   949
lemma "rec_X a b c d e f (B x) = b x (rec_X a b c d e f x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   950
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   951
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   952
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   953
lemma "rec_X a b c d e f (C y) = c y (rec_Y a b c d e f y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   954
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   955
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   956
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   957
lemma "rec_Y a b c d e f (D x) = d x (rec_X a b c d e f x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   958
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   959
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   960
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   961
lemma "rec_Y a b c d e f (E y) = e y (rec_Y a b c d e f y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   962
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   963
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   964
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   965
lemma "rec_Y a b c d e f F = f"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   966
refute [maxsize = 3, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   967
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   968
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   969
lemma "P (rec_X a b c d e f x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   970
refute [expect = potential]
25014
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
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
   973
lemma "P (rec_Y a b c d e f y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   974
refute [expect = potential]
25014
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
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
   977
text {* Other datatype examples *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   978
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   979
text {* Indirect recursion is implemented via mutual recursion. *}
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
datatype XOpt = CX "XOpt option" | DX "bool \<Rightarrow> XOpt option"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   982
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   983
lemma "P (x::XOpt)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   984
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   985
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   986
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   987
lemma "P (CX None)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   988
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   989
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   990
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   991
lemma "P (CX (Some (CX None)))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   992
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   993
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   994
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   995
lemma "rec_XOpt_1 cx dx n1 s1 n2 s2 (CX x) = cx x (rec_XOpt_2 cx dx n1 s1 n2 s2 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   996
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
   997
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
   998
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
   999
lemma "rec_XOpt_1 cx dx n1 s1 n2 s2 (DX x) = dx x (\<lambda>b. rec_XOpt_3 cx dx n1 s1 n2 s2 (x b))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1000
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1001
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1002
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1003
lemma "rec_XOpt_2 cx dx n1 s1 n2 s2 None = n1"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1004
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1005
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1006
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1007
lemma "rec_XOpt_2 cx dx n1 s1 n2 s2 (Some x) = s1 x (rec_XOpt_1 cx dx n1 s1 n2 s2 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1008
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1009
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1010
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1011
lemma "rec_XOpt_3 cx dx n1 s1 n2 s2 None = n2"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1012
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1013
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1014
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1015
lemma "rec_XOpt_3 cx dx n1 s1 n2 s2 (Some x) = s2 x (rec_XOpt_1 cx dx n1 s1 n2 s2 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1016
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1017
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1018
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1019
lemma "P (rec_XOpt_1 cx dx n1 s1 n2 s2 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1020
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1021
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1022
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1023
lemma "P (rec_XOpt_2 cx dx n1 s1 n2 s2 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1024
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1025
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1026
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1027
lemma "P (rec_XOpt_3 cx dx n1 s1 n2 s2 x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1028
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1029
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1030
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1031
datatype 'a YOpt = CY "('a \<Rightarrow> 'a YOpt) option"
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 "P (x::'a YOpt)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1034
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1035
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1036
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1037
lemma "P (CY None)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1038
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1039
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1040
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1041
lemma "P (CY (Some (\<lambda>a. CY None)))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1042
refute [expect = potential]
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1043
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1044
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1045
lemma "rec_YOpt_1 cy n s (CY x) = cy x (rec_YOpt_2 cy n s x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1046
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1047
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1048
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1049
lemma "rec_YOpt_2 cy n s None = n"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1050
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1051
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1052
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1053
lemma "rec_YOpt_2 cy n s (Some x) = s x (\<lambda>a. rec_YOpt_1 cy n s (x a))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1054
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1055
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1056
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1057
lemma "P (rec_YOpt_1 cy n s x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1058
refute [expect = potential]
25014
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
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1061
lemma "P (rec_YOpt_2 cy n s x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1062
refute [expect = potential]
25014
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
58129
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
  1065
datatype_new Trie = TR "Trie list"
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
  1066
datatype_compat Trie
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
  1067
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
  1068
abbreviation "rec_Trie_1 \<equiv> compat_Trie.n2m_Trie_rec"
3ec65a7f2b50 ported Refute to use new datatypes when possible
blanchet
parents: 56851
diff changeset
  1069
abbreviation "rec_Trie_2 \<equiv> compat_Trie_list.n2m_Trie_list_rec"
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
  1070
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1071
lemma "P (x::Trie)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1072
refute [expect = potential]
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
  1073
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
  1074
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1075
lemma "\<forall>x::Trie. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1076
refute [expect = potential]
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
  1077
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
  1078
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1079
lemma "P (TR [TR []])"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1080
refute [expect = potential]
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
  1081
oops
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1082
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1083
lemma "rec_Trie_1 tr nil cons (TR x) = tr x (rec_Trie_2 tr nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1084
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1085
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1086
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1087
lemma "rec_Trie_2 tr nil cons [] = nil"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1088
refute [maxsize = 3, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1089
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1090
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1091
lemma "rec_Trie_2 tr nil cons (x#xs) = cons x xs (rec_Trie_1 tr nil cons x) (rec_Trie_2 tr nil cons xs)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1092
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1093
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1094
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1095
lemma "P (rec_Trie_1 tr nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1096
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1097
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1098
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1099
lemma "P (rec_Trie_2 tr nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1100
refute [expect = potential]
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
  1101
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
  1102
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1103
datatype InfTree = Leaf | Node "nat \<Rightarrow> InfTree"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1104
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1105
lemma "P (x::InfTree)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1106
refute [expect = potential]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1107
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1108
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
  1109
lemma "\<forall>x::InfTree. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1110
refute [expect = potential]
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
  1111
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
  1112
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1113
lemma "P (Node (\<lambda>n. Leaf))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1114
refute [expect = potential]
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
  1115
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
  1116
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1117
lemma "rec_InfTree leaf node Leaf = leaf"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1118
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1119
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1120
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1121
lemma "rec_InfTree leaf node (Node x) = node x (\<lambda>n. rec_InfTree leaf node (x n))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1122
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1123
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1124
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1125
lemma "P (rec_InfTree leaf node x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1126
refute [expect = potential]
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
  1127
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
  1128
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1129
datatype 'a lambda = Var 'a | App "'a lambda" "'a lambda" | Lam "'a \<Rightarrow> 'a lambda"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1130
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
  1131
lemma "P (x::'a lambda)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1132
refute [expect = potential]
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
  1133
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
  1134
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1135
lemma "\<forall>x::'a lambda. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1136
refute [expect = potential]
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
  1137
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
  1138
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1139
lemma "P (Lam (\<lambda>a. Var a))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1140
refute [expect = potential]
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
  1141
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
  1142
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1143
lemma "rec_lambda var app lam (Var x) = var x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1144
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1145
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1146
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1147
lemma "rec_lambda var app lam (App x y) = app x y (rec_lambda var app lam x) (rec_lambda var app lam y)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1148
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1149
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1150
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1151
lemma "rec_lambda var app lam (Lam x) = lam x (\<lambda>a. rec_lambda var app lam (x a))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1152
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1153
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1154
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1155
lemma "P (rec_lambda v a l x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1156
refute [expect = potential]
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
  1157
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
  1158
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1159
text {* Taken from "Inductive datatypes in HOL", p.8: *}
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1160
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1161
datatype ('a, 'b) T = C "'a \<Rightarrow> bool" | D "'b list"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1162
datatype 'c U = E "('c, 'c U) T"
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1163
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1164
lemma "P (x::'c U)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1165
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1166
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1167
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1168
lemma "\<forall>x::'c U. P x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1169
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1170
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1171
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1172
lemma "P (E (C (\<lambda>a. True)))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1173
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1174
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1175
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1176
lemma "rec_U_1 e c d nil cons (E x) = e x (rec_U_2 e c d nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1177
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1178
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1179
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1180
lemma "rec_U_2 e c d nil cons (C x) = c x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1181
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1182
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1183
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1184
lemma "rec_U_2 e c d nil cons (D x) = d x (rec_U_3 e c d nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1185
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1186
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1187
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1188
lemma "rec_U_3 e c d nil cons [] = nil"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1189
refute [maxsize = 2, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1190
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1191
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1192
lemma "rec_U_3 e c d nil cons (x#xs) = cons x xs (rec_U_1 e c d nil cons x) (rec_U_3 e c d nil cons xs)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1193
refute [maxsize = 1, expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1194
by simp
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1195
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1196
lemma "P (rec_U_1 e c d nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1197
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1198
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1199
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1200
lemma "P (rec_U_2 e c d nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1201
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1202
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1203
55416
dd7992d4a61a adapted theories to 'xxx_case' to 'case_xxx'
blanchet
parents: 55415
diff changeset
  1204
lemma "P (rec_U_3 e c d nil cons x)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1205
refute [expect = potential]
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1206
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1207
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1208
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1209
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1210
subsubsection {* Records *}
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1211
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1212
(*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
  1213
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1214
record ('a, 'b) point =
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1215
  xpos :: 'a
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1216
  ypos :: 'b
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1217
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1218
lemma "(x::('a, 'b) point) = y"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1219
refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1220
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1221
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1222
record ('a, 'b, 'c) extpoint = "('a, 'b) point" +
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1223
  ext :: 'c
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1224
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1225
lemma "(x::('a, 'b, 'c) extpoint) = y"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1226
refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1227
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1228
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1229
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1230
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1231
subsubsection {* Inductively defined sets *}
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1232
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1233
inductive_set arbitrarySet :: "'a set"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1234
where
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
  1235
  "undefined : arbitrarySet"
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1236
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1237
lemma "x : arbitrarySet"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1238
refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1239
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1240
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1241
inductive_set evenCard :: "'a set set"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1242
where
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1243
  "{} : evenCard"
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 23219
diff changeset
  1244
| "\<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
  1245
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1246
lemma "S : evenCard"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1247
refute
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1248
oops
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1249
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1250
consts f :: "'a \<Rightarrow> 'a"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1251
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1252
inductive_set
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1253
  a_even :: "'a set"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1254
  and a_odd :: "'a set"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1255
where
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 25032
diff changeset
  1256
  "undefined : a_even"
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1257
| "x : a_even \<Longrightarrow> f x : a_odd"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1258
| "x : a_odd \<Longrightarrow> f x : a_even"
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1259
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1260
lemma "x : a_odd"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1261
(* refute [expect = genuine] -- {* finds a model of size 2 *}
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1262
   NO LONGER WORKS since "lfp"'s interpreter is disabled *)
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1263
oops
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1264
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1265
(*****************************************************************************)
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1266
23219
87ad6e8a5f2c tuned document;
wenzelm
parents: 22284
diff changeset
  1267
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
  1268
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1269
lemma "card x = 0"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1270
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
  1271
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
  1272
15767
8ed9fcc004fe support for recursion over mutually recursive IDTs
webertj
parents: 15547
diff changeset
  1273
lemma "finite x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1274
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
  1275
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
  1276
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1277
lemma "(x::nat) + y = 0"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1278
refute [expect = potential]
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
  1279
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
  1280
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1281
lemma "(x::nat) = x + x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1282
refute [expect = potential]
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
  1283
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
  1284
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1285
lemma "(x::nat) - y + y = x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1286
refute [expect = potential]
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
  1287
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
  1288
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1289
lemma "(x::nat) = x * x"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1290
refute [expect = potential]
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
  1291
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
  1292
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1293
lemma "(x::nat) < x + y"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1294
refute [expect = potential]
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
  1295
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
  1296
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
  1297
lemma "xs @ [] = ys @ []"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1298
refute [expect = potential]
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
  1299
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
  1300
21985
acfb13e8819e constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents: 21559
diff changeset
  1301
lemma "xs @ ys = ys @ xs"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1302
refute [expect = potential]
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
  1303
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
  1304
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1305
lemma "f (lfp f) = lfp f"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1306
refute
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1307
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1308
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1309
lemma "f (gfp f) = gfp f"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1310
refute
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1311
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1312
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1313
lemma "lfp f = gfp f"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1314
refute
16050
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1315
oops
828fc32f390f interpreters for lfp/gfp added
webertj
parents: 15767
diff changeset
  1316
25014
b711b0af178e significant code overhaul, bugfix for inductive data types
webertj
parents: 24447
diff changeset
  1317
(*****************************************************************************)
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
  1318
35315
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1319
subsubsection {* 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
  1320
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1321
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
  1322
35315
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1323
class classA
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
  1324
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1325
lemma "P (x::'a::classA)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1326
refute [expect = genuine]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1327
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1328
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
  1329
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
  1330
35315
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1331
class classC =
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1332
  assumes classC_ax: "\<exists>x y. x \<noteq> 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
  1333
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1334
lemma "P (x::'a::classC)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1335
refute [expect = genuine]
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
  1336
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
  1337
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1338
lemma "\<exists>x y. (x::'a::classC) \<noteq> y"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1339
(* refute [expect = none] FIXME *)
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
  1340
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
  1341
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1342
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
  1343
35315
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1344
class classD =
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1345
  fixes classD_const :: "'a \<Rightarrow> 'a"
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1346
  assumes classD_ax: "classD_const (classD_const x) = classD_const 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
  1347
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1348
lemma "P (x::'a::classD)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1349
refute [expect = genuine]
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
  1350
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
  1351
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1352
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
  1353
35315
fbdc860d87a3 dropped axclass
haftmann
parents: 34120
diff changeset
  1354
class classE = classC + classD
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
  1355
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1356
lemma "P (x::'a::classE)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1357
refute [expect = genuine]
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1358
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
  1359
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
  1360
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
  1361
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1362
lemma "OFCLASS('a::type, type_class)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1363
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1364
by intro_classes
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
  1365
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1366
lemma "OFCLASS('a::classC, type_class)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1367
refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1368
by intro_classes
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
  1369
f08e2d83681e major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents: 15297
diff changeset
  1370
lemma "OFCLASS('a::type, classC_class)"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1371
refute [expect = genuine]
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
  1372
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
  1373
f08e2d83681e major code change: 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
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
  1375
f08e2d83681e major code change: 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
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
  1377
f08e2d83681e major code change: 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
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
  1379
  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
  1380
  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
  1381
  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
  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 "inverse b"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1384
refute [expect = genuine]
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
  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 "P (inverse (S::'a set))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1388
refute [expect = genuine]
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
  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 "P (inverse (p::'a\<times>'b))"
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1392
refute [expect = genuine]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1393
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1394
34120
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1395
text {* Structured proofs *}
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1396
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1397
lemma "x = y"
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1398
proof cases
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1399
  assume "x = y"
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1400
  show ?thesis
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1401
  refute [expect = none]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1402
  refute [no_assms, expect = genuine]
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1403
  refute [no_assms = false, expect = none]
34120
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1404
oops
f9920a3ddf50 added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents: 32968
diff changeset
  1405
46099
40ac5ae6d16f reintroduced 'refute' calls taken out after reintroducing the "set" constructor, and use "expect" feature
blanchet
parents: 45972
diff changeset
  1406
refute_params [satsolver = "auto"]
18774
7cf74a743c32 works with DPLL solver now
webertj
parents: 16910
diff changeset
  1407
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
  1408
end