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