Reason: 1- Tactics such as `assumption` should ignore them. 2- We must annotate recursive applications with `mkRecAppWithSyntax`.
8 lines
235 B
Text
8 lines
235 B
Text
def sum (as : Array Nat) : Nat :=
|
|
let rec go (i : Nat) (s : Nat) : Nat :=
|
|
if h : i < as.size then
|
|
go (i+2) (s + as.get ⟨i, h⟩) -- Error
|
|
else
|
|
s
|
|
go 0 0
|
|
termination_by measure (fun ⟨a, i, _⟩ => a.size - i)
|