2014-01-05 20:05:08 +00:00
|
|
|
import Int.
|
|
|
|
import Real.
|
|
|
|
variable f : Int -> Int -> Int
|
2014-01-05 19:03:35 +00:00
|
|
|
print forall a, f a a > 0
|
|
|
|
print forall a b, f a b > 0
|
2014-01-05 20:05:08 +00:00
|
|
|
variable g : Int -> Real -> Int
|
2014-01-05 19:03:35 +00:00
|
|
|
print forall a b, g a b > 0
|
|
|
|
print forall a b, g a (f a b) > 0
|
2014-01-06 05:45:31 +00:00
|
|
|
set::option pp::coercion true
|
2014-01-05 19:03:35 +00:00
|
|
|
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
|
2014-01-05 16:52:46 +00:00
|
|
|
-- 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.
|
2014-01-05 19:03:35 +00:00
|
|
|
print (fun a b, a + b) 10 20.
|
2014-01-05 20:05:08 +00:00
|
|
|
variable x : Int
|
2014-01-05 16:52:46 +00:00
|
|
|
-- The following one works because the type of x is used to decide which + should be used
|
2014-01-05 19:03:35 +00:00
|
|
|
print fun a b, a + x + b
|