Skip to content

refactor(pl): symmetry as recheckable per-logic rules - #1160

Open
strub wants to merge 1 commit into
pl/true-zero-exfalsofrom
pl/sym
Open

strub wants to merge 1 commit into
pl/true-zero-exfalsofrom
pl/sym

Conversation

@strub

@strub strub commented Oct 6, 2026

Copy link
Copy Markdown
Member

PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the symmetry tactic class:

  • rules/equiv/ecEquivSym.ml: the two trusted symmetry rules of the
    equiv logic, for statements (equiv [c ~ c' : P ==> Q] from
    equiv [c' ~ c : P' ==> Q'], the memory types exchanged as well)
    and for procedures, where P' and Q' are P and Q with their two
    memories swapped. Each is documented as an inference rule in the
    .mli and emits a (parameterless) node with a registered checker
    ("equivS-sym", "equivF-sym"). The subgoal builder needs no
    environment and the rules have no side condition.
  • EcPhlSym is reduced to the dispatcher (interface unchanged), still
    used by symmetry and rewrite equiv.

Behaviour is unchanged.

A new test, tests/sym-equiv.ec, exercises both rules (including
different local variables on each side) and the error paths; it
passes with the builds before and after this change. The stdlib and
the unit tests pass under EC_RECHECK=1 with no RecheckFailure; each
checker, when deliberately broken, is caught only under EC_RECHECK
(on the new test, and on the stdlib: equivS-sym 4 files, equivF-sym
4).

@strub
strub added this pull request to stack #1156 October 6, 2026 21:31
@strub strub added the stacked Intermediate PR of a stack: CI skipped unless it targets main label Oct 7, 2026
PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the `symmetry` tactic class:

- rules/equiv/ecEquivSym.ml: the two trusted symmetry rules of the
  equiv logic, for statements (`equiv [c ~ c' : P ==> Q]` from
  `equiv [c' ~ c : P' ==> Q']`, the memory types exchanged as well)
  and for procedures, where P' and Q' are P and Q with their two
  memories swapped. Each is documented as an inference rule in the
  .mli and emits a (parameterless) node with a registered checker
  ("equivS-sym", "equivF-sym"). The subgoal builder needs no
  environment and the rules have no side condition.
- EcPhlSym is reduced to the dispatcher (interface unchanged), still
  used by `symmetry` and `rewrite equiv`.

Behaviour is unchanged.

A new test, tests/sym-equiv.ec, exercises both rules (including
different local variables on each side) and the error paths; it
passes with the builds before and after this change. The stdlib and
the unit tests pass under EC_RECHECK=1 with no RecheckFailure; each
checker, when deliberately broken, is caught only under EC_RECHECK
(on the new test, and on the stdlib: equivS-sym 4 files, equivF-sym
4).
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