kdrag.diagnose

Explain a failed auto: the goal, why it failed, and a by= change that makes it pass.

Functions

explain(goal, error[, by, timeout, where, ...])

Text for a failed auto on goal; where and source locate the call.

location(filename, line, func)

` at file:line in func`, which terminals and editors make clickable.

repair(thm, by[, countermodel, timeout, budget])

The first small change to by that proves thm, or None: add a definition, add a suggested lemma, or drop a lemma (extra lemmas cause timeouts, not countermodels).

kdrag.diagnose.explain(goal, error, by=(), timeout=1000, where='', source='') → str

Text for a failed auto on goal; where and source locate the call.

Return type:

str

kdrag.diagnose.location(filename: str, line: int, func: str) → str

` at file:line in func`, which terminals and editors make clickable.

Parameters:
  • filename (str)

  • line (int)

  • func (str)

Return type:

str

kdrag.diagnose.repair(thm: BoolRef, by: list[Proof], countermodel=False, timeout=50, budget=0.2) → list[Proof] | None

The first small change to by that proves thm, or None: add a definition, add a suggested lemma, or drop a lemma (extra lemmas cause timeouts, not countermodels).

Parameters:
  • thm (BoolRef)

  • by (list[Proof])

Return type:

list[Proof] | None