lean4-htt/tests/lean/run/wfEqns3.lean
Leonardo de Moura 381f66428a chore: use termination_by'
We are going to define a higher level syntax for `termination_by`.
2022-01-11 15:00:53 -08:00

20 lines
322 B
Text

import Lean
open Lean
open Lean.Meta
def tst (declName : Name) : MetaM Unit := do
IO.println (← getUnfoldEqnFor? declName)
def f (x : Nat) : Nat :=
if h : x = 0 then
1
else
f (x - 1) * 2
termination_by' measure id
decreasing_by
apply Nat.pred_lt
exact h
#eval tst ``f
#check f._eq_1
#check f._unfold