structure Gate where
limit : Std.U32
«open» : Bool
def is_open (gate : Gate) : Result Bool := do
ok gate.«open»
@[step]
theorem is_open_is_sound (gate : Gate) : is_open gate ⦃ r => True ⦄ := by
step*
yields error message
fail to show termination for
is_open_is_sound
with errors
failed to infer structural recursion:
Not considering parameter gate of is_open_is_sound:
it is unchanged in the recursive calls
no parameters suitable for structural recursion
well-founded recursion cannot be used, `is_open_is_sound` does not take any (non-fixed) arguments
which does not give a very clear indication of what went wrong and what to do about it. To be fair, this was a naive proof attempt that is fixed by replacing step* with unfold is_open; step*, but a more helpful error message would be nice.
yields error message
which does not give a very clear indication of what went wrong and what to do about it. To be fair, this was a naive proof attempt that is fixed by replacing
step*withunfold is_open; step*, but a more helpful error message would be nice.