This PR allows the use of `dsimp` during preprocessing of well-founded definitions. This fixes regressions when using `if-then-else` without giving a name to the condition, but where the condition is needed for the termination proof, in cases where that subexpression is reachable only by dsimp, but not by simp (e.g. inside a dependent let) Also fixes some preprocessing lemmas to not be bad simp lemmas (with lambdas on the LHS, due to dot notation and unfortunate argument order) This fixes #7408.
13 lines
357 B
Text
13 lines
357 B
Text
def computeFuel (mass : Nat) : Nat :=
|
|
let rec go acc cur :=
|
|
let n := cur / 3 - 2
|
|
if n = 0 then acc + cur else go (acc + cur) n
|
|
termination_by cur
|
|
go 0 mass - mass
|
|
|
|
def computeFuel' (mass : Nat) : Nat :=
|
|
let rec go acc cur :=
|
|
letI n := cur / 3 - 2
|
|
if n = 0 then acc + cur else go (acc + cur) n
|
|
termination_by cur
|
|
go 0 mass - mass
|