jacopy.proof.search.SearchStrategy

class jacopy.proof.search.SearchStrategy(*, prefer='shortest', max_depth=12, max_states=5000, beam_width=32, max_solutions=16)

Bases: Strategy

Find 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)
Parameters:
  • prefer (str)

  • max_depth (int)

  • max_states (int)

  • beam_width (int)

  • max_solutions (int)

Return type:

None

Methods

__init__(*[, prefer, max_depth, max_states, ...])

prove(lhs, rhs, *[, registry, engine])

Produce a ProofChain witnessing lhs == rhs.

Attributes

name

last_stats

statistics of the most recent prove() call (states explored, proofs found, which engine closed, the candidate proof lengths).

last_solutions

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 ProofChain witnessing lhs == rhs.

Raises ProofFailure if the strategy cannot close the gap. Implementations may ignore either registry or engine depending on how they work.

Parameters:
Return type:

ProofChain