Repository navigation
Conversation
strub
added this pull request to stack #1156
October 9, 2026 07:26
PR of the program-logic reorganization stack (see src/phl/REFACTORING.md). It migrates the `proc` tactic class: - `rules/<logic>/ec<Logic>FunDef.ml` (hoare, ehoare, bdhoare, equiv): a concrete procedure by its body; parameterless node, the side condition (the procedure is not abstract) re-checked by the builder. - `rules/<logic>/ec<Logic>FunAbs.ml` (hoare, ehoare, bdhoare, equiv): an abstract procedure with an invariant, stated on `[f : I ==> I]` exactly (bdhoare: `>= 1%r`); the node records the invariant, the builder re-checks that the procedure is abstract, the invariant independent of its globals, the oracles' memory restrictions (bdhoare) and that the goal is the conclusion of the rule (up to alpha-conversion). `proc I` is derived: the consequence rule to that conclusion, then the rule (bdhoare `= 1%r` through `>= 1%r`, as before). The hoare rule concludes with no exceptional postcondition; its .mli documents that it relies on unlisted exceptions being unconstrained. - rules/equiv/ecEquivFunAbsUpto.ml: the abstract upto rule (`proc B P Q`, `proc @[ll] ...`), likewise stated on its own conclusion and derived through the consequence rule; its elaboration is shared with `call`. - `rules/<logic>/ec<Logic>FunToCode.ml` (hoare, ehoare, bdhoare, equiv, and rules/eager/ecEagerFunToCode.ml): `proc*`, the procedure as a single call to fresh locals; parameterless nodes. - rules/ecPlFun.ml: the computations shared by these rules (argument substitution, oracle restrictions, losslessness hypothesis of an abstract procedure, the single-call statement of `proc*`). - EcPhlFun is reduced to the logic-agnostic dispatchers and the legacy adapters (interface unchanged, including FunAbsLow used by eager); the no-op FApi.t_low* wrappers are dropped. The dispatchers keep t_hF_or_bhF_or_eF (match on the goal, reducing it when it is not a judgement), as before. Behaviour is preserved: on the new test, the transcripts of the reference and new builds (all goals printed after each `proc`, and every error message) are identical. A new test, tests/proc.ec, exercises every rule in every logic (also through `call`) and the error paths. The stdlib, the unit tests and the examples pass under EC_RECHECK=1 with no RecheckFailure. Each of the 14 checkers, when deliberately broken, is caught only under EC_RECHECK, on the new test and, where the rule is used there, on the stdlib (files: hoareF-fun-def 13, bdhoareF-fun-def 31, equivF-fun-def 32, hoareF-fun-abs 12, bdhoareF-fun-abs 2, equivF-fun-abs 29, equivF-fun-abs-upto 9, equivF-fun-to-code 12; the ehoare rules and the hoare, bdhoare and eager `proc*` 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
proctactic class:rules/<logic>/ec<Logic>FunDef.ml(hoare, ehoare, bdhoare, equiv): aconcrete procedure by its body; parameterless node, the side
condition (the procedure is not abstract) re-checked by the builder.
rules/<logic>/ec<Logic>FunAbs.ml(hoare, ehoare, bdhoare, equiv): anabstract procedure with an invariant, stated on
[f : I ==> I]exactly (bdhoare:
>= 1%r); the node records the invariant, thebuilder re-checks that the procedure is abstract, the invariant
independent of its globals, the oracles' memory restrictions
(bdhoare) and that the goal is the conclusion of the rule (up to
alpha-conversion).
proc Iis derived: the consequence rule to thatconclusion, then the rule (bdhoare
= 1%rthrough>= 1%r, asbefore). The hoare rule concludes with no exceptional postcondition;
its .mli documents that it relies on unlisted exceptions being
unconstrained.
(
proc B P Q,proc @[ll] ...), likewise stated on its ownconclusion and derived through the consequence rule; its elaboration
is shared with
call.rules/<logic>/ec<Logic>FunToCode.ml(hoare, ehoare, bdhoare, equiv,and rules/eager/ecEagerFunToCode.ml):
proc*, the procedure as asingle call to fresh locals; parameterless nodes.
substitution, oracle restrictions, losslessness hypothesis of an
abstract procedure, the single-call statement of
proc*).adapters (interface unchanged, including FunAbsLow used by eager);
the no-op FApi.t_low* wrappers are dropped. The dispatchers keep
t_hF_or_bhF_or_eF (match on the goal, reducing it when it is not
a judgement), as before.
Behaviour is preserved: on the new test, the transcripts of the
reference and new builds (all goals printed after each
proc, andevery error message) are identical.
A new test, tests/proc.ec, exercises every rule in every logic (also
through
call) and the error paths. The stdlib, the unit tests andthe examples pass under EC_RECHECK=1 with no RecheckFailure. Each of
the 14 checkers, when deliberately broken, is caught only under
EC_RECHECK, on the new test and, where the rule is used there, on the
stdlib (files: hoareF-fun-def 13, bdhoareF-fun-def 31, equivF-fun-def
32, hoareF-fun-abs 12, bdhoareF-fun-abs 2, equivF-fun-abs 29,
equivF-fun-abs-upto 9, equivF-fun-to-code 12; the ehoare rules and
the hoare, bdhoare and eager
proc*rules are not used by thestdlib).