Repository navigation
Conversation
PR of the program-logic reorganization stack (see
src/phl/REFACTORING.md). It migrates the `circuit` tactic class
(`circuit`, `circuit simplify`, `extens`), which closed or rewrote goals
with the opaque `VBdep` validation:
- `circuit`: trusted rules without premise `EcHoareCircuit`,
`EcEquivCircuit` and, on a goal that is not a statement judgement,
`EcFolCircuit` (new `rules/fol/`, for the rules whose conclusion is a
plain formula). Parameterless nodes; the checkers ("hoare-circuit",
"equiv-circuit", "fol-circuit") re-run the circuit decision, a
deterministic function of the goal and its hypotheses (expensive:
only under EC_RECHECK).
- `circuit simplify`: trusted rule `EcHoareCircuitSimplify`, whose
premise has the postcondition simplified by circuits; the checker
("hoare-circuit-simplify") re-runs the simplification.
- `extens`: trusted rules `EcHoareExtens` (one premise per value of a
program variable of a type bound to a bitstring; node: the resolved
variable) and `EcFolExtens` (`all p (iota_ s n)` from its `n`
instances); checkers "hoare-extens" and "fol-extens". The tactic is
derived: the rule, then the given tactic on each premise, which must
close it. The proofs of the instances are now kept in the proof tree
(and rechecked), instead of being discarded.
- The translation of the precondition and the decision of the
postcondition, shared by the hoare and equiv rules, move to
`rules/EcPlCircuit`.
- `EcPhlBDep` is reduced to the dispatchers and the derived `extens`;
its interface is unchanged.
Behaviour is preserved, error messages included.
Validation: new test tests/circuits/circuit_rules.ec (every rule, every
error path), passing with and without the change, the error messages
compared; stdlib + unit under EC_RECHECK=1. Each checker, when broken,
is caught only under EC_RECHECK; the rules are not used by the stdlib,
only by tests/circuits.
strub
added this pull request to stack #1156
October 9, 2026 15:50
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
circuittactic class(
circuit,circuit simplify,extens), which closed or rewrote goalswith the opaque
VBdepvalidation:circuit: trusted rules without premiseEcHoareCircuit,EcEquivCircuitand, on a goal that is not a statement judgement,EcFolCircuit(newrules/fol/, for the rules whose conclusion is aplain formula). Parameterless nodes; the checkers ("hoare-circuit",
"equiv-circuit", "fol-circuit") re-run the circuit decision, a
deterministic function of the goal and its hypotheses (expensive:
only under EC_RECHECK).
circuit simplify: trusted ruleEcHoareCircuitSimplify, whosepremise has the postcondition simplified by circuits; the checker
("hoare-circuit-simplify") re-runs the simplification.
extens: trusted rulesEcHoareExtens(one premise per value of aprogram variable of a type bound to a bitstring; node: the resolved
variable) and
EcFolExtens(all p (iota_ s n)from itsninstances); checkers "hoare-extens" and "fol-extens". The tactic is
derived: the rule, then the given tactic on each premise, which must
close it. The proofs of the instances are now kept in the proof tree
(and rechecked), instead of being discarded.
postcondition, shared by the hoare and equiv rules, move to
rules/EcPlCircuit.EcPhlBDepis reduced to the dispatchers and the derivedextens;its interface is unchanged.
Behaviour is preserved, error messages included.
Validation: new test tests/circuits/circuit_rules.ec (every rule, every
error path), passing with and without the change, the error messages
compared; stdlib + unit under EC_RECHECK=1. Each checker, when broken,
is caught only under EC_RECHECK; the rules are not used by the stdlib,
only by tests/circuits.