Skip to content

refactor(pl): true, zero and exfalso as recheckable per-logic rules - #1159

Open
strub wants to merge 1 commit into
pl/skipfrom
pl/true-zero-exfalso
Open

strub wants to merge 1 commit into
pl/skipfrom
pl/true-zero-exfalso

Conversation

@strub

@strub strub commented Oct 6, 2026

Copy link
Copy Markdown
Member

Fifth PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the rules closing trivially valid
judgements, formerly in EcPhlTAuto; they are axioms of the program
logics (no other rule derives them), so they are trusted:

  • rules/hoare/ecHoareTrue.ml: hoare [_ : P ==> true] (every
    postcondition, exceptional ones included, is true);
  • rules/ehoare/ecEHoareZero.ml: ehoare [_ : P ==> 0%xr];
  • rules/{hoare,bdhoare,equiv}/ecExfalso.ml: a false
    precondition (for bdhoare, with the premise 0%r <= d). ehoare has
    no such rule: its precondition is an expectation, never false.

Each rule comes in statement and procedure form, is documented as an
inference rule in its .mli, and emits a (parameterless) node with a
registered checker; its side condition is part of the subgoal builder,
so the checker re-validates it. EcPhlTAuto keeps its interface, as
adapters and the logic-agnostic exfalso dispatcher. Behaviour is
unchanged.

A new test, tests/true-zero-exfalso.ec, exercises every rule. The
stdlib and the unit tests pass under EC_RECHECK=1 with no
RecheckFailure; each of the ten checkers, when deliberately broken, is
caught only under EC_RECHECK (on the new test; on the stdlib too where
the rule is used there: hoareS-true 14 files, hoareF-true 4, hoare /
bdhoare / equiv exfalso 1 each).

@strub
strub added this pull request to stack #1156 October 6, 2026 19:06
Fifth PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the rules closing trivially valid
judgements, formerly in EcPhlTAuto; they are axioms of the program
logics (no other rule derives them), so they are trusted:

- rules/hoare/ecHoareTrue.ml: `hoare [_ : P ==> true]` (every
  postcondition, exceptional ones included, is true);
- rules/ehoare/ecEHoareZero.ml: `ehoare [_ : P ==> 0%xr]`;
- rules/{hoare,bdhoare,equiv}/ec<Logic>Exfalso.ml: a false
  precondition (for bdhoare, with the premise `0%r <= d`). ehoare has
  no such rule: its precondition is an expectation, never `false`.

Each rule comes in statement and procedure form, is documented as an
inference rule in its .mli, and emits a (parameterless) node with a
registered checker; its side condition is part of the subgoal builder,
so the checker re-validates it. EcPhlTAuto keeps its interface, as
adapters and the logic-agnostic exfalso dispatcher. Behaviour is
unchanged.

A new test, tests/true-zero-exfalso.ec, exercises every rule. The
stdlib and the unit tests pass under EC_RECHECK=1 with no
RecheckFailure; each of the ten checkers, when deliberately broken, is
caught only under EC_RECHECK (on the new test; on the stdlib too where
the rule is used there: hoareS-true 14 files, hoareF-true 4, hoare /
bdhoare / equiv exfalso 1 each).
@strub
strub force-pushed the pl/true-zero-exfalso branch from b57ab2b to a7a768a Compare October 6, 2026 20:43
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