Skip to content

phl: recheckable proof-nodes and the basis of the program-logic refactoring - #1151

Closed
strub wants to merge 1 commit into
mainfrom
phl/recheck-basis
Closed

strub wants to merge 1 commit into
mainfrom
phl/recheck-basis

Conversation

@strub

@strub strub commented Oct 6, 2026

Copy link
Copy Markdown
Member

First PR of a stack that reorganizes 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.

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.
  • EcPhlRecheck: 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.

…toring

First PR of a stack that reorganizes 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.

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.
- EcPhlRecheck: 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
strub added this pull request to stack #1153 October 6, 2026 15:41
@strub strub closed this Oct 6, 2026
@strub
strub deleted the phl/recheck-basis branch October 6, 2026 15:46
@strub
strub removed this pull request from stack #1153 October 6, 2026 15:49
@strub

strub commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Superseded by #1154 (the branch was renamed to pl/recheck-basis, which closed this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant