# HG changeset patch # User blanchet # Date 1291638789 -3600 # Node ID 000ca46429cdb723dd2d070c65b07bac80935a2c # Parent 60d931de07098fcaf51f78f73a67572c04f4448a added examples to exercise new monotonicity code diff -r 60d931de0709 -r 000ca46429cd src/HOL/Nitpick_Examples/Mono_Nits.thy --- a/src/HOL/Nitpick_Examples/Mono_Nits.thy Mon Dec 06 13:33:09 2010 +0100 +++ b/src/HOL/Nitpick_Examples/Mono_Nits.thy Mon Dec 06 13:33:09 2010 +0100 @@ -43,57 +43,78 @@ fun nonconst t = not (is_const t) orelse raise BUG *} -ML {* const @{term "A::('a\'b)"} *} -ML {* const @{term "(A::'a set) = A"} *} -ML {* const @{term "(A::'a set set) = A"} *} -ML {* const @{term "(\x::'a set. x a)"} *} -ML {* const @{term "{{a::'a}} = C"} *} -ML {* const @{term "{f::'a\nat} = {g::'a\nat}"} *} -ML {* const @{term "A \ (B::'a set)"} *} -ML {* const @{term "P (a::'a)"} *} -ML {* const @{term "\a::'a. b (c (d::'a)) (e::'a) (f::'a)"} *} -ML {* const @{term "\A::'a set. A a"} *} -ML {* const @{term "\A::'a set. P A"} *} +ML {* Nitpick_Mono.trace := false *} + +ML {* const @{term "A\('a\'b)"} *} +ML {* const @{term "(A\'a set) = A"} *} +ML {* const @{term "(A\'a set set) = A"} *} +ML {* const @{term "(\x\'a set. x a)"} *} +ML {* const @{term "{{a\'a}} = C"} *} +ML {* const @{term "{f\'a\nat} = {g\'a\nat}"} *} +ML {* const @{term "A \ (B\'a set)"} *} +ML {* const @{term "\A B x\'a. A x \ B x"} *} +ML {* const @{term "P (a\'a)"} *} +ML {* const @{term "\a\'a. b (c (d\'a)) (e\'a) (f\'a)"} *} +ML {* const @{term "\A\'a set. A a"} *} +ML {* const @{term "\A\'a set. P A"} *} ML {* const @{term "P \ Q"} *} -ML {* const @{term "A \ B = (C::'a set)"} *} -ML {* const @{term "(if P then (A::'a set) else B) = C"} *} -ML {* const @{term "let A = (C::'a set) in A \ B"} *} -ML {* const @{term "THE x::'b. P x"} *} -ML {* const @{term "(\x::'a. False)"} *} -ML {* const @{term "(\x::'a. True)"} *} -ML {* const @{term "Let (a::'a) A"} *} -ML {* const @{term "A (a::'a)"} *} -ML {* const @{term "insert (a::'a) A = B"} *} -ML {* const @{term "- (A::'a set)"} *} -ML {* const @{term "finite (A::'a set)"} *} -ML {* const @{term "\ finite (A::'a set)"} *} -ML {* const @{term "finite (A::'a set set)"} *} -ML {* const @{term "\a::'a. A a \ \ B a"} *} -ML {* const @{term "A < (B::'a set)"} *} -ML {* const @{term "A \ (B::'a set)"} *} -ML {* const @{term "[a::'a]"} *} -ML {* const @{term "[a::'a set]"} *} -ML {* const @{term "[A \ (B::'a set)]"} *} -ML {* const @{term "[A \ (B::'a set)] = [C]"} *} -ML {* const @{term "{(\x::'a. x = a)} = C"} *} +ML {* const @{term "A \ B = (C\'a set)"} *} +ML {* const @{term "(\A B x\'a. A x \ B x) A B = C"} *} +ML {* const @{term "(if P then (A\'a set) else B) = C"} *} +ML {* const @{term "let A = (C\'a set) in A \ B"} *} +ML {* const @{term "THE x\'b. P x"} *} +ML {* const @{term "(\x\'a. False)"} *} +ML {* const @{term "(\x\'a. True)"} *} +ML {* const @{term "(\x\'a. False) = (\x\'a. False)"} *} +ML {* const @{term "(\x\'a. True) = (\x\'a. True)"} *} +ML {* const @{term "Let (a\'a) A"} *} +ML {* const @{term "A (a\'a)"} *} +ML {* const @{term "insert (a\'a) A = B"} *} +ML {* const @{term "- (A\'a set)"} *} +ML {* const @{term "finite (A\'a set)"} *} +ML {* const @{term "\ finite (A\'a set)"} *} +ML {* const @{term "finite (A\'a set set)"} *} +ML {* const @{term "\a\'a. A a \ \ B a"} *} +ML {* const @{term "A < (B\'a set)"} *} +ML {* const @{term "A \ (B\'a set)"} *} +ML {* const @{term "[a\'a]"} *} +ML {* const @{term "[a\'a set]"} *} +ML {* const @{term "[A \ (B\'a set)]"} *} +ML {* const @{term "[A \ (B\'a set)] = [C]"} *} +ML {* const @{term "{(\x\'a. x = a)} = C"} *} +ML {* const @{term "(\a\'a. \ A a) = B"} *} +ML {* const @{prop "\F f g (h\'a set). F f \ F g \ \ f a \ g a \ \ f a"} *} +ML {* const @{term "\A B x\'a. A x \ B x \ A = B"} *} +ML {* const @{term "p = (\(x\'a) (y\'a). P x \ \ Q y)"} *} +ML {* const @{term "p = (\(x\'a) (y\'a). p x y \ bool)"} *} +ML {* const @{term "p = (\A B x. A x \ \ B x) (\x. True) (\y. x \ y)"} *} +ML {* const @{term "p = (\y. x \ y)"} *} +ML {* const @{term "(\x. (p\'a\bool\bool) x False)"} *} +ML {* const @{term "(\x y. (p\'a\'a\bool\bool) x y False)"} *} +ML {* const @{term "f = (\x\'a. P x \ Q x)"} *} -ML {* nonconst @{term "\P (a::'a). P a"} *} -ML {* nonconst @{term "\a::'a. P a"} *} -ML {* nonconst @{term "(\a::'a. \ A a) = B"} *} -ML {* nonconst @{term "THE x::'a. P x"} *} -ML {* nonconst @{term "SOME x::'a. P x"} *} +ML {* nonconst @{term "\P (a\'a). P a"} *} +ML {* nonconst @{term "\a\'a. P a"} *} +ML {* nonconst @{term "THE x\'a. P x"} *} +ML {* nonconst @{term "SOME x\'a. P x"} *} +ML {* nonconst @{term "(\A B x\'a. A x \ B x) = myunion"} *} +ML {* nonconst @{term "(\x\'a. False) = (\x\'a. True)"} *} +ML {* nonconst @{prop "\F f g (h\'a set). F f \ F g \ \ f a \ g a \ F h"} *} -ML {* mono @{prop "Q (\x::'a set. P x)"} *} -ML {* mono @{prop "P (a::'a)"} *} -ML {* mono @{prop "{a} = {b::'a}"} *} -ML {* mono @{prop "P (a::'a) \ P \ P = P"} *} -ML {* mono @{prop "\F::'a set set. P"} *} -ML {* mono @{prop "\ (\F f g (h::'a set). F f \ F g \ \ f a \ g a \ F h)"} *} -ML {* mono @{prop "\ Q (\x::'a set. P x)"} *} -ML {* mono @{prop "\ (\x::'a. P x)"} *} +ML {* mono @{prop "Q (\x\'a set. P x)"} *} +ML {* mono @{prop "P (a\'a)"} *} +ML {* mono @{prop "{a} = {b\'a}"} *} +ML {* mono @{prop "P (a\'a) \ P \ P = P"} *} +ML {* mono @{prop "\F\'a set set. P"} *} +ML {* mono @{prop "\ (\F f g (h\'a set). F f \ F g \ \ f a \ g a \ F h)"} *} +ML {* mono @{prop "\ Q (\x\'a set. P x)"} *} +ML {* mono @{prop "\ (\x\'a. P x)"} *} +ML {* mono @{prop "myall P = (P = (\x\'a. True))"} *} +ML {* mono @{prop "myall P = (P = (\x\'a. False))"} *} +ML {* mono @{prop "\x\'a. P x"} *} +ML {* mono @{term "(\A B x\'a. A x \ B x) \ myunion"} *} -ML {* nonmono @{prop "\x::'a. P x"} *} -ML {* nonmono @{prop "myall P = (P = (\x::'a. True))"} *} -ML {* nonmono @{prop "\F f g (h::'a set). F f \ F g \ \ f a \ g a \ F h"} *} +ML {* nonmono @{prop "A = (\x::'a. True) \ A = (\x. False)"} *} +ML {* nonmono @{prop "\F f g (h\'a set). F f \ F g \ \ f a \ g a \ F h"} *} end