src/HOL/Nitpick_Examples/Mini_Nits.thy
author blanchet
Fri Sep 23 14:25:53 2011 +0200 (2011-09-23)
changeset 45062 9598cada31b3
parent 45035 60d2c03d5c70
child 45970 b6d0cff57d96
permissions -rw-r--r--
first step towards extending Minipick with more translations
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
uses "minipick.ML"
blanchet@45035
    13
begin
blanchet@45035
    14
blanchet@45062
    15
nitpick_params [verbose, sat_solver = MiniSat_JNI, max_threads = 1]
blanchet@45035
    16
blanchet@45062
    17
nitpick_params [total_consts = smart]
blanchet@45035
    18
blanchet@45062
    19
ML {*
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"
blanchet@45035
    25
*}
blanchet@45035
    26
blanchet@45035
    27
ML {* genuine 1 @{prop "x = Not"} *}
blanchet@45035
    28
ML {* none 1 @{prop "\<exists>x. x = Not"} *}
blanchet@45035
    29
ML {* none 1 @{prop "\<not> False"} *}
blanchet@45035
    30
ML {* genuine 1 @{prop "\<not> True"} *}
blanchet@45035
    31
ML {* none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"} *}
blanchet@45035
    32
ML {* none 1 @{prop True} *}
blanchet@45035
    33
ML {* genuine 1 @{prop False} *}
blanchet@45035
    34
ML {* genuine 1 @{prop "True \<longleftrightarrow> False"} *}
blanchet@45035
    35
ML {* none 1 @{prop "True \<longleftrightarrow> \<not> False"} *}
blanchet@45035
    36
ML {* none 5 @{prop "\<forall>x. x = x"} *}
blanchet@45035
    37
ML {* none 5 @{prop "\<exists>x. x = x"} *}
blanchet@45035
    38
ML {* none 1 @{prop "\<forall>x. x = y"} *}
blanchet@45035
    39
ML {* genuine 2 @{prop "\<forall>x. x = y"} *}
blanchet@45035
    40
ML {* none 2 @{prop "\<exists>x. x = y"} *}
blanchet@45035
    41
ML {* none 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = x"} *}
blanchet@45035
    42
ML {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
blanchet@45035
    43
ML {* genuine 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = y"} *}
blanchet@45035
    44
ML {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
blanchet@45035
    45
ML {* none 1 @{prop "All = Ex"} *}
blanchet@45035
    46
ML {* genuine 2 @{prop "All = Ex"} *}
blanchet@45035
    47
ML {* none 1 @{prop "All P = Ex P"} *}
blanchet@45035
    48
ML {* genuine 2 @{prop "All P = Ex P"} *}
blanchet@45035
    49
ML {* none 5 @{prop "x = y \<longrightarrow> P x = P y"} *}
blanchet@45035
    50
ML {* none 5 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x = P y"} *}
blanchet@45035
    51
ML {* none 2 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x y = P y x"} *}
blanchet@45035
    52
ML {* none 5 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y \<longrightarrow> P x = P y"} *}
blanchet@45035
    53
ML {* none 2 @{prop "(x\<Colon>'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"} *}
blanchet@45035
    54
ML {* none 2 @{prop "\<exists>x\<Colon>'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"} *}
blanchet@45035
    55
ML {* genuine 1 @{prop "(op =) X = Ex"} *}
blanchet@45035
    56
ML {* none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"} *}
blanchet@45035
    57
ML {* none 1 @{prop "x = y"} *}
blanchet@45035
    58
ML {* genuine 1 @{prop "x \<longleftrightarrow> y"} *}
blanchet@45035
    59
ML {* genuine 2 @{prop "x = y"} *}
blanchet@45035
    60
ML {* genuine 1 @{prop "X \<subseteq> Y"} *}
blanchet@45035
    61
ML {* none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"} *}
blanchet@45035
    62
ML {* none 1 @{prop "P \<and> Q \<longrightarrow> P"} *}
blanchet@45035
    63
ML {* none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"} *}
blanchet@45035
    64
ML {* genuine 1 @{prop "P \<or> Q \<longrightarrow> P"} *}
blanchet@45035
    65
ML {* none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"} *}
blanchet@45035
    66
ML {* none 5 @{prop "{a} = {a, a}"} *}
blanchet@45035
    67
ML {* genuine 2 @{prop "{a} = {a, b}"} *}
blanchet@45035
    68
ML {* genuine 1 @{prop "{a} \<noteq> {a, b}"} *}
blanchet@45035
    69
ML {* none 5 @{prop "{}\<^sup>+ = {}"} *}
blanchet@45062
    70
ML {* none 5 @{prop "UNIV\<^sup>+ = UNIV"} *}
blanchet@45062
    71
ML {* none 5 @{prop "(UNIV\<Colon>'a \<times> 'b \<Rightarrow> bool) - {} = UNIV"} *}
blanchet@45062
    72
ML {* none 5 @{prop "{} - (UNIV\<Colon>'a \<times> 'b \<Rightarrow> bool) = {}"} *}
blanchet@45035
    73
ML {* none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
blanchet@45035
    74
ML {* genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
blanchet@45035
    75
ML {* none 5 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
blanchet@45035
    76
ML {* none 5 @{prop "A \<union> B = (\<lambda>x. A x \<or> B x)"} *}
blanchet@45035
    77
ML {* none 5 @{prop "A \<inter> B = (\<lambda>x. A x \<and> B x)"} *}
blanchet@45035
    78
ML {* none 5 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"} *}
blanchet@45035
    79
ML {* none 5 @{prop "\<exists>a b. (a, b) = (b, a)"} *}
blanchet@45035
    80
ML {* genuine 2 @{prop "(a, b) = (b, a)"} *}
blanchet@45035
    81
ML {* genuine 2 @{prop "(a, b) \<noteq> (b, a)"} *}
blanchet@45035
    82
ML {* none 5 @{prop "\<exists>a b\<Colon>'a \<times> 'a. (a, b) = (b, a)"} *}
blanchet@45035
    83
ML {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a, b) = (b, a)"} *}
blanchet@45035
    84
ML {* none 5 @{prop "\<exists>a b\<Colon>'a \<times> 'a \<times> 'a. (a, b) = (b, a)"} *}
blanchet@45035
    85
ML {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"} *}
blanchet@45035
    86
ML {* none 5 @{prop "\<exists>a b\<Colon>'a \<Rightarrow> 'a. (a, b) = (b, a)"} *}
blanchet@45035
    87
ML {* genuine 1 @{prop "(a\<Colon>'a \<Rightarrow> 'a, b) \<noteq> (b, a)"} *}
blanchet@45035
    88
ML {* none 5 @{prop "fst (a, b) = a"} *}
blanchet@45035
    89
ML {* none 1 @{prop "fst (a, b) = b"} *}
blanchet@45035
    90
ML {* genuine 2 @{prop "fst (a, b) = b"} *}
blanchet@45035
    91
ML {* genuine 2 @{prop "fst (a, b) \<noteq> b"} *}
blanchet@45062
    92
ML {* genuine 2 @{prop "f ((x, z), y) = (x, z)"} *}
blanchet@45062
    93
ML {* none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"} *}
blanchet@45035
    94
ML {* none 5 @{prop "snd (a, b) = b"} *}
blanchet@45035
    95
ML {* none 1 @{prop "snd (a, b) = a"} *}
blanchet@45035
    96
ML {* genuine 2 @{prop "snd (a, b) = a"} *}
blanchet@45035
    97
ML {* genuine 2 @{prop "snd (a, b) \<noteq> a"} *}
blanchet@45035
    98
ML {* genuine 1 @{prop P} *}
blanchet@45035
    99
ML {* genuine 1 @{prop "(\<lambda>x. P) a"} *}
blanchet@45035
   100
ML {* genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"} *}
blanchet@45035
   101
ML {* none 5 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"} *}
blanchet@45035
   102
ML {* genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"} *}
blanchet@45035
   103
ML {* none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"} *}
blanchet@45035
   104
ML {* none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"} *}
blanchet@45035
   105
ML {* genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"} *}
blanchet@45062
   106
ML {* none 5 @{prop "f = (\<lambda>x. f x)"} *}
blanchet@45062
   107
ML {* none 5 @{prop "f = (\<lambda>x. f x\<Colon>'a \<Rightarrow> bool)"} *}
blanchet@45062
   108
ML {* none 5 @{prop "f = (\<lambda>x y. f x y)"} *}
blanchet@45062
   109
ML {* none 5 @{prop "f = (\<lambda>x y. f x y\<Colon>'a \<Rightarrow> bool)"} *}
blanchet@45035
   110
blanchet@45035
   111
end