lean4-htt/tests/lean/run/eqnOptions.lean
Joachim Breitner f30ff6ae79
refactor: put new eqns options into backward namespace (#5207)
in #4154 and #5129 the rules for equational lemmas have changed, and new
options were introduced that can be used to revert to the pre-4.12
behavior. Hopefully nobody really needs these options besides for
backwards compatibility, therefore we put these options in the
`backward` option name space.

So the previous behavior can be achieved by setting
```lean
set_option backward.eqns.nonrecursive false
set_option backward.eqns.deepRecursiveSplit false
```
2024-08-29 17:03:51 +00:00

55 lines
969 B
Text

/-! Tests that options affecting equational theorems work as expected. -/
namespace Test1
def nonrecfun : Bool → Nat
| false => 0
| true => 0
/--
info: equations:
theorem Test1.nonrecfun.eq_1 : nonrecfun false = 0
theorem Test1.nonrecfun.eq_2 : nonrecfun true = 0
-/
#guard_msgs in
#print equations nonrecfun
end Test1
namespace Test2
set_option backward.eqns.nonrecursive false in
def nonrecfun : Bool → Nat
| false => 0
| true => 0
/--
info: equations:
theorem Test2.nonrecfun.eq_def : ∀ (x : Bool),
nonrecfun x =
match x with
| false => 0
| true => 0
-/
#guard_msgs in
#print equations nonrecfun
end Test2
namespace Test3
def nonrecfun : Bool → Nat
| false => 0
| true => 0
-- should have no effect
set_option backward.eqns.nonrecursive false
/--
info: equations:
theorem Test3.nonrecfun.eq_1 : nonrecfun false = 0
theorem Test3.nonrecfun.eq_2 : nonrecfun true = 0
-/
#guard_msgs in
#print equations nonrecfun
end Test3