src/HOL/Nitpick_Examples/Mini_Nits.thy
author wenzelm
Sat, 07 Apr 2012 16:41:59 +0200
changeset 47389 e8552cba702d
parent 45970 b6d0cff57d96
child 48891 c0eafbd55de3
permissions -rw-r--r--
explicit checks stable_finished_theory/stable_command allow parallel asynchronous command transactions; tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     1
(*  Title:      HOL/Nitpick_Examples/Mini_Nits.thy
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     2
    Author:     Jasmin Blanchette, TU Muenchen
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     3
    Copyright   2009-2011
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     4
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     5
Examples featuring Minipick, the minimalistic version of Nitpick.
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     6
*)
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     7
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     8
header {* Examples Featuring Minipick, the Minimalistic Version of Nitpick *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
     9
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    10
theory Mini_Nits
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    11
imports Main
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    12
uses "minipick.ML"
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    13
begin
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    14
45062
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    15
nitpick_params [verbose, sat_solver = MiniSat_JNI, max_threads = 1]
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    16
45062
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    17
nitpick_params [total_consts = smart]
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    18
45062
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    19
ML {*
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    20
val check = Minipick.minipick @{context}
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    21
val expect = Minipick.minipick_expect @{context}
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    22
val none = expect "none"
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    23
val genuine = expect "genuine"
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    24
val unknown = expect "unknown"
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    25
*}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    26
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    27
ML {* genuine 1 @{prop "x = Not"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    28
ML {* none 1 @{prop "\<exists>x. x = Not"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    29
ML {* none 1 @{prop "\<not> False"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    30
ML {* genuine 1 @{prop "\<not> True"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    31
ML {* none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    32
ML {* none 1 @{prop True} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    33
ML {* genuine 1 @{prop False} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    34
ML {* genuine 1 @{prop "True \<longleftrightarrow> False"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    35
ML {* none 1 @{prop "True \<longleftrightarrow> \<not> False"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    36
ML {* none 5 @{prop "\<forall>x. x = x"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    37
ML {* none 5 @{prop "\<exists>x. x = x"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    38
ML {* none 1 @{prop "\<forall>x. x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    39
ML {* genuine 2 @{prop "\<forall>x. x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    40
ML {* none 2 @{prop "\<exists>x. x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    41
ML {* none 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = x"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    42
ML {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    43
ML {* genuine 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    44
ML {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    45
ML {* none 1 @{prop "All = Ex"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    46
ML {* genuine 2 @{prop "All = Ex"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    47
ML {* none 1 @{prop "All P = Ex P"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    48
ML {* genuine 2 @{prop "All P = Ex P"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    49
ML {* none 5 @{prop "x = y \<longrightarrow> P x = P y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    50
ML {* none 5 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x = P y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    51
ML {* none 2 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x y = P y x"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    52
ML {* none 5 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y \<longrightarrow> P x = P y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    53
ML {* none 2 @{prop "(x\<Colon>'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    54
ML {* none 2 @{prop "\<exists>x\<Colon>'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    55
ML {* genuine 1 @{prop "(op =) X = Ex"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    56
ML {* none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    57
ML {* none 1 @{prop "x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    58
ML {* genuine 1 @{prop "x \<longleftrightarrow> y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    59
ML {* genuine 2 @{prop "x = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    60
ML {* genuine 1 @{prop "X \<subseteq> Y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    61
ML {* none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    62
ML {* none 1 @{prop "P \<and> Q \<longrightarrow> P"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    63
ML {* none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    64
ML {* genuine 1 @{prop "P \<or> Q \<longrightarrow> P"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    65
ML {* none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    66
ML {* none 5 @{prop "{a} = {a, a}"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    67
ML {* genuine 2 @{prop "{a} = {a, b}"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    68
ML {* genuine 1 @{prop "{a} \<noteq> {a, b}"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    69
ML {* none 5 @{prop "{}\<^sup>+ = {}"} *}
45062
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    70
ML {* none 5 @{prop "UNIV\<^sup>+ = UNIV"} *}
45970
b6d0cff57d96 adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents: 45062
diff changeset
    71
ML {* none 5 @{prop "(UNIV \<Colon> ('a \<times> 'b) set) - {} = UNIV"} *}
b6d0cff57d96 adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents: 45062
diff changeset
    72
ML {* none 5 @{prop "{} - (UNIV \<Colon> ('a \<times> 'b) set) = {}"} *}
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    73
ML {* none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    74
ML {* genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    75
ML {* none 5 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
45970
b6d0cff57d96 adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents: 45062
diff changeset
    76
ML {* none 5 @{prop "A \<union> B = {x. x \<in> A \<or> x \<in> B}"} *}
b6d0cff57d96 adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents: 45062
diff changeset
    77
ML {* none 5 @{prop "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"} *}
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    78
ML {* none 5 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    79
ML {* none 5 @{prop "\<exists>a b. (a, b) = (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    80
ML {* genuine 2 @{prop "(a, b) = (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    81
ML {* genuine 2 @{prop "(a, b) \<noteq> (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    82
ML {* none 5 @{prop "\<exists>a b\<Colon>'a \<times> 'a. (a, b) = (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    83
ML {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a, b) = (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    84
ML {* none 5 @{prop "\<exists>a b\<Colon>'a \<times> 'a \<times> 'a. (a, b) = (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    85
ML {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    86
ML {* none 5 @{prop "\<exists>a b\<Colon>'a \<Rightarrow> 'a. (a, b) = (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    87
ML {* genuine 1 @{prop "(a\<Colon>'a \<Rightarrow> 'a, b) \<noteq> (b, a)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    88
ML {* none 5 @{prop "fst (a, b) = a"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    89
ML {* none 1 @{prop "fst (a, b) = b"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    90
ML {* genuine 2 @{prop "fst (a, b) = b"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    91
ML {* genuine 2 @{prop "fst (a, b) \<noteq> b"} *}
45062
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    92
ML {* genuine 2 @{prop "f ((x, z), y) = (x, z)"} *}
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
    93
ML {* none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"} *}
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    94
ML {* none 5 @{prop "snd (a, b) = b"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    95
ML {* none 1 @{prop "snd (a, b) = a"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    96
ML {* genuine 2 @{prop "snd (a, b) = a"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    97
ML {* genuine 2 @{prop "snd (a, b) \<noteq> a"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    98
ML {* genuine 1 @{prop P} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
    99
ML {* genuine 1 @{prop "(\<lambda>x. P) a"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   100
ML {* genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   101
ML {* none 5 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   102
ML {* genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   103
ML {* none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   104
ML {* none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"} *}
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   105
ML {* genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"} *}
45062
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
   106
ML {* none 5 @{prop "f = (\<lambda>x. f x)"} *}
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
   107
ML {* none 5 @{prop "f = (\<lambda>x. f x\<Colon>'a \<Rightarrow> bool)"} *}
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
   108
ML {* none 5 @{prop "f = (\<lambda>x y. f x y)"} *}
9598cada31b3 first step towards extending Minipick with more translations
blanchet
parents: 45035
diff changeset
   109
ML {* none 5 @{prop "f = (\<lambda>x y. f x y\<Colon>'a \<Rightarrow> bool)"} *}
45035
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   110
60d2c03d5c70 reintroduced Minipick as Nitpick example
blanchet
parents:
diff changeset
   111
end