classCompletionMemo
final class CompletionMemo
Reuses exact minima, affordable witnesses and exhausted-budget proofs within one immutable plan.
Methods§
public function recall(
GenerationPlan<bool> $plan,
string $key,
int $budget,
bool $minimum,
): ?intNever treats a nonminimal witness as proof that a smaller budget is impossible.
Parameters
$plan | GenerationPlan<bool> | |
$key | string | |
$budget | int | |
$minimum | bool |
Returns
?intTest cases 4
CompletionWitnessTest::testRememberCachesOnlyTheSuccessfulSuffixAndPreservesExactMinimumIndependencecallsCompletionMemoTest::testActivateDropsProofsForAnotherPlanEvenWhenItsPendingFormMatchescovers and callsCompletionMemoTest::testRecallDoesNotConfuseAnAffordableWitnessWithAnExactMinimumcovers and callsCompletionMemoTest::testRememberExhaustionDoesNotRuleOutLargerBudgetsOrAnotherPlancovers and calls
Called from 3
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::complete() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:49
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::complete() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:67
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:98
Calls 1
- method-call CompletionMemo::activate() line 37
public function remember(
GenerationPlan<bool> $plan,
string $key,
int $budget,
int $result,
bool $minimum,
): voidA finite result is a constructive witness; exhaustion proves only the searched budget range.
Parameters
$plan | GenerationPlan<bool> | |
$key | string | |
$budget | int | |
$result | int | |
$minimum | bool |
Test cases 3
CompletionMemoTest::testActivateDropsProofsForAnotherPlanEvenWhenItsPendingFormMatchescovers and callsCompletionMemoTest::testRecallDoesNotConfuseAnAffordableWitnessWithAnExactMinimumcovers and callsCompletionMemoTest::testRememberExhaustionDoesNotRuleOutLargerBudgetsOrAnotherPlancovers and calls
Called from 3
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::remember() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:87
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::complete() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:73
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::witness() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:126
Calls 3
- method-call CompletionMemo::activate() line 53
- function-call
maxline 55 - function-call
minline 57
public function activate(GenerationPlan<bool> $plan): voidPrevents queries or witness writes for another immutable plan from sharing state.
Parameters
$plan | GenerationPlan<bool> |
Test cases 3
Private surface 4§
Implementation details, listed for orientation only.
private GenerationPlan<bool>|null $plan = nullprivate array<string, int> $minimums = []private array<string, int> $witnesses = []private array<string, int> $failures = []Test cases 27§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
CompletionMemoTest::testActivateDropsProofsForAnotherPlanEvenWhenItsPendingFormMatchescovers and callsCompletionMemoTest::testRecallDoesNotConfuseAnAffordableWitnessWithAnExactMinimumcovers and callsCompletionMemoTest::testRememberExhaustionDoesNotRuleOutLargerBudgetsOrAnotherPlancovers and calls
Other tests reaching this symbol 24
BytePlanCompilerTestcallsPlanBuilderTestcallsCompletionWitnessTest::testChoicesCachesBothOutputPossibilitiesUnderEachDistinctPatterncallsCompletionWitnessTest::testCompleteBoundsTheOptionalProbeWithoutClaimingImpossibilitycallsCompletionWitnessTest::testCompleteWalksOccurrencePatternsAndPreservesPendingOutputcallsCompletionWitnessTest::testCompleteYieldsToTheSolverWhenAGreedyPathNeedsAnotherChoicecallsCompletionWitnessTest::testRememberCachesOnlyTheSuccessfulSuffixAndPreservesExactMinimumIndependencecallsCompletionReductionTestcallsConstrainedCompletionTestcallsConstraintDependenciesTestcallsDerivationTestcallsDerivationTraceTestcallsTokenGeneratorTestcallsLexemeSequenceTestcallsCandidateResolverTestcallsSqlGeneratorTestcallsTerminalSequenceTestcallsGenerationContextTestcallsMySqlProviderTestcallsGenerationContextTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 1
Method calls 6
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::complete() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:49
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::remember() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:87
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::complete() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:67
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::complete() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:73
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:98
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::witness() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:126