src/HOL/Nitpick_Examples/Mini_Nits.thy
author wenzelm
Thu May 26 17:51:22 2016 +0200 (2016-05-26)
changeset 63167 0909deb8059b
parent 61076 bdc1e2f0a86a
child 65907 637d18b325d0
permissions -rw-r--r--
isabelle update_cartouches -c -t;
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
wenzelm@63167
     8
section \<open>Examples Featuring Minipick, the Minimalistic Version of Nitpick\<close>
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@54845
    16
nitpick_params [verbose, sat_solver = MiniSat_JNI, max_threads = 1,
blanchet@54845
    17
  total_consts = smart]
blanchet@45035
    18
wenzelm@63167
    19
ML \<open>
blanchet@45062
    20
val check = Minipick.minipick @{context}
blanchet@45062
    21
val expect = Minipick.minipick_expect @{context}
blanchet@45062
    22
val none = expect "none"
blanchet@45062
    23
val genuine = expect "genuine"
blanchet@45062
    24
val unknown = expect "unknown"
wenzelm@63167
    25
\<close>
blanchet@45035
    26
wenzelm@63167
    27
ML_val \<open>genuine 1 @{prop "x = Not"}\<close>
wenzelm@63167
    28
ML_val \<open>none 1 @{prop "\<exists>x. x = Not"}\<close>
wenzelm@63167
    29
ML_val \<open>none 1 @{prop "\<not> False"}\<close>
wenzelm@63167
    30
ML_val \<open>genuine 1 @{prop "\<not> True"}\<close>
wenzelm@63167
    31
ML_val \<open>none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"}\<close>
wenzelm@63167
    32
ML_val \<open>none 1 @{prop True}\<close>
wenzelm@63167
    33
ML_val \<open>genuine 1 @{prop False}\<close>
wenzelm@63167
    34
ML_val \<open>genuine 1 @{prop "True \<longleftrightarrow> False"}\<close>
wenzelm@63167
    35
ML_val \<open>none 1 @{prop "True \<longleftrightarrow> \<not> False"}\<close>
wenzelm@63167
    36
ML_val \<open>none 4 @{prop "\<forall>x. x = x"}\<close>
wenzelm@63167
    37
ML_val \<open>none 4 @{prop "\<exists>x. x = x"}\<close>
wenzelm@63167
    38
ML_val \<open>none 1 @{prop "\<forall>x. x = y"}\<close>
wenzelm@63167
    39
ML_val \<open>genuine 2 @{prop "\<forall>x. x = y"}\<close>
wenzelm@63167
    40
ML_val \<open>none 2 @{prop "\<exists>x. x = y"}\<close>
wenzelm@63167
    41
ML_val \<open>none 2 @{prop "\<forall>x::'a \<times> 'a. x = x"}\<close>
wenzelm@63167
    42
ML_val \<open>none 2 @{prop "\<exists>x::'a \<times> 'a. x = y"}\<close>
wenzelm@63167
    43
ML_val \<open>genuine 2 @{prop "\<forall>x::'a \<times> 'a. x = y"}\<close>
wenzelm@63167
    44
ML_val \<open>none 2 @{prop "\<exists>x::'a \<times> 'a. x = y"}\<close>
wenzelm@63167
    45
ML_val \<open>none 1 @{prop "All = Ex"}\<close>
wenzelm@63167
    46
ML_val \<open>genuine 2 @{prop "All = Ex"}\<close>
wenzelm@63167
    47
ML_val \<open>none 1 @{prop "All P = Ex P"}\<close>
wenzelm@63167
    48
ML_val \<open>genuine 2 @{prop "All P = Ex P"}\<close>
wenzelm@63167
    49
ML_val \<open>none 4 @{prop "x = y \<longrightarrow> P x = P y"}\<close>
wenzelm@63167
    50
ML_val \<open>none 4 @{prop "(x::'a \<times> 'a) = y \<longrightarrow> P x = P y"}\<close>
wenzelm@63167
    51
ML_val \<open>none 2 @{prop "(x::'a \<times> 'a) = y \<longrightarrow> P x y = P y x"}\<close>
wenzelm@63167
    52
ML_val \<open>none 4 @{prop "\<exists>x::'a \<times> 'a. x = y \<longrightarrow> P x = P y"}\<close>
wenzelm@63167
    53
ML_val \<open>none 2 @{prop "(x::'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"}\<close>
wenzelm@63167
    54
ML_val \<open>none 2 @{prop "\<exists>x::'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"}\<close>
wenzelm@63167
    55
ML_val \<open>genuine 1 @{prop "(op =) X = Ex"}\<close>
wenzelm@63167
    56
ML_val \<open>none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"}\<close>
wenzelm@63167
    57
ML_val \<open>none 1 @{prop "x = y"}\<close>
wenzelm@63167
    58
ML_val \<open>genuine 1 @{prop "x \<longleftrightarrow> y"}\<close>
wenzelm@63167
    59
ML_val \<open>genuine 2 @{prop "x = y"}\<close>
wenzelm@63167
    60
ML_val \<open>genuine 1 @{prop "X \<subseteq> Y"}\<close>
wenzelm@63167
    61
ML_val \<open>none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"}\<close>
wenzelm@63167
    62
ML_val \<open>none 1 @{prop "P \<and> Q \<longrightarrow> P"}\<close>
wenzelm@63167
    63
ML_val \<open>none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"}\<close>
wenzelm@63167
    64
ML_val \<open>genuine 1 @{prop "P \<or> Q \<longrightarrow> P"}\<close>
wenzelm@63167
    65
ML_val \<open>none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"}\<close>
wenzelm@63167
    66
ML_val \<open>none 4 @{prop "{a} = {a, a}"}\<close>
wenzelm@63167
    67
ML_val \<open>genuine 2 @{prop "{a} = {a, b}"}\<close>
wenzelm@63167
    68
ML_val \<open>genuine 1 @{prop "{a} \<noteq> {a, b}"}\<close>
wenzelm@63167
    69
ML_val \<open>none 4 @{prop "{}\<^sup>+ = {}"}\<close>
wenzelm@63167
    70
ML_val \<open>none 4 @{prop "UNIV\<^sup>+ = UNIV"}\<close>
wenzelm@63167
    71
ML_val \<open>none 4 @{prop "(UNIV :: ('a \<times> 'b) set) - {} = UNIV"}\<close>
wenzelm@63167
    72
ML_val \<open>none 4 @{prop "{} - (UNIV :: ('a \<times> 'b) set) = {}"}\<close>
wenzelm@63167
    73
ML_val \<open>none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"}\<close>
wenzelm@63167
    74
ML_val \<open>genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"}\<close>
wenzelm@63167
    75
ML_val \<open>none 4 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"}\<close>
wenzelm@63167
    76
ML_val \<open>none 4 @{prop "A \<union> B = {x. x \<in> A \<or> x \<in> B}"}\<close>
wenzelm@63167
    77
ML_val \<open>none 4 @{prop "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"}\<close>
wenzelm@63167
    78
ML_val \<open>none 4 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"}\<close>
wenzelm@63167
    79
ML_val \<open>none 4 @{prop "\<exists>a b. (a, b) = (b, a)"}\<close>
wenzelm@63167
    80
ML_val \<open>genuine 2 @{prop "(a, b) = (b, a)"}\<close>
wenzelm@63167
    81
ML_val \<open>genuine 2 @{prop "(a, b) \<noteq> (b, a)"}\<close>
wenzelm@63167
    82
ML_val \<open>none 4 @{prop "\<exists>a b::'a \<times> 'a. (a, b) = (b, a)"}\<close>
wenzelm@63167
    83
ML_val \<open>genuine 2 @{prop "(a::'a \<times> 'a, b) = (b, a)"}\<close>
wenzelm@63167
    84
ML_val \<open>none 4 @{prop "\<exists>a b::'a \<times> 'a \<times> 'a. (a, b) = (b, a)"}\<close>
wenzelm@63167
    85
ML_val \<open>genuine 2 @{prop "(a::'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"}\<close>
wenzelm@63167
    86
ML_val \<open>none 4 @{prop "\<exists>a b::'a \<Rightarrow> 'a. (a, b) = (b, a)"}\<close>
wenzelm@63167
    87
ML_val \<open>genuine 1 @{prop "(a::'a \<Rightarrow> 'a, b) \<noteq> (b, a)"}\<close>
wenzelm@63167
    88
ML_val \<open>none 4 @{prop "fst (a, b) = a"}\<close>
wenzelm@63167
    89
ML_val \<open>none 1 @{prop "fst (a, b) = b"}\<close>
wenzelm@63167
    90
ML_val \<open>genuine 2 @{prop "fst (a, b) = b"}\<close>
wenzelm@63167
    91
ML_val \<open>genuine 2 @{prop "fst (a, b) \<noteq> b"}\<close>
wenzelm@63167
    92
ML_val \<open>genuine 2 @{prop "f ((x, z), y) = (x, z)"}\<close>
wenzelm@63167
    93
ML_val \<open>none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"}\<close>
wenzelm@63167
    94
ML_val \<open>none 4 @{prop "snd (a, b) = b"}\<close>
wenzelm@63167
    95
ML_val \<open>none 1 @{prop "snd (a, b) = a"}\<close>
wenzelm@63167
    96
ML_val \<open>genuine 2 @{prop "snd (a, b) = a"}\<close>
wenzelm@63167
    97
ML_val \<open>genuine 2 @{prop "snd (a, b) \<noteq> a"}\<close>
wenzelm@63167
    98
ML_val \<open>genuine 1 @{prop P}\<close>
wenzelm@63167
    99
ML_val \<open>genuine 1 @{prop "(\<lambda>x. P) a"}\<close>
wenzelm@63167
   100
ML_val \<open>genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"}\<close>
wenzelm@63167
   101
ML_val \<open>none 4 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"}\<close>
wenzelm@63167
   102
ML_val \<open>genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"}\<close>
wenzelm@63167
   103
ML_val \<open>none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"}\<close>
wenzelm@63167
   104
ML_val \<open>none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"}\<close>
wenzelm@63167
   105
ML_val \<open>genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"}\<close>
wenzelm@63167
   106
ML_val \<open>none 4 @{prop "f = (\<lambda>x. f x)"}\<close>
wenzelm@63167
   107
ML_val \<open>none 4 @{prop "f = (\<lambda>x. f x::'a \<Rightarrow> bool)"}\<close>
wenzelm@63167
   108
ML_val \<open>none 4 @{prop "f = (\<lambda>x y. f x y)"}\<close>
wenzelm@63167
   109
ML_val \<open>none 4 @{prop "f = (\<lambda>x y. f x y::'a \<Rightarrow> bool)"}\<close>
blanchet@45035
   110
blanchet@45035
   111
end