lean2/tests/lean/run/n2.lean
Leonardo de Moura 3e3c4ee5ed feat(frontends/lean/parser): add local_scope object to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-18 08:38:23 -07:00

26 lines
600 B
Text

variable A : Type.{1}
variable a : A
variable g : A → A
variable f : A → A → A
precedence `|` : 0
(*
local f = Const("f")
local g = Const("g")
local bar = name("|")
local rcurly = name("}")
local lcurly = name("{")
function parse_set()
parser.check_token_next(lcurly, "'{' expected")
local s = parser.parse_binder()
parser.check_token_next(bar, "'|' expected")
local e = parser.parse_scoped_expr(s)
parser.check_token_next(rcurly, "'}' expected")
print(e)
return parser.abstract(s, g(e))
end
*)
notation `set` A:(call parse_set) := A
check set { x : A | f x x }