
blanchet@45035: (*  Title:      HOL/Nitpick_Examples/Mini_Nits.thy
blanchet@45035:     Author:     Jasmin Blanchette, TU Muenchen
blanchet@45035:     Copyright   2009-2011
blanchet@45035: 
blanchet@45035: Examples featuring Minipick, the minimalistic version of Nitpick.
blanchet@45035: *)
blanchet@45035: 
wenzelm@58889: section {* Examples Featuring Minipick, the Minimalistic Version of Nitpick *}
blanchet@45035: 
blanchet@45035: theory Mini_Nits
blanchet@45035: imports Main
blanchet@45035: begin
blanchet@45035: 
wenzelm@48891: ML_file "minipick.ML"
wenzelm@48891: 
blanchet@54845: nitpick_params [verbose, sat_solver = MiniSat_JNI, max_threads = 1,
blanchet@54845:   total_consts = smart]
blanchet@45035: 
blanchet@45062: ML {*
blanchet@45062: val check = Minipick.minipick @{context}
blanchet@45062: val expect = Minipick.minipick_expect @{context}
blanchet@45062: val none = expect "none"
blanchet@45062: val genuine = expect "genuine"
blanchet@45062: val unknown = expect "unknown"
blanchet@45035: *}
blanchet@45035: 
wenzelm@51272: ML_val {* genuine 1 @{prop "x = Not"} *}
wenzelm@51272: ML_val {* none 1 @{prop "\<exists>x. x = Not"} *}
wenzelm@51272: ML_val {* none 1 @{prop "\<not> False"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "\<not> True"} *}
wenzelm@51272: ML_val {* none 1 @{prop "\<not> \<not> b \<longleftrightarrow> b"} *}
wenzelm@51272: ML_val {* none 1 @{prop True} *}
wenzelm@51272: ML_val {* genuine 1 @{prop False} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "True \<longleftrightarrow> False"} *}
wenzelm@51272: ML_val {* none 1 @{prop "True \<longleftrightarrow> \<not> False"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<forall>x. x = x"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>x. x = x"} *}
wenzelm@51272: ML_val {* none 1 @{prop "\<forall>x. x = y"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "\<forall>x. x = y"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<exists>x. x = y"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = x"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "\<forall>x\<Colon>'a \<times> 'a. x = y"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y"} *}
wenzelm@51272: ML_val {* none 1 @{prop "All = Ex"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "All = Ex"} *}
wenzelm@51272: ML_val {* none 1 @{prop "All P = Ex P"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "All P = Ex P"} *}
blanchet@54845: ML_val {* none 4 @{prop "x = y \<longrightarrow> P x = P y"} *}
blanchet@54845: ML_val {* none 4 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x = P y"} *}
wenzelm@51272: ML_val {* none 2 @{prop "(x\<Colon>'a \<times> 'a) = y \<longrightarrow> P x y = P y x"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>x\<Colon>'a \<times> 'a. x = y \<longrightarrow> P x = P y"} *}
wenzelm@51272: ML_val {* none 2 @{prop "(x\<Colon>'a \<Rightarrow> 'a) = y \<longrightarrow> P x = P y"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<exists>x\<Colon>'a \<Rightarrow> 'a. x = y \<longrightarrow> P x = P y"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "(op =) X = Ex"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<forall>x::'a \<Rightarrow> 'a. x = x"} *}
wenzelm@51272: ML_val {* none 1 @{prop "x = y"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "x \<longleftrightarrow> y"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "x = y"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "X \<subseteq> Y"} *}
wenzelm@51272: ML_val {* none 1 @{prop "P \<and> Q \<longleftrightarrow> Q \<and> P"} *}
wenzelm@51272: ML_val {* none 1 @{prop "P \<and> Q \<longrightarrow> P"} *}
wenzelm@51272: ML_val {* none 1 @{prop "P \<or> Q \<longleftrightarrow> Q \<or> P"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "P \<or> Q \<longrightarrow> P"} *}
wenzelm@51272: ML_val {* none 1 @{prop "(P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q)"} *}
blanchet@54845: ML_val {* none 4 @{prop "{a} = {a, a}"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "{a} = {a, b}"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "{a} \<noteq> {a, b}"} *}
blanchet@54845: ML_val {* none 4 @{prop "{}\<^sup>+ = {}"} *}
blanchet@54845: ML_val {* none 4 @{prop "UNIV\<^sup>+ = UNIV"} *}
blanchet@54845: ML_val {* none 4 @{prop "(UNIV \<Colon> ('a \<times> 'b) set) - {} = UNIV"} *}
blanchet@54845: ML_val {* none 4 @{prop "{} - (UNIV \<Colon> ('a \<times> 'b) set) = {}"} *}
wenzelm@51272: ML_val {* none 1 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "{(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
blanchet@54845: ML_val {* none 4 @{prop "a \<noteq> c \<Longrightarrow> {(a, b), (b, c)}\<^sup>+ = {(a, b), (a, c), (b, c)}"} *}
blanchet@54845: ML_val {* none 4 @{prop "A \<union> B = {x. x \<in> A \<or> x \<in> B}"} *}
blanchet@54845: ML_val {* none 4 @{prop "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"} *}
blanchet@54845: ML_val {* none 4 @{prop "A - B = (\<lambda>x. A x \<and> \<not> B x)"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>a b. (a, b) = (b, a)"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "(a, b) = (b, a)"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "(a, b) \<noteq> (b, a)"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>a b\<Colon>'a \<times> 'a. (a, b) = (b, a)"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a, b) = (b, a)"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>a b\<Colon>'a \<times> 'a \<times> 'a. (a, b) = (b, a)"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "(a\<Colon>'a \<times> 'a \<times> 'a, b) \<noteq> (b, a)"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>a b\<Colon>'a \<Rightarrow> 'a. (a, b) = (b, a)"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "(a\<Colon>'a \<Rightarrow> 'a, b) \<noteq> (b, a)"} *}
blanchet@54845: ML_val {* none 4 @{prop "fst (a, b) = a"} *}
wenzelm@51272: ML_val {* none 1 @{prop "fst (a, b) = b"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "fst (a, b) = b"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "fst (a, b) \<noteq> b"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "f ((x, z), y) = (x, z)"} *}
wenzelm@51272: ML_val {* none 2 @{prop "(ALL x. f x = fst x) \<longrightarrow> f ((x, z), y) = (x, z)"} *}
blanchet@54845: ML_val {* none 4 @{prop "snd (a, b) = b"} *}
wenzelm@51272: ML_val {* none 1 @{prop "snd (a, b) = a"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "snd (a, b) = a"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "snd (a, b) \<noteq> a"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop P} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "(\<lambda>x. P) a"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "(\<lambda>x y z. P y x z) a b c"} *}
blanchet@54845: ML_val {* none 4 @{prop "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"} *}
wenzelm@51272: ML_val {* genuine 1 @{prop "\<exists>f. f p \<noteq> p \<and> (\<forall>a b. f (a, b) = (a, b))"} *}
wenzelm@51272: ML_val {* none 2 @{prop "\<exists>f. \<forall>a b. f (a, b) = (a, b)"} *}
wenzelm@51272: ML_val {* none 3 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (y, x)"} *}
wenzelm@51272: ML_val {* genuine 2 @{prop "f = (\<lambda>a b. (b, a)) \<longrightarrow> f x y = (x, y)"} *}
blanchet@54845: ML_val {* none 4 @{prop "f = (\<lambda>x. f x)"} *}
blanchet@54845: ML_val {* none 4 @{prop "f = (\<lambda>x. f x\<Colon>'a \<Rightarrow> bool)"} *}
blanchet@54845: ML_val {* none 4 @{prop "f = (\<lambda>x y. f x y)"} *}
blanchet@54845: ML_val {* none 4 @{prop "f = (\<lambda>x y. f x y\<Colon>'a \<Rightarrow> bool)"} *}
blanchet@45035: 
blanchet@45035: end




