final class CompletionWitness

Proves cheap feasible continuations before the complete search; a failed probe proves nothing. Every emitted witness actually walks the patterns, budget and output obligation without constructing SQL.

Methods§

public function __construct(
    private CompletionCosts $costs,
    private PatternProductions $productions,
    private CompletionMemo $memo,
)

Shares immutable production matches and unconstrained costs with the complete solver.

Parameters

public function complete(
    list<Symbol> $symbols,
    GenerationPlan<bool> $plan,
    array<string, int> $occurrences,
    bool $nonEmpty,
    int $budget,
): ?int
public function remember(
    list<array{string, int}> $path,
    GenerationPlan<bool> $plan,
    int $total,
    int $budget,
): int
public function choices(
    string $name,
    ?ProductionPattern $pattern,
): list<array{Production, array{int, int}}>

Keeps the cheapest empty and emitting alternatives as proposals, never as constrained minimum proofs.

Parameters

$namestring
$pattern?ProductionPattern

Returns

list<array{Production, array{int, int}}>
Test cases 1
Called from 1
Calls 4

Private surface 4§

Implementation details, listed for orientation only.

private array<string, list<array{Production, array{int, int}}>> $choices = []
private CompletionCosts $costs
private PatternProductions $productions
private CompletionMemo $memo

Test cases 28§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 23

Relations§

Instantiated in 1
Method calls 1
Type declarations 1