lean2/tests/lean/implicit1.lean
Leonardo de Moura 4ba097a141 feat(frontends/lean): use lowercase commands, replace 'endscope' and 'endnamespace' with 'end'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 13:06:36 -08:00

20 lines
No EOL
744 B
Text

import Int.
import Real.
variable f : Int -> Int -> Int
print forall a, f a a > 0
print forall a b, f a b > 0
variable g : Int -> Real -> Int
print forall a b, g a b > 0
print forall a b, g a (f a b) > 0
setoption pp::coercion true
print forall a b, g a (f a b) > 0
print fun a, a + 1
print fun a b, a + b
print fun (a b) (c : Int), a + c + b
-- The next example shows a limitation of the current elaborator.
-- The current elaborator resolves overloads before solving the implicit argument constraints.
-- So, it does not have enough information for deciding which overload to use.
print (fun a b, a + b) 10 20.
variable x : Int
-- The following one works because the type of x is used to decide which + should be used
print fun a b, a + x + b