16.1. Error Messages
When grind fails, its error message reports any search thresholds that were reached on the way.
This is typically not enough information to diagnose why grind failed, however.
Enabling the verbose flag causes the error message to show the subgoal that could not be solved, along with all the information returned by grind's subsystems—the contents of the “shared whiteboard.”
In particular, it presents equivalence classes of terms that it has determined to be equal.
The two largest classes are shown as True propositions and False propositions, listing every literal currently known to be provable or refutable.
Inspect these lists to spot missing facts or contradictory assumptions.
Verbose Failure Messages
This example uses grind in a situation where there is not sufficient information for it to prove the theorem.
example (f : Nat → Nat) (h : f 0 = 1) : f 1 = 1 := f:Nat → Nath:f 0 = 1⊢ f 1 = 1
All goals completed! 🐙
The resulting error message includes almost no information:
Enabling the verbose flag makes the error message much more informative:
example (f : Nat → Nat) (h : f 0 = 1) : f 1 = 1 := f:Nat → Nath:f 0 = 1⊢ f 1 = 1
All goals completed! 🐙
Threshold Messages
This attempted proof leads to an infinite chain of instantiates of the hypothesis:
example (f : Nat → Nat) (h : ∀ n, f n = f (n + 1)) : f 0 = 1 := f:Nat → Nath:∀ (n : Nat), f n = f (n + 1)⊢ f 0 = 1
All goals completed! 🐙
grind fails after too much E-matching:
To see which hypothesis reached the limit, add the verbose flag:
example (f : Nat → Nat) (h : ∀ n, f n = f (n + 1)) : f 0 = 1 := f:Nat → Nath:∀ (n : Nat), f n = f (n + 1)⊢ f 0 = 1
All goals completed! 🐙
The resulting message demonstrates that h is instantiated five times: