lean4-htt/tests/lean/run/abstractExpr.lean
Leonardo de Moura 164f07a5e5 feat: generalize Expr.abstractRange
It now takes free variables **and** metavariables.
This is the first step to make `mkForallFVars` and `mkLambdaFVars`
more general.
2022-03-08 18:19:17 -08:00

13 lines
348 B
Text

import Lean
open Lean
open Lean.Meta
def test : MetaM Unit := do
let x ← mkFreshExprMVar (mkConst ``Nat)
let y ← mkFreshExprMVar (mkConst ``Nat)
let add := mkConst ``Nat.add
let e := mkApp3 add x (mkNatLit 1) y
IO.println (e.abstract #[x, y])
assert! e.abstract #[x, y] == mkApp3 add (mkBVar 1) (mkNatLit 1) (mkBVar 0)
#eval test