Repository navigation
Conversation
strub
added this pull request to stack #1156
October 6, 2026 15:49
strub
force-pushed
the
pl/recheck-basis
branch
4 times, most recently
from
October 7, 2026 06:19
9b3bfea to
d34bef9
Compare
First PR of a stack that reorganizes the program-logic tactics (src/phl) into a uniform four-layer structure per tactic (dispatch, elaboration, rule, checker), one tactic class per PR. The design and the per-tactic recipe are in src/phl/REFACTORING.md; src/phl/README.md is the short reference. This supersedes the draft #1041. The design also fixes two conventions every migrated rule follows: a trusted rule is stated on exactly the statement it governs, with no implicit seq-ing or framing (splitting is the seq rule's job, framing that of a single frame rule per logic; surface tactics acting on larger programs are derived compositions), and each rule is documented in its .mli as an inference rule, separately from the derived tactics. Today a low-level tactic closes its goal with an opaque VExtern node: the tag records that a rule fired, not with which parameters, so a proof step cannot be re-validated. This PR adds the kernel support for recheckable nodes, without migrating any rule yet: - ecCoreGoal: an open `rule` type and a `VRule of rule * handle list` validation node, emitted by FApi.xrule / xrule1 / xrule_hyps / xrule1_hyps; a registry of rule checkers (register_rule_checker) and a driver, recheck_proofenv, that reruns the checker of every VRule node of a proof (raising RecheckFailure on mismatch). Nodes without a registered checker, and VExtern nodes, are skipped. - ecScope: the driver runs at `qed` when EC_RECHECK is set, so normal runs pay nothing. - EcPlRecheck: shared checker scaffolding. A checker rebuilds the subgoals from the recorded parameters and compares them, up to conversion, with the stored ones. No behaviour change: with no rule migrated, the stdlib and the unit tests pass unchanged, with and without EC_RECHECK=1.
strub
force-pushed
the
pl/recheck-basis
branch
from
October 7, 2026 07:16
d34bef9 to
b18fd54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of a stack that reorganizes the program-logic tactics
(src/phl) into a uniform four-layer structure per tactic (dispatch,
elaboration, rule, checker), one tactic class per PR. The design and
the per-tactic recipe are in src/phl/REFACTORING.md; src/phl/README.md
is the short reference. This supersedes the draft #1041.
The design also fixes two conventions every migrated rule follows: a
trusted rule is stated on exactly the statement it governs, with no
implicit seq-ing or framing (splitting is the seq rule's job, framing
that of a single frame rule per logic; surface tactics acting on
larger programs are derived compositions), and each rule is
documented in its .mli as an inference rule, separately from the
derived tactics.
Today a low-level tactic closes its goal with an opaque VExtern node:
the tag records that a rule fired, not with which parameters, so a
proof step cannot be re-validated. This PR adds the kernel support for
recheckable nodes, without migrating any rule yet:
ruletype and aVRule of rule * handle listvalidation node, emitted by FApi.xrule / xrule1 / xrule_hyps /
xrule1_hyps; a registry of rule checkers (register_rule_checker) and
a driver, recheck_proofenv, that reruns the checker of every VRule
node of a proof (raising RecheckFailure on mismatch). Nodes without a
registered checker, and VExtern nodes, are skipped.
qedwhen EC_RECHECK is set, so normalruns pay nothing.
subgoals from the recorded parameters and compares them, up to
conversion, with the stored ones.
No behaviour change: with no rule migrated, the stdlib and the unit
tests pass unchanged, with and without EC_RECHECK=1.