Skip to content

Add requires annotation (Req) to simp #680

@myreen

Description

@myreen

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_rewrites and used_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 the used_rewrites list 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions