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 `call` tactic class (`call` in
every logic, with a specification, an invariant `call (: I)`, the upto
form `call (: bad, I, J)`, one-sided `call{i}`, and `call /fc`):
- rules/hoare/EcHoareCall: rule
hoare [f : P ==> Q | E_f] |-
hoare [lv <@ f(a) : P[arg := a] /\ W ==> R | E]
on the call alone, `W` being the weakest precondition of the call
computed as before
(`forall result (mod f), Q[res := result] => R[lv := result]`, and
the exceptional conditions).
- rules/ehoare/EcEHoareCall: the existing core rule on the call alone,
now a recheckable node; `call /fc` moves there.
- rules/equiv/EcEquivCall: the two-sided rule on the two calls alone,
and the one-sided rule on `lv <@ f(a) ~ skip` (premise
`phoare [f : P ==> Q] = 1%r`).
- rules/bdhoare/EcBdHoareCall: the bdhoare rule keeps its composite
statement on `c; lv <@ f(a)` (implicit seq and framing): the bdhoare
`seq` rule also bounds the runs of the prefix ending outside the
intermediate assertion, which this rule does not. It is documented as
such and is now a recheckable node, whose builder re-checks the
conditions on the bound of #1189.
- The surface tactics are derived: `seq` before the call(s), with the
weakest precondition of the call(s) as intermediate assertion, then
the rule; the specification premise comes first, as before. Their
side conditions are re-checked by the builders of the rules.
- rules/EcPlCall: the result assignment and argument substitution
shared by the rules.
- The typing of the cut of `call` (specification, invariant, upto) moves
to each logic's module (`process_<logic>_call_cut`). EcPhlCall is
reduced to the dispatchers and positional adapters; its interface is
unchanged.
Behaviour is preserved: the goal traces (`compile -trace`) of the 81
files of theories/, tests/ and examples/ using `call` that compile are
identical (the order of the module restrictions in a printed context of
examples/prg-tutorial/PRGc.ec differs, as it follows identifier
creation), and so are the error messages of the 25 failing `call`s of
the new test.
`call /fc` types its cut as `call` does (the fix of #1196 on main,
carried over). The documentation records one soundness issue, not
addressed here: the bdhoare rule with an explicit bound for the
procedure (OCaml API only, never given by the tactics) is unsound for
`=`, and for `>=` with a non-positive bound.
Validation: tests/call-rules.ec (every rule in every logic, the
derived forms and their error paths; it also passes with the previous
build); stdlib (128 files) and unit (147) under EC_RECHECK=1 with no
RecheckFailure; the 25 examples using `call` under EC_RECHECK=1. Each
checker, when broken, is caught only under EC_RECHECK=1, on the new
test and on the stdlib: hoare-call 12 files, bdhoare-call 21,
equiv-call 28, equiv-call-onesided 5, ehoare-call 0 (unused there).
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
calltactic class (callinevery logic, with a specification, an invariant
call (: I), the uptoform
call (: bad, I, J), one-sidedcall{i}, andcall /fc):rules/hoare/EcHoareCall: rule
on the call alone,
Wbeing the weakest precondition of the callcomputed as before
(
forall result (mod f), Q[res := result] => R[lv := result], andthe exceptional conditions).
rules/ehoare/EcEHoareCall: the existing core rule on the call alone,
now a recheckable node;
call /fcmoves there.rules/equiv/EcEquivCall: the two-sided rule on the two calls alone,
and the one-sided rule on
lv <@ f(a) ~ skip(premisephoare [f : P ==> Q] = 1%r).rules/bdhoare/EcBdHoareCall: the bdhoare rule keeps its composite
statement on
c; lv <@ f(a)(implicit seq and framing): the bdhoareseqrule also bounds the runs of the prefix ending outside theintermediate assertion, which this rule does not. It is documented as
such and is now a recheckable node, whose builder re-checks the
conditions on the bound of fix: reject a pHL bound read in another memory by
call/rnd#1189.The surface tactics are derived:
seqbefore the call(s), with theweakest precondition of the call(s) as intermediate assertion, then
the rule; the specification premise comes first, as before. Their
side conditions are re-checked by the builders of the rules.
rules/EcPlCall: the result assignment and argument substitution
shared by the rules.
The typing of the cut of
call(specification, invariant, upto) movesto each logic's module (
process_<logic>_call_cut). EcPhlCall isreduced to the dispatchers and positional adapters; its interface is
unchanged.
Behaviour is preserved: the goal traces (
compile -trace) of the 81files of theories/, tests/ and examples/ using
callthat compile areidentical (the order of the module restrictions in a printed context of
examples/prg-tutorial/PRGc.ec differs, as it follows identifier
creation), and so are the error messages of the 25 failing
calls ofthe new test.
call /fctypes its cut ascalldoes (the fix of #1196 on main,carried over). The documentation records one soundness issue, not
addressed here: the bdhoare rule with an explicit bound for the
procedure (OCaml API only, never given by the tactics) is unsound for
=, and for>=with a non-positive bound.Validation: tests/call-rules.ec (every rule in every logic, the
derived forms and their error paths; it also passes with the previous
build); stdlib (128 files) and unit (147) under EC_RECHECK=1 with no
RecheckFailure; the 25 examples using
callunder EC_RECHECK=1. Eachchecker, when broken, is caught only under EC_RECHECK=1, on the new
test and on the stdlib: hoare-call 12 files, bdhoare-call 21,
equiv-call 28, equiv-call-onesided 5, ehoare-call 0 (unused there).