2014-01-09 22:06:23 +00:00
|
|
|
import if_then_else
|
2014-01-09 23:31:58 +00:00
|
|
|
set_option verbose false.
|
2014-01-05 20:05:08 +00:00
|
|
|
notation 10 if _ then _ : implies.
|
|
|
|
print environment 1.
|
2014-01-05 19:03:35 +00:00
|
|
|
print if true then false.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable a : Bool.
|
2014-01-05 19:03:35 +00:00
|
|
|
print if true then if a then false.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation false.
|
2014-01-05 19:03:35 +00:00
|
|
|
print if true then if a then false.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable A : Type.
|
|
|
|
variable f : A -> A -> A -> Bool.
|
|
|
|
notation 100 _ |- _ ; _ : f.
|
|
|
|
print environment 1.
|
|
|
|
variable c : A.
|
|
|
|
variable d : A.
|
|
|
|
variable e : A.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c |- d ; e.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation true.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c |- d ; e.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable fact : A -> A.
|
|
|
|
notation 20 _ ! : fact.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c! !.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation false.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c! !.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation true.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable g : A -> A -> A.
|
|
|
|
notation 30 [ _ ; _ ] : g
|
2014-01-05 19:03:35 +00:00
|
|
|
print [c;d].
|
|
|
|
print [c ; [d;e] ].
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation false.
|
2014-01-05 19:03:35 +00:00
|
|
|
print [c ; [d;e] ].
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation true.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable h : A -> A -> A.
|
|
|
|
notation 40 _ << _ >> : h.
|
|
|
|
print environment 1.
|
|
|
|
print d << e >>.
|
|
|
|
print [c ; d << e >> ].
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation false.
|
2014-01-05 20:05:08 +00:00
|
|
|
print [c ; d << e >> ].
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation true.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable r : A -> A -> A.
|
|
|
|
infixl 30 ++ : r.
|
|
|
|
variable s : A -> A -> A.
|
|
|
|
infixl 40 ** : s.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c ** d ++ e ** c.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable p1 : Bool.
|
|
|
|
variable p2 : Bool.
|
|
|
|
variable p3 : Bool.
|
2014-01-05 19:03:35 +00:00
|
|
|
print p1 || p2 && p3.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation false.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c ** d ++ e ** c.
|
|
|
|
print p1 || p2 && p3.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation true.
|
2014-01-05 19:03:35 +00:00
|
|
|
print c = d || d = c.
|
|
|
|
print not p1 || p2.
|
|
|
|
print p1 && p3 || p2 && p3.
|
2014-01-09 16:33:52 +00:00
|
|
|
set_option lean::pp::notation false.
|
2014-01-05 19:03:35 +00:00
|
|
|
print not p1 || p2.
|
|
|
|
print p1 && p3 || p2 && p3.
|