jacopy.proof.search.SearchStrategy¶
- class jacopy.proof.search.SearchStrategy(*, prefer='shortest', max_depth=12, max_states=5000, beam_width=32, max_solutions=16)¶
Bases:
StrategyFind a proof by graph search and return the best one found.
- Parameters:
prefer (str) – Scorer name from
SCORERS(default"shortest").max_depth (int) – Maximum number of moves in a proof (BFS horizon).
max_states (int) – Budget of distinct expressions to explore before falling back to beam mode.
beam_width (int) – Frontier width of the beam fallback.
max_solutions (int) – Stop collecting proofs after this many are found (they are scored and the best is returned).
- __init__(*, prefer='shortest', max_depth=12, max_states=5000, beam_width=32, max_solutions=16)¶
Methods
__init__(*[, prefer, max_depth, max_states, ...])prove(lhs, rhs, *[, registry, engine])Produce a
ProofChainwitnessinglhs == rhs.Attributes
namestatistics of the most recent prove() call (states explored, proofs found, which engine closed, the candidate proof lengths).
every proof found by the most recent prove() call, as lists of ProofSteps (BFS solutions in discovery order; in beam mode the single found proof).
- last_stats: Dict[str, object]¶
statistics of the most recent prove() call (states explored, proofs found, which engine closed, the candidate proof lengths). Purely informational.
- Type:
Observation hook
- last_solutions: List[List[ProofStep]]¶
every proof found by the most recent prove() call, as lists of ProofSteps (BFS solutions in discovery order; in beam mode the single found proof).
- Type:
Observation hook
- prove(lhs, rhs, *, registry=None, engine=None)¶
Produce a
ProofChainwitnessinglhs == rhs.Raises
ProofFailureif the strategy cannot close the gap. Implementations may ignore eitherregistryorenginedepending on how they work.- Parameters:
lhs (Expr)
rhs (Expr)
registry (PropertyRegistry | None)
engine (ExpansionEngine | None)
- Return type: