Repository navigation
Conversation
strub
added this pull request to stack #1156
October 6, 2026 21:47
strub
force-pushed
the
pl/sp
branch
2 times, most recently
from
October 8, 2026 05:51
7ccf5e4 to
7dd59bd
Compare
strub
force-pushed
the
pl/sp
branch
2 times, most recently
from
October 8, 2026 08:29
b81af94 to
59b2110
Compare
PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the `sp` tactic class:
- rules/ecPlSp.ml: the strongest-postcondition calculus, moved
unchanged out of EcPhlSp, shared by the rules of every logic.
- rules/hoare/ecHoareSp.ml, rules/equiv/ecEquivSp.ml: trusted rules
stated on the sp-able statement(s) only,
hoare [c : P ==> sp(c, P)]
and
equiv [c ~ c' : P ==> sp(c, c', P)]
each with a parameterless node and a registered checker; the side
conditions (sp-able statements, postcondition convertible to their sp)
are part of the subgoal builder. The surface `sp` is now derived: the
migrated `seq` rule at the end of the longest sp-able prefix
(two-sided for equiv), with sp as intermediate assertion, its first
premise closed by the sp rule. The visible goal is unchanged.
- rules/bdhoare/ecBdHoareSp.ml: the bdhoare rule keeps its implicit
seq, i.e. it is still stated on `c1; c2`, with the resolved split
index in its node and a registered checker. Deriving it from the
bdhoare `seq` rule would need closing extra premises (a bound for the
prefix, the arithmetic and non-modification premises) with
best-effort tactics and a further trusted rule; this is documented
as such in its .mli. Its side condition (the bound is not written by
the prefix) is re-checked by the builder.
- EcPhlSp is reduced to the logic-agnostic dispatchers (interface
unchanged); the no-op FApi.t_low1 wrapper is dropped. ehoare goals
are still not supported.
Behaviour is preserved: goals and error messages are identical, as
checked against an unmodified build on 38 sp invocations (all logics,
positions, failing cases).
A new test, tests/sp.ec, exercises the three logics, positions,
exceptional postconditions and the error paths. The stdlib and the unit
tests pass under EC_RECHECK=1 with no RecheckFailure; each of the three
checkers, when deliberately broken, is caught only under EC_RECHECK
(on the new test, and on the stdlib: hoare-sp 7 files, equiv-sp 16,
bdhoare-sp 8). The examples using `sp` also pass under EC_RECHECK=1.
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
sptactic class:rules/ecPlSp.ml: the strongest-postcondition calculus, moved
unchanged out of EcPhlSp, shared by the rules of every logic.
rules/hoare/ecHoareSp.ml, rules/equiv/ecEquivSp.ml: trusted rules
stated on the sp-able statement(s) only,
and
each with a parameterless node and a registered checker; the side
conditions (sp-able statements, postcondition convertible to their sp)
are part of the subgoal builder. The surface
spis now derived: themigrated
seqrule at the end of the longest sp-able prefix(two-sided for equiv), with sp as intermediate assertion, its first
premise closed by the sp rule. The visible goal is unchanged.
rules/bdhoare/ecBdHoareSp.ml: the bdhoare rule keeps its implicit
seq, i.e. it is still stated on
c1; c2, with the resolved splitindex in its node and a registered checker. Deriving it from the
bdhoare
seqrule would need closing extra premises (a bound for theprefix, the arithmetic and non-modification premises) with
best-effort tactics and a further trusted rule; this is documented
as such in its .mli. Its side condition (the bound is not written by
the prefix) is re-checked by the builder.
EcPhlSp is reduced to the logic-agnostic dispatchers (interface
unchanged); the no-op FApi.t_low1 wrapper is dropped. ehoare goals
are still not supported.
Behaviour is preserved: goals and error messages are identical, as
checked against an unmodified build on 38 sp invocations (all logics,
positions, failing cases).
A new test, tests/sp.ec, exercises the three logics, positions,
exceptional postconditions and the error paths. The stdlib and the unit
tests pass under EC_RECHECK=1 with no RecheckFailure; each of the three
checkers, when deliberately broken, is caught only under EC_RECHECK
(on the new test, and on the stdlib: hoare-sp 7 files, equiv-sp 16,
bdhoare-sp 8). The examples using
spalso pass under EC_RECHECK=1.