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
@strub
strub force-pushed the pl/true-zero-exfalso branch from b57ab2b to a7a768a Compare October 6, 2026 20:43
@strub strub added the stacked Intermediate PR of a stack: CI skipped unless it targets main label Oct 7, 2026
@strub
strub force-pushed the pl/true-zero-exfalso branch from a7a768a to 3f15672 Compare October 7, 2026 06:19
@strub
strub force-pushed the pl/true-zero-exfalso branch 2 times, most recently from 0e73e1e to 43212c3 Compare October 8, 2026 05:51
@strub
strub force-pushed the pl/true-zero-exfalso branch from 43212c3 to e778a6c Compare October 8, 2026 06:50
@strub
strub force-pushed the pl/true-zero-exfalso branch 2 times, most recently from 1466975 to 3c8fd4c Compare October 9, 2026 07:25
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 3c8fd4c to 268180f Compare October 9, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stacked Intermediate PR of a stack: CI skipped unless it targets main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant