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