ufmg-smite / lean-smt

Tactics for discharging Lean goals into SMT solvers.
Apache License 2.0
84 stars 18 forks source link

Add support basic for recursive functions. #30

Closed abdoo8080 closed 2 years ago

abdoo8080 commented 2 years ago

This PR adds support for basic recursive functions. Mutually recursive functions are not supported yet. We use Meta.getUnfoldEqnFor? instead of Meta.unfoldDefinition? because the latter returns the kernel's definition of functions. Since the kernel does not support recursive functions, unfoldDefinition? returns their definition in terms of general recursors and WellFounded.fix. It's hard to recover the original definition from those compiled versions, so we use Meta.getUnfoldEqnFor? to get the user friendly version shown by the unfold tactic.