src/HOL/Nitpick_Examples/Mini_Nits.thy
author blanchet
Thu, 05 Dec 2013 13:38:20 +0100
changeset 56006 86e0b402994c
parent 52409 9c8d63b4b6be
child 56022 93f6d33a754e
permissions -rw-r--r--
experiment
blanchet@45900
     1
(*  Title:      HOL/Nitpick_Examples/Mini_Nits.thy
blanchet@45900
     2
    Author:     Jasmin Blanchette, TU Muenchen
blanchet@45900
     3
    Copyright   2009-2011
blanchet@45900
     4
blanchet@45900
     5
Examples featuring Minipick, the minimalistic version of Nitpick.
blanchet@45900
     6
*)
blanchet@45900
     7
blanchet@45900
     8
header {* Examples Featuring Minipick, the Minimalistic Version of Nitpick *}
blanchet@45900
     9
blanchet@45900
    10
theory Mini_Nits
blanchet@45900
    11
imports Main
blanchet@45900
    12
begin
blanchet@45900
    13
wenzelm@49906
    14
ML_file "minipick.ML"
wenzelm@49906
    15
blanchet@56006
    16
nitpick_params [verbose, sat_solver = Riss3g, max_threads = 1]
blanchet@45928
    17
blanchet@45928
    18
nitpick_params [total_consts = smart]
blanchet@45928
    19
blanchet@45900
    20
ML {*
blanchet@45928
    21
val check = Minipick.minipick @{context}
blanchet@45928
    22
val expect = Minipick.minipick_expect @{context}
blanchet@45928
    23
val none = expect "none"
blanchet@45928
    24
val genuine = expect "genuine"
blanchet@45928
    25
val unknown = expect "unknown"
blanchet@45900
    26
*}
blanchet@45900
    27
wenzelm@52409
    28
ML_val {* genuine 1 @{prop "x = Not"} *}
wenzelm@52409
    29
ML_val {* none 1 @{prop "\<exists>x. x = Not"} *}
wenzelm@52409
    30
ML_val {* none 1 @{prop "\<not> False"} *}
wenzelm@52409
    31
ML_val {* genuine 1 @{prop "\<not> True"} *}
wenzelm@52409
    32
ML_val {* none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"} *}
wenzelm@52409
    33
ML_val {* none 1 @{prop True} *}
wenzelm@52409
    34
ML_val {* genuine 1 @{prop False} *}
wenzelm@52409
    35
ML_val {* genuine 1 @{prop "True \<longleftrightarrow> False"} *}
wenzelm@52409
    36
ML_val {* none 1 @{prop "True \<longleftrightarrow> \<not> False"} *}
wenzelm@52409
    37
ML_val {* none 5 @{prop "\<forall>x. x = x"} *}
wenzelm@52409
    38
ML_val {* none 5 @{prop "\<exists>x. x = x"} *}
wenzelm@52409
    39
ML_val {* none 1 @{prop "\<forall>x. x = y"} *}
wenzelm@52409
    40
ML_val {* genuine 2 @{prop "\<forall>x. x = y"} *}
wenzelm@52409
    41
ML_val {* none 2 @{prop "\<exists>x. x = y"} *}
wenzelm@52409
    42
ML_val {* none 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = x"} *}
wenzelm@52409
    43
ML_val {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
wenzelm@52409
    44
ML_val {* genuine 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = y"} *}
wenzelm@52409
    45
ML_val {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
wenzelm@52409
    46
ML_val {* none 1 @{prop "All = Ex"} *}
wenzelm@52409
    47
ML_val {* genuine 2 @{prop "All = Ex"} *}
wenzelm@52409
    48
ML_val {* none 1 @{prop "All P = Ex P"} *}
wenzelm@52409
    49
ML_val {* genuine 2 @{prop "All P = Ex P"} *}
wenzelm@52409
    50
ML_val {* none 5 @{prop "x = y \<longrightarrow> P x = P y"} *}
wenzelm@52409
    51
ML_val {* none 5 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x = P y"} *}
wenzelm@52409
    52
ML_val {* none 2 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x y = P y x"} *}
wenzelm@52409
    53
ML_val {* none 5 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y \<longrightarrow> P x = P y"} *}
wenzelm@52409
    54
ML_val {* none 2 @{prop "(x\<Colon>'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"} *}
wenzelm@52409
    55
ML_val {* none 2 @{prop "\<exists>x\<Colon>'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"} *}
wenzelm@52409
    56
ML_val {* genuine 1 @{prop "(op =) X = Ex"} *}
wenzelm@52409
    57
ML_val {* none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"} *}
wenzelm@52409
    58
ML_val {* none 1 @{prop "x = y"} *}
wenzelm@52409
    59
ML_val {* genuine 1 @{prop "x \<longleftrightarrow> y"} *}
wenzelm@52409
    60
ML_val {* genuine 2 @{prop "x = y"} *}
wenzelm@52409
    61
ML_val {* genuine 1 @{prop "X \<subseteq> Y"} *}
wenzelm@52409
    62
ML_val {* none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"} *}
wenzelm@52409
    63
ML_val {* none 1 @{prop "P \<and> Q \<longrightarrow> P"} *}
wenzelm@52409
    64
ML_val {* none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"} *}
wenzelm@52409
    65
ML_val {* genuine 1 @{prop "P \<or> Q \<longrightarrow> P"} *}
wenzelm@52409
    66
ML_val {* none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"} *}
wenzelm@52409
    67
ML_val {* none 5 @{prop "{a} = {a, a}"} *}
wenzelm@52409
    68
ML_val {* genuine 2 @{prop "{a} = {a, b}"} *}
wenzelm@52409
    69
ML_val {* genuine 1 @{prop "{a} \<noteq> {a, b}"} *}
wenzelm@52409
    70
ML_val {* none 5 @{prop "{}\<^sup>+ = {}"} *}
wenzelm@52409
    71
ML_val {* none 5 @{prop "UNIV\<^sup>+ = UNIV"} *}
wenzelm@52409
    72
ML_val {* none 5 @{prop "(UNIV \<Colon> ('a \<times> 'b) set) - {} = UNIV"} *}
wenzelm@52409
    73
ML_val {* none 5 @{prop "{} - (UNIV \<Colon> ('a \<times> 'b) set) = {}"} *}
wenzelm@52409
    74
ML_val {* none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
wenzelm@52409
    75
ML_val {* genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
wenzelm@52409
    76
ML_val {* none 5 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
wenzelm@52409
    77
ML_val {* none 5 @{prop "A \<union> B = {x. x \<in> A \<or> x \<in> B}"} *}
wenzelm@52409
    78
ML_val {* none 5 @{prop "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"} *}
wenzelm@52409
    79
ML_val {* none 5 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"} *}
wenzelm@52409
    80
ML_val {* none 5 @{prop "\<exists>a b. (a, b) = (b, a)"} *}
wenzelm@52409
    81
ML_val {* genuine 2 @{prop "(a, b) = (b, a)"} *}
wenzelm@52409
    82
ML_val {* genuine 2 @{prop "(a, b) \<noteq> (b, a)"} *}
wenzelm@52409
    83
ML_val {* none 5 @{prop "\<exists>a b\<Colon>'a \<times> 'a. (a, b) = (b, a)"} *}
wenzelm@52409
    84
ML_val {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a, b) = (b, a)"} *}
wenzelm@52409
    85
ML_val {* none 5 @{prop "\<exists>a b\<Colon>'a \<times> 'a \<times> 'a. (a, b) = (b, a)"} *}
wenzelm@52409
    86
ML_val {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"} *}
wenzelm@52409
    87
ML_val {* none 5 @{prop "\<exists>a b\<Colon>'a \<Rightarrow> 'a. (a, b) = (b, a)"} *}
wenzelm@52409
    88
ML_val {* genuine 1 @{prop "(a\<Colon>'a \<Rightarrow> 'a, b) \<noteq> (b, a)"} *}
wenzelm@52409
    89
ML_val {* none 5 @{prop "fst (a, b) = a"} *}
wenzelm@52409
    90
ML_val {* none 1 @{prop "fst (a, b) = b"} *}
wenzelm@52409
    91
ML_val {* genuine 2 @{prop "fst (a, b) = b"} *}
wenzelm@52409
    92
ML_val {* genuine 2 @{prop "fst (a, b) \<noteq> b"} *}
wenzelm@52409
    93
ML_val {* genuine 2 @{prop "f ((x, z), y) = (x, z)"} *}
wenzelm@52409
    94
ML_val {* none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"} *}
wenzelm@52409
    95
ML_val {* none 5 @{prop "snd (a, b) = b"} *}
wenzelm@52409
    96
ML_val {* none 1 @{prop "snd (a, b) = a"} *}
wenzelm@52409
    97
ML_val {* genuine 2 @{prop "snd (a, b) = a"} *}
wenzelm@52409
    98
ML_val {* genuine 2 @{prop "snd (a, b) \<noteq> a"} *}
wenzelm@52409
    99
ML_val {* genuine 1 @{prop P} *}
wenzelm@52409
   100
ML_val {* genuine 1 @{prop "(\<lambda>x. P) a"} *}
wenzelm@52409
   101
ML_val {* genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"} *}
wenzelm@52409
   102
ML_val {* none 5 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"} *}
wenzelm@52409
   103
ML_val {* genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"} *}
wenzelm@52409
   104
ML_val {* none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"} *}
wenzelm@52409
   105
ML_val {* none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"} *}
wenzelm@52409
   106
ML_val {* genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"} *}
wenzelm@52409
   107
ML_val {* none 5 @{prop "f = (\<lambda>x. f x)"} *}
wenzelm@52409
   108
ML_val {* none 5 @{prop "f = (\<lambda>x. f x\<Colon>'a \<Rightarrow> bool)"} *}
wenzelm@52409
   109
ML_val {* none 5 @{prop "f = (\<lambda>x y. f x y)"} *}
wenzelm@52409
   110
ML_val {* none 5 @{prop "f = (\<lambda>x y. f x y\<Colon>'a \<Rightarrow> bool)"} *}
blanchet@45900
   111
blanchet@45900
   112
end