Skip to content

Feature request: clearer error message from step* when missing a basic preamble proof step #1212

Description

@mdittmer
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions