Repository navigation
Conversation
strub
added this pull request to stack #1156
October 9, 2026 10:10
PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the `weakmem` tactic class:
- new trusted rule per logic, `t_<logic>_weakmem`
(`rules/{hoare,ehoare,bdhoare,equiv}/Ec<Logic>WeakMem`; equiv: one
side at a time): weakening of the memory of a judgement on a statement
by fresh local variables it does not mention. The node records the
typed variables (and the side); the pure builder restricts the goal's
memory and re-checks that the variables are the last declared ones,
fresh in the rest of the memory and unused by the judgement (new
shared computation EcPlWeakMem); checkers "hoare-weakmem",
"ehoare-weakmem", "bdhoare-weakmem", "equiv-weakmem".
- the tactic is derived in each logic (`t_<logic>_weakmem_hyp`): it cuts
the hypothesis weakened by the variables, and closes the cut
judgement by the rule (on each weakened side) and the hypothesis; the
visible goal is the implication the tactic always produced.
- EcPhlCodeTx.process_weakmem keeps the lookup of the hypothesis and the
typing of the variables, and dispatches on the logic of the
hypothesis; its interface is unchanged. The opaque `` `WeakenMem ``
node is gone.
Behaviour is preserved: same visible goal, same error messages in the
same order.
Validation: new test tests/weakmem.ec (every logic, each side and both
sides for equiv, the error paths; passes with the reference build and
this one under EC_RECHECK=1, with identical goals and error messages);
stdlib and unit pass under EC_RECHECK=1 with no RecheckFailure; each
checker, when broken, is caught only under EC_RECHECK=1, on the new
test and, for "bdhoare-weakmem", on the stdlib (1 failure:
Dexcepted.ec, the only use of weakmem; the other three rules are not
used by the stdlib).
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.
PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the
weakmemtactic class:t_<logic>_weakmem(
rules/{hoare,ehoare,bdhoare,equiv}/Ec<Logic>WeakMem; equiv: oneside at a time): weakening of the memory of a judgement on a statement
by fresh local variables it does not mention. The node records the
typed variables (and the side); the pure builder restricts the goal's
memory and re-checks that the variables are the last declared ones,
fresh in the rest of the memory and unused by the judgement (new
shared computation EcPlWeakMem); checkers "hoare-weakmem",
"ehoare-weakmem", "bdhoare-weakmem", "equiv-weakmem".
t_<logic>_weakmem_hyp): it cutsthe hypothesis weakened by the variables, and closes the cut
judgement by the rule (on each weakened side) and the hypothesis; the
visible goal is the implication the tactic always produced.
typing of the variables, and dispatches on the logic of the
hypothesis; its interface is unchanged. The opaque
`WeakenMemnode is gone.
Behaviour is preserved: same visible goal, same error messages in the
same order.
Validation: new test tests/weakmem.ec (every logic, each side and both
sides for equiv, the error paths; passes with the reference build and
this one under EC_RECHECK=1, with identical goals and error messages);
stdlib and unit pass under EC_RECHECK=1 with no RecheckFailure; each
checker, when broken, is caught only under EC_RECHECK=1, on the new
test and, for "bdhoare-weakmem", on the stdlib (1 failure:
Dexcepted.ec, the only use of weakmem; the other three rules are not
used by the stdlib).