Theory Mini_Nits

(*  Title:      HOL/Nitpick_Examples/Mini_Nits.thy
    Author:     Jasmin Blanchette, TU Muenchen
    Copyright   2009-2011

Examples featuring Minipick, the minimalistic version of Nitpick.
*)

section ‹Examples Featuring Minipick, the Minimalistic Version of Nitpick›

theory Mini_Nits
imports Main
begin

ML_file ‹minipick.ML›

nitpick_params [verbose, sat_solver = MiniSat, max_threads = 1, total_consts = smart]

ML val check = Minipick.minipick context
val expect = Minipick.minipick_expect context
val none = expect "none"
val genuine = expect "genuine"
val unknown = expect "unknown"

ML genuine 1 propx = Not
ML none 1 propx. x = Not
ML none 1 prop¬ False
ML genuine 1 prop¬ True
ML none 1 prop¬ ¬ b  b
ML none 1 propTrue
ML genuine 1 propFalse
ML genuine 1 propTrue  False
ML none 1 propTrue  ¬ False
ML none 4 propx. x = x
ML none 4 propx. x = x
ML none 1 propx. x = y
ML genuine 2 propx. x = y
ML none 2 propx. x = y
ML none 2 propx::'a × 'a. x = x
ML none 2 propx::'a × 'a. x = y
ML genuine 2 propx::'a × 'a. x = y
ML none 2 propx::'a × 'a. x = y
ML none 1 propAll = Ex
ML genuine 2 propAll = Ex
ML none 1 propAll P = Ex P
ML genuine 2 propAll P = Ex P
ML none 4 propx = y  P x = P y
ML none 4 prop(x::'a × 'a) = y  P x = P y
ML none 2 prop(x::'a × 'a) = y  P x y = P y x
ML none 4 propx::'a × 'a. x = y  P x = P y
ML none 2 prop(x::'a  'a) = y  P x = P y
ML none 2 propx::'a  'a. x = y  P x = P y
ML genuine 1 prop(=) X = Ex
ML none 2 propx::'a  'a. x = x
ML none 1 propx = y
ML genuine 1 propx  y
ML genuine 2 propx = y
ML genuine 1 propX  Y
ML none 1 propP  Q  Q  P
ML none 1 propP  Q  P
ML none 1 propP  Q  Q  P
ML genuine 1 propP  Q  P
ML none 1 prop(P  Q)  (¬ P  Q)
ML none 4 prop{a} = {a, a}
ML genuine 2 prop{a} = {a, b}
ML genuine 1 prop{a}  {a, b}
ML none 4 prop{}+ = {}
ML none 4 propUNIV+ = UNIV
ML none 4 prop(UNIV :: ('a × 'b) set) - {} = UNIV
ML none 4 prop{} - (UNIV :: ('a × 'b) set) = {}
ML none 1 prop{(a, b), (b, c)}+ = {(a, b), (a, c), (b, c)}
ML genuine 2 prop{(a, b), (b, c)}+ = {(a, b), (a, c), (b, c)}
ML none 4 propa  c  {(a, b), (b, c)}+ = {(a, b), (a, c), (b, c)}
ML none 4 propA  B = {x. x  A  x  B}
ML none 4 propA  B = {x. x  A  x  B}
ML none 4 propA - B = (λx. A x  ¬ B x)
ML none 4 propa b. (a, b) = (b, a)
ML genuine 2 prop(a, b) = (b, a)
ML genuine 2 prop(a, b)  (b, a)
ML none 4 propa b::'a × 'a. (a, b) = (b, a)
ML genuine 2 prop(a::'a × 'a, b) = (b, a)
ML none 4 propa b::'a × 'a × 'a. (a, b) = (b, a)
ML genuine 2 prop(a::'a × 'a × 'a, b)  (b, a)
ML none 4 propa b::'a  'a. (a, b) = (b, a)
ML genuine 1 prop(a::'a  'a, b)  (b, a)
ML none 4 propfst (a, b) = a
ML none 1 propfst (a, b) = b
ML genuine 2 propfst (a, b) = b
ML genuine 2 propfst (a, b)  b
ML genuine 2 propf ((x, z), y) = (x, z)
ML none 2 prop(x. f x = fst x)  f ((x, z), y) = (x, z)
ML none 4 propsnd (a, b) = b
ML none 1 propsnd (a, b) = a
ML genuine 2 propsnd (a, b) = a
ML genuine 2 propsnd (a, b)  a
ML genuine 1 propP
ML genuine 1 prop(λx. P) a
ML genuine 1 prop(λx y z. P y x z) a b c
ML none 4 propf. f = (λx. x)  f y = y
ML genuine 1 propf. f p  p  (a b. f (a, b) = (a, b))
ML none 2 propf. a b. f (a, b) = (a, b)
ML none 3 propf = (λa b. (b, a))  f x y = (y, x)
ML genuine 2 propf = (λa b. (b, a))  f x y = (x, y)
ML none 4 propf = (λx. f x)
ML none 4 propf = (λx. f x::'a  bool)
ML none 4 propf = (λx y. f x y)
ML none 4 propf = (λx y. f x y::'a  bool)

end