-
Notifications
You must be signed in to change notification settings - Fork 167
Add requires annotation (Req) to simp #680
Description
It is often helpful if a proof that needs maintenance breaks as early as something goes wrong. In a proof that consists mostly of rewrites being applied, new breakage can be hard to track down because calls to simp, fs, rw etc do not stop even if the supplied theorems fail to be used.
This issue is about adding a new theorem annotation Req which causes simp/fs/rw to fail in case the annotated theorem isn't successfully applied as a rewrite.
Example:
simp [Req vital_thm]
would fail with a HOL_ERR in case vital_thm isn't successfully used at least once on the current goal.
This issue was discussed on slack, where @konrad-slind mentioned:
BTW: the rewrite tracking stuff is in https://github.com/HOL-Theorem-Prover/HOL/blob/master/src/simp/src/Cond_rewr.sml. Look for
track_rewritesandused_rewrites. It's very simplistic, but accumulates every rewrite made into a ref list. Checking that an instance of a given, required, rewrite actually appears in theused_rewriteslist would need a bit more work. If the required instance didn't appear, then the conversion would have to fail, and that would be even more work.