Versions in this module Expand all Collapse all v0 v0.1.0 Dec 4, 2026 Changes in this version + var ErrAdditiveExtractionWorkLimit = errors.New("egraphcore: additive extraction work limit exceeded") + var ErrAdditiveNegativeCycle = errors.New("egraphcore: reachable negative-cost cycle") + var ErrAdditiveUnresolved = errors.New("egraphcore: unresolved additive extraction root") + var ErrChoiceFingerprintLimit = errors.New("egraphcore: choice fingerprint size limit exceeded") + var ErrChoiceFingerprintWorkBudget = errors.New("egraphcore: choice fingerprint work budget exceeded") + var ErrConflictingFunctionResults = errors.New("egraphcore: conflicting function results") + var ErrCongruencePassLimit = errors.New("egraphcore: congruence pass limit exceeded") + var ErrCostRelaxationLimit = errors.New("egraphcore: cost relaxation limit exceeded") + var ErrIncompleteSaturationPass = errors.New("egraphcore: incomplete pass without exhausted work budget") + var ErrInvalidAdditiveExtraction = errors.New("egraphcore: invalid additive extraction") + var ErrInvalidAnalysisPropagation = errors.New("egraphcore: invalid analysis propagation") + var ErrInvalidChoiceGraph = errors.New("egraphcore: invalid selected choice graph") + var ErrInvalidCongruenceDriver = errors.New("egraphcore: invalid congruence driver") + var ErrInvalidCongruencePass = errors.New("egraphcore: invalid congruence pass") + var ErrInvalidCostRelaxation = errors.New("egraphcore: invalid cost relaxation") + var ErrInvalidFactAction = errors.New("egraphcore: invalid fact action") + var ErrInvalidFunctionMerge = errors.New("egraphcore: invalid function merge") + var ErrInvalidJoin = errors.New("egraphcore: invalid relation join") + var ErrInvalidMemoLookup = errors.New("egraphcore: invalid memo lookup") + var ErrInvalidPattern = errors.New("egraphcore: invalid pattern matcher input") + var ErrInvalidRewriteApplication = errors.New("egraphcore: invalid rewrite application") + var ErrInvalidSaturationInput = errors.New("egraphcore: invalid saturation input") + var ErrInvalidSchedule = errors.New("egraphcore: invalid schedule") + var ErrInvalidTopKExtraction = errors.New("egraphcore: invalid top-k extraction") + var ErrMatchWorkLimit = errors.New("egraphcore: pattern match work limit exceeded") + var ErrMemoryClosed = errors.New("egraphcore: memory scope is closed") + var ErrMemorySize = errors.New("egraphcore: invalid memory size") + var ErrMissingCanonicalizer = errors.New("egraphcore: missing class canonicalizer") + var ErrRelationReset = errors.New("egraphcore: relation cursor invalidated; recompute required") + var ErrRewriteNodeLimit = errors.New("egraphcore: rewrite node limit exceeded") + var ErrRewriteWorkBudget = errors.New("egraphcore: rewrite work budget exceeded") + var ErrSaturationCounterOverflow = errors.New("egraphcore: saturation counter overflow") + var ErrScheduleCounterOverflow = errors.New("egraphcore: schedule counter overflow") + var ErrTopKExpansionLimit = errors.New("egraphcore: top-k expansion limit exceeded") + var ErrTopKWorkBudget = errors.New("egraphcore: top-k work budget exceeded") + func ASTSizeCost(childCosts []float64) float64 + func CanonicalChildIDs[ID ~uint32](parent []ID, children []ID) []ID + func ChildCosts[ID comparable](children []ID, costs map[ID]float64) ([]float64, bool) + func CountInternalChildren[ID ~uint32](children []ID, component map[ID]bool) int + func CyclicComponents[ID ~uint32](adj map[ID][]ID, reachable map[ID]bool) [][]ID + func EvaluateNodeCost[Node any](model CostModel[Node], node Node, childCosts []float64, ...) float64 + func ExtractBestAdditiveFromRoots[ID ~uint32, Node any](roots []ID, nodes func(ID) []Node, canonical func(ID) ID, ...) (map[ID]AdditiveBestCostNode[Node], int, error) + func ExtractBestAdditive[ID ~uint32, Node any](root ID, nodes func(ID) []Node, canonical func(ID) ID, ...) (map[ID]AdditiveBestCostNode[Node], int, error) + func FindMemoCandidateIterWithBudget[ID ~uint32, Node any](visitCandidates func(func(ID) bool), want Node, find func(ID) ID, ...) (ID, bool, error) + func FindMemoCandidateIter[ID ~uint32, Node any](visitCandidates func(func(ID) bool), want Node, find func(ID) ID, ...) (ID, bool, error) + func FindMemoCandidate[ID ~uint32, Node any](candidates []ID, want Node, find func(ID) ID, classNodes func(ID) []Node, ...) (ID, bool, error) + func Find[ID ~uint32](parent []ID, id ID) ID + func LinkRoots[ID ~uint32](parent []ID, root1, root2, newRoot ID) (ID, bool) + func MatchEClassWithMatcher[ID comparable, Node, P any](pattern P, classID ID, current map[string]ID, budget *WorkBudget, ...) ([]map[string]ID, error) + func MatchEClass[ID comparable, Node any](pattern *Pattern, classID ID, current map[string]ID, budget *WorkBudget, ...) ([]map[string]ID, error) + func MaterializeChoice[ID ~uint32, Node, Value any](root ID, choice map[ID]int, alternatives func(ID) []Node, ...) (Value, error) + func MutateDiscreteChoice(genome []int, genes []DiscreteChoiceGene, mutationCount int, rng IntnSource) ([]int, error) + func PlanJoinOrder(boundVariables []string, conditions []JoinOrderCondition, budget *WorkBudget) ([]int, error) + func PropagateAnalysis[ID ~uint32, Node any](seeds []ID, ops AnalysisPropagation[ID, Node]) error + func PruneEmptyAlternatives[ID ~uint32, Node any](alternatives map[ID][]Node, children func(Node) []ID) (map[ID][]Node, error) + func RelaxBestCostsWorklistWithBudget[ID ~uint32, Node, Rank any](classes []ID, nodes func(ID) []Node, canonicalClass func(ID) ID, ...) (output map[ID]RankedBestCostNode[Node, Rank], visits int, err error) + func RelaxBestCostsWorklist[ID ~uint32, Node, Rank any](classes []ID, nodes func(ID) []Node, canonicalClass func(ID) ID, ...) (map[ID]RankedBestCostNode[Node, Rank], int, error) + func RelaxBestCosts[ID ~uint32, Node any](classes []ID, nodes func(ID) []Node, canonicalClass func(ID) ID, ...) (map[ID]BestCostNode[Node], int, error) + func RepairChoiceCycles[ID ~uint32, Node any](root ID, choice map[ID]int, alternatives func(ID) []Node, ...) (map[ID]int, error) + func SelectedChoiceGraph[ID ~uint32, Node any](root ID, choice map[ID]int, alternatives func(ID) []Node, ...) (map[ID][]ID, map[ID]bool, error) + func SelectedChoiceMatches[ID ~uint32, Node any, Value comparable](root ID, choice map[ID]int, alternatives func(ID) []Node, ...) bool + func StructuralFingerprint(op, sort string, data any, children []string) string + func ValidateMonotoneCost(cost float64, childCosts []float64) error + func ValidateSchedule[R any](schedule *Schedule[R], validateRule ScheduleRuleValidator[R]) error + func ValueFingerprint(value any) (string, bool) + func WouldCreateCycleWithBudget[ID comparable, Node any](owner ID, childIDs []ID, canonicalize func(ID) ID, ...) (cycle bool, err error) + func WouldCreateCycleWithVisit[ID comparable, Node any](owner ID, childIDs []ID, canonicalize func(ID) ID, ...) (bool, error) + func WouldCreateCycle[ID comparable, Node any](owner ID, childIDs []ID, canonicalize func(ID) ID, ...) bool + type AdditiveBestCostNode struct + Cost float64 + Node Node + type AnalysisPropagation struct + Canonical func(ID) ID + Data func(ID) (any, bool) + Exists func(ID) bool + Make func(Node) (any, bool, error) + Merge func(any, any) (any, bool, error) + Nodes func(ID) []Node + SetData func(ID, any, bool) + Spend func() error + VisitParents func(ID, func(ID)) + type Atom struct + Relation *Relation[ID] + Terms []Term[ID] + type BestCostNode struct + Cost float64 + Node Node + type Binding map[string]Value[ID] + func JoinBindings[ID ~uint32](left, right []Binding[ID], rightKeys []string, canonicalize func(ID) ID, ...) (results []Binding[ID], complete bool, err error) + func JoinDeltas[ID ~uint32](atoms []Atom[ID], deltas []DeltaAtom[ID], canonicalize func(ID) ID, ...) (results []Binding[ID], complete bool, err error) + func Join[ID ~uint32](atoms []Atom[ID], canonicalize func(ID) ID, budget *WorkBudget) (results []Binding[ID], complete bool, err error) + type CandidateLattice struct + func NewCandidateLattice[T any](buckets []CandidateLatticeBucket[T], aggregate func([]float64) float64, ...) (*CandidateLattice[T], error) + func (l *CandidateLattice[T]) Accept(set *CandidateLatticeSet[T]) error + func (l *CandidateLattice[T]) Attempts() int + func (l *CandidateLattice[T]) LastRejection() string + func (l *CandidateLattice[T]) LimitReached() bool + func (l *CandidateLattice[T]) Next() (*CandidateLatticeSet[T], bool, error) + func (l *CandidateLattice[T]) Reject(set *CandidateLatticeSet[T], reason string) error + func (l *CandidateLattice[T]) SearchExpired() bool + func (l *CandidateLattice[T]) SetTimeouts(searchTimeout, candidateTimeout time.Duration) error + func (l *CandidateLattice[T]) StopReason() string + func (l *CandidateLattice[T]) TimedOut(set *CandidateLatticeSet[T]) bool + func (l *CandidateLattice[T]) ValidateNext(validate func(*CandidateLatticeSet[T]) error) (*CandidateLatticeSet[T], bool, error) + type CandidateLatticeBucket struct + Finalists []CandidateLatticeFinalist[T] + LoadFinalist func(rank int) (finalist CandidateLatticeFinalist[T], ok bool, err error) + type CandidateLatticeFinalist struct + Score float64 + Value T + type CandidateLatticeSet struct + Deadline time.Time + Finalists []CandidateLatticeFinalist[T] + Indices []int + Score float64 + type ChoiceFingerprint [32]byte + type ChoiceFingerprintBuild func(ID, Node, []ChoiceFingerprint) ChoiceFingerprint + type ChoiceFingerprinter struct + func NewChoiceFingerprinter[ID ~uint32, Node any]() *ChoiceFingerprinter[ID, Node] + func (f *ChoiceFingerprinter[ID, Node]) Fingerprint(root ID, choice map[ID]int, alternatives func(ID) []Node, ...) (ChoiceFingerprint, error) + type ChoiceMaterializer struct + func NewChoiceMaterializer[ID ~uint32, Node, Value any](classes []ID) (*ChoiceMaterializer[ID, Node, Value], error) + func (m *ChoiceMaterializer[ID, Node, Value]) Materialize(root ID, choice map[ID]int, alternatives func(ID) []Node, ...) (result Value, err error) + func (m *ChoiceMaterializer[ID, Node, Value]) ReachableClasses(root ID, choice map[ID]int, alternatives func(ID) []Node, ...) ([]ID, error) + type ChoiceSpace struct + func NewChoiceSpaceFrom[ID ~uint32, Node any](root ID, canonicalClass func(ID) (ID, error), ...) (*ChoiceSpace[ID, Node], error) + func NewChoiceSpace[ID ~uint32, Node any](root ID, alternatives map[ID][]Node, children func(Node) []ID, ...) (*ChoiceSpace[ID, Node], error) + func (s *ChoiceSpace[ID, Node]) AlternativeCount(class ID) int + func (s *ChoiceSpace[ID, Node]) Alternatives(class ID) []Node + func (s *ChoiceSpace[ID, Node]) Classes() []ID + func (s *ChoiceSpace[ID, Node]) Root() ID + type Column struct + Kind ValueKind + Sort string + type CongruencePlan struct + ByOwner map[ID][]Node + Merges []OwnerPair[ID] + Nodes []OwnedNode[ID, Node] + func ApplyCongruencePass[ID ~uint32, Node any, Key comparable](graph Graph[ID, Node], owned []OwnedNode[ID, Node], key func(Node) Key, ...) (CongruencePlan[ID, Node], int, error) + func PlanCongruencePass[ID comparable, Node any, Key comparable](owned []OwnedNode[ID, Node], key func(Node) Key, equal func(Node, Node) bool, ...) (CongruencePlan[ID, Node], error) + type CongruenceReport struct + Merges int + Passes int + Scopes int + func DriveCongruenceWithBudget[ID ~uint32, Node any, Key comparable, Scope any](graph Graph[ID, Node], maxPasses int, ...) (CongruenceReport, error) + func DriveCongruence[ID ~uint32, Node any, Key comparable, Scope any](graph Graph[ID, Node], maxPasses int, ...) (CongruenceReport, error) + type CostEvaluation func(node Node, childCosts []float64, allChildrenKnown bool) (cost float64, eligible bool, err error) + type CostModel interface + NodeCost func(Node, []float64) float64 + type CostVisit func(node Node) error + type CycleVisit func(id ID, work int) error + type DeltaAtom struct + Cursor RelationCursor + Index int + type DiscreteChoiceGene struct + Alleles []int + Index int + type FactAction struct + Kind FactActionKind + Relation string + Terms []Term[ID] + type FactActionKind uint8 + const FactDelete + const FactInsert + const FactSubsume + type FactStore struct + func NewFactStore[ID ~uint32]() *FactStore[ID] + func (s *FactStore[ID]) Add(name string, values []Value[ID], canonicalize func(ID) ID) (bool, error) + func (s *FactStore[ID]) ApplyActions(actions []ResolvedFactAction[ID], canonicalize func(ID) ID, budget *WorkBudget) (int, error) + func (s *FactStore[ID]) ApplyActionsDetailed(actions []ResolvedFactAction[ID], canonicalize func(ID) ID, budget *WorkBudget) ([]bool, int, error) + func (s *FactStore[ID]) CanonicalCopyWithBudget(canonicalize func(ID) ID, budget *WorkBudget) (*FactStore[ID], error) + func (s *FactStore[ID]) Clone() *FactStore[ID] + func (s *FactStore[ID]) CloneWithBudget(budget *WorkBudget) (*FactStore[ID], error) + func (s *FactStore[ID]) Delete(name string, values []Value[ID], canonicalize func(ID) ID) (bool, error) + func (s *FactStore[ID]) Get(name string) *Relation[ID] + func (s *FactStore[ID]) MarkSubsumed(name string, values []Value[ID], canonicalize func(ID) ID) (bool, error) + func (s *FactStore[ID]) Recanonicalize(canonicalize func(ID) ID) error + func (s *FactStore[ID]) RecanonicalizeWithBudget(canonicalize func(ID) ID, budget *WorkBudget) error + func (s *FactStore[ID]) Register(schema Schema) (*Relation[ID], error) + func (s *FactStore[ID]) ReplaceFrom(other *FactStore[ID], budget *WorkBudget) error + func (s *FactStore[ID]) TupleCount() int + type Filter struct + Column int + Value Value[ID] + type FunctionMergeCallbacks struct + Canonicalize func(ID) ID + Custom func(old, incoming Value[ID]) (Value[ID], error) + Union func(ID, ID) (ID, error) + type FunctionMergePolicy uint8 + const FunctionMergeAssertEqual + const FunctionMergeConstant + const FunctionMergeCustom + const FunctionMergeKeepOld + const FunctionMergeMaxInt64 + const FunctionMergeMinInt64 + const FunctionMergeUnionClass + const FunctionMergeUseNew + type Graph interface + AddChecked func(Node) (ID, error) + Find func(ID) ID + RebuildChecked func() error + UnionChecked func(ID, ID) (ID, bool, error) + type IntnSource interface + Intn func(n int) int + type JoinOrderCondition struct + Cardinality int + Variables []string + type Match struct + ClassID ID + Subst map[string]ID + func SearchWithMatcher[ID comparable, Node, P any](pattern P, roots []ID, budget *WorkBudget, maxMatches int, ...) ([]Match[ID], bool, error) + func Search[ID comparable, Node any](pattern *Pattern, roots []ID, budget *WorkBudget, maxMatches int, ...) ([]Match[ID], bool, error) + type MatcherCallbacks struct + Candidates func(ID, P) []Node + ClassEligible func(ID, P) bool + Find func(ID) ID + IsVariable func(P) (name string, variable bool) + NodeChildren func(Node) []ID + NodeEligible func(Node, P) bool + PatternChildren func(P) []P + ValidPattern func(P) bool + type MeasuredCandidate struct + ID string + Score float64 + Value T + type MeasuredSearch struct + func NewMeasuredSearch[T any](config MeasuredSearchConfig) (*MeasuredSearch[T], error) + func (s *MeasuredSearch[T]) Best() (MeasuredCandidate[T], bool) + func (s *MeasuredSearch[T]) CloseGeneration(remaining int) + func (s *MeasuredSearch[T]) Generation() int + func (s *MeasuredSearch[T]) MutationLimit(base int) int + func (s *MeasuredSearch[T]) ParentFor(position int) (MeasuredCandidate[T], bool) + func (s *MeasuredSearch[T]) Parents() bool + func (s *MeasuredSearch[T]) Ranking() []MeasuredCandidate[T] + func (s *MeasuredSearch[T]) Record(candidate MeasuredCandidate[T]) (bool, error) + func (s *MeasuredSearch[T]) Resample() bool + type MeasuredSearchConfig struct + Descending bool + GenerationSize int + KeepBest int + RestartStagnation int + type Memory interface + Release func(bytes int64) + Reserve func(bytes int64) error + type MemoryScope struct + func NewMemoryScope(memory Memory) (*MemoryScope, error) + func (s *MemoryScope) Bytes() int64 + func (s *MemoryScope) Close() + func (s *MemoryScope) Err() error + func (s *MemoryScope) Reserve(bytes int64) error + type OrderedRow struct + Key string + Order uint64 + Payload Row + Subsumed bool + Values []Value[ID] + type OrderedTable struct + func NewOrderedTableWithClone[ID ~uint32, Row any](columnCount int, clone func(Row) Row) *OrderedTable[ID, Row] + func NewOrderedTable[ID ~uint32, Row any](columnCount int) *OrderedTable[ID, Row] + func (t *OrderedTable[ID, Row]) Clone() *OrderedTable[ID, Row] + func (t *OrderedTable[ID, Row]) Contains(column int, value Value[ID], key string) bool + func (t *OrderedTable[ID, Row]) Counters() (order, fresh uint64) + func (t *OrderedTable[ID, Row]) Delete(key string) bool + func (t *OrderedTable[ID, Row]) Get(key string) (OrderedRow[ID, Row], bool) + func (t *OrderedTable[ID, Row]) Len() int + func (t *OrderedTable[ID, Row]) MarkSubsumed(key string) bool + func (t *OrderedTable[ID, Row]) Put(key string, values []Value[ID], payload Row) (inserted bool, ok bool) + func (t *OrderedTable[ID, Row]) PutAt(key string, values []Value[ID], payload Row, order uint64, subsumed bool) bool + func (t *OrderedTable[ID, Row]) Range(column int, value Value[ID], visit func(string) bool) bool + func (t *OrderedTable[ID, Row]) ReplaceFrom(other *OrderedTable[ID, Row]) bool + func (t *OrderedTable[ID, Row]) Rows() []OrderedRow[ID, Row] + func (t *OrderedTable[ID, Row]) SetCounters(order, fresh uint64) + type OwnedNode struct + Node Node + Owner ID + type OwnerPair struct + Left ID + Right ID + type Pattern struct + Children []*Pattern + Op string + Variable bool + func ParsePattern(source string) (*Pattern, error) + type RankedBestCostLookup func(ID) (RankedBestCostNode[Node, Rank], bool) + type RankedBestCostNode struct + Cost float64 + Node Node + Rank Rank + type RankedCostAcceptance func(class ID, candidate RankedBestCostNode[Node, Rank], ...) (bool, error) + type RankedCostEvaluation func(node Node, childStates []RankedBestCostNode[Node, Rank], allChildrenKnown bool) (cost float64, rank Rank, eligible bool, err error) + type Relation struct + func NewRelation[ID ~uint32](schema Schema) (*Relation[ID], error) + func (r *Relation[ID]) Add(values []Value[ID], canonicalize func(ID) ID) (bool, error) + func (r *Relation[ID]) AddedSince(cursor RelationCursor) ([][]Value[ID], error) + func (r *Relation[ID]) AddedSinceWithBudget(cursor RelationCursor, budget *WorkBudget) (rows [][]Value[ID], complete bool, err error) + func (r *Relation[ID]) Clone() *Relation[ID] + func (r *Relation[ID]) Compact(cursor RelationCursor) error + func (r *Relation[ID]) Delete(values []Value[ID], canonicalize func(ID) ID) (bool, error) + func (r *Relation[ID]) Len() int + func (r *Relation[ID]) MarkSubsumed(values []Value[ID], canonicalize func(ID) ID) (bool, error) + func (r *Relation[ID]) Query(filters []Filter[ID], canonicalize func(ID) ID, budget *WorkBudget) (rows [][]Value[ID], complete bool, err error) + func (r *Relation[ID]) Recanonicalize(canonicalize func(ID) ID) error + func (r *Relation[ID]) Rows() [][]Value[ID] + func (r *Relation[ID]) Schema() Schema + func (r *Relation[ID]) SchemaWithBudget(budget *WorkBudget) (Schema, error) + func (r *Relation[ID]) Snapshot() RelationCursor + type RelationCursor struct + type ResolvedFactAction struct + Kind FactActionKind + Relation string + Values []Value[ID] + func ResolveFactActions[ID ~uint32](store *FactStore[ID], actions []FactAction[ID], binding Binding[ID], ...) ([]ResolvedFactAction[ID], error) + type RewriteApplicationReport struct + Applied int + Merges int + Rebuilt bool + func ApplyMatches[ID ~uint32, Node, Match any](graph Graph[ID, Node], matches []Match, class func(Match) ID, ...) (RewriteApplicationReport, error) + type RootPairStatus uint8 + const RootPairDistinct + const RootPairInvalidID + const RootPairMissingClass + const RootPairSame + type RuleMatch struct + Binding Binding[ID] + ClassID ID + func JoinMatchesDeltas[ID ~uint32](anchors []Match[ID], structuralConditions [][]Match[ID], atoms []Atom[ID], ...) ([]RuleMatch[ID], error) + func JoinMatchesWithBindings[ID ~uint32](anchors []Match[ID], structuralConditions [][]Match[ID], ...) (output []RuleMatch[ID], err error) + func JoinMatches[ID ~uint32](anchors []Match[ID], structuralConditions [][]Match[ID], ...) ([]RuleMatch[ID], error) + type SaturationLimits struct + MaxIterations int + MaxNodes int + type SaturationPass func(budget *WorkBudget) (changes, nodes int, complete bool, err error) + type SaturationResult struct + Changes int + Iterations int + Nodes int + StopReason SaturationStopReason + Work int + func RunFixedPoint(limits SaturationLimits, budget *WorkBudget, initialNodes int, ...) (SaturationResult, error) + type SaturationStopReason uint8 + const SaturationFixedPoint + const SaturationIterationLimit + const SaturationNodeLimit + const SaturationRuleMatchLimit + const SaturationScheduleDone + const SaturationTimeLimit + const SaturationTupleLimit + const SaturationWorkLimit + func (r SaturationStopReason) String() string + type Schedule struct + func RepeatNamed[R any](name string, count int, child *Schedule[R]) *Schedule[R] + func Repeat[R any](count int, child *Schedule[R]) *Schedule[R] + func Run[R any](name string, rules ...R) *Schedule[R] + func SaturateNamed[R any](name string, child *Schedule[R]) *Schedule[R] + func Saturate[R any](child *Schedule[R]) *Schedule[R] + func SequenceNamed[R any](name string, children ...*Schedule[R]) *Schedule[R] + func Sequence[R any](children ...*Schedule[R]) *Schedule[R] + type ScheduleResult struct + Changes int + Halted bool + Reports []ScheduleRunReport + RunLimitReached bool + Runs int + func ExecuteSchedule[R any](schedule *Schedule[R], maxRuns int, validateRule ScheduleRuleValidator[R], ...) (ScheduleResult, error) + type ScheduleRuleValidator func(R) error + type ScheduleRun func(name string, rules []R) (changes int, halt bool, err error) + type ScheduleRunReport struct + Changes int + Duration time.Duration + Path string + type Schema struct + Columns []Column + Name string + type Store struct + func NewStore[ID ~uint32, Class any]() *Store[ID, Class] + func (s *Store[ID, Class]) AddMemoCandidate(key string, id ID) + func (s *Store[ID, Class]) AddMemoCandidateIf(key string, id ID, same func(ID, ID) bool) bool + func (s *Store[ID, Class]) AddMemoCandidateIfWithBudget(key string, id ID, same func(ID, ID) bool, budget *WorkBudget) (bool, error) + func (s *Store[ID, Class]) CanonicalChildren(children []ID) []ID + func (s *Store[ID, Class]) Class(id ID) Class + func (s *Store[ID, Class]) ClassCount() int + func (s *Store[ID, Class]) Clone(cloneClass func(Class) Class) *Store[ID, Class] + func (s *Store[ID, Class]) CloneWithBudget(cloneClass func(Class, *WorkBudget) (Class, error), budget *WorkBudget) (*Store[ID, Class], error) + func (s *Store[ID, Class]) Find(id ID) ID + func (s *Store[ID, Class]) FindWithoutCompression(id ID, maxVisits int) (root ID, visits int, ok bool) + func (s *Store[ID, Class]) Initialized() bool + func (s *Store[ID, Class]) Insert(key string, newClass func(ID) Class) (ID, bool) + func (s *Store[ID, Class]) InsertWithBudget(key string, newClass func(ID) (Class, error), budget *WorkBudget) (ID, error) + func (s *Store[ID, Class]) Len() int + func (s *Store[ID, Class]) LinkRoots(root1, root2, winner ID) (ID, bool) + func (s *Store[ID, Class]) LinkRootsBySize(root1, root2 ID) (ID, bool) + func (s *Store[ID, Class]) LookupClass(id ID) (Class, bool) + func (s *Store[ID, Class]) MergeRoots(root1, root2, winner ID, merge func(Class, Class) Class) (ID, bool) + func (s *Store[ID, Class]) MergeRootsBySize(root1, root2 ID, merge func(Class, Class) Class) (ID, bool) + func (s *Store[ID, Class]) Parent(id ID) (ID, bool) + func (s *Store[ID, Class]) RangeClasses(visit func(ID, Class) bool) + func (s *Store[ID, Class]) ResetMemo() + func (s *Store[ID, Class]) ResolveRoots(id1, id2 ID) (ID, ID, RootPairStatus) + func (s *Store[ID, Class]) VisitMemoCandidates(key string, visit func(ID) bool) + type Term struct + Kind TermKind + Name string + Value Value[ID] + func Constant[ID ~uint32](value Value[ID]) Term[ID] + func Variable[ID ~uint32](name string) Term[ID] + func Wildcard[ID ~uint32]() Term[ID] + type TermKind uint8 + const ConstantTerm + const VariableTerm + const WildcardTerm + type TopKBuild func(class ID, node Node, children []TopKCandidate[Value]) (TopKCandidate[Value], error) + type TopKCandidate struct + Cost float64 + Value Value + func ExtractTopKWithChildPreservationAndHash[ID ~uint32, Node, Value any](root ID, k int, nodes func(ID) []Node, canonical func(ID) ID, ...) ([]TopKCandidate[Value], error) + func ExtractTopKWithChildPreservation[ID ~uint32, Node, Value any](root ID, k int, nodes func(ID) []Node, canonical func(ID) ID, ...) ([]TopKCandidate[Value], error) + func ExtractTopKWithHash[ID ~uint32, Node, Value any](root ID, k int, nodes func(ID) []Node, canonical func(ID) ID, ...) ([]TopKCandidate[Value], error) + func ExtractTopK[ID ~uint32, Node, Value any](root ID, k int, nodes func(ID) []Node, canonical func(ID) ID, ...) ([]TopKCandidate[Value], error) + type TopKNodeEligible func(class ID, node Node) bool + type Value struct + Bool bool + Class ID + Float uint64 + Int64 int64 + Kind ValueKind + String string + func BigInt[ID ~uint32](v string) Value[ID] + func BigRat[ID ~uint32](v string) Value[ID] + func Bool[ID ~uint32](v bool) Value[ID] + func Class[ID ~uint32](id ID) Value[ID] + func Float64[ID ~uint32](v float64) Value[ID] + func Int64[ID ~uint32](v int64) Value[ID] + func MergeFunctionValue[ID ~uint32](policy FunctionMergePolicy, old, incoming, constant Value[ID], ...) (Value[ID], error) + func String[ID ~uint32](v string) Value[ID] + func Unit[ID ~uint32]() Value[ID] + type ValueIndex struct + func NewValueIndex[ID ~uint32](columnCount int) *ValueIndex[ID] + func (index *ValueIndex[ID]) Add(row []Value[ID], key string) bool + func (index *ValueIndex[ID]) Clone() *ValueIndex[ID] + func (index *ValueIndex[ID]) Contains(column int, value Value[ID], key string) bool + func (index *ValueIndex[ID]) Count(column int, value Value[ID]) int + func (index *ValueIndex[ID]) Range(column int, value Value[ID], visit func(string) bool) bool + func (index *ValueIndex[ID]) Remove(row []Value[ID], key string) bool + type ValueKind uint8 + const BigIntValue + const BigRatValue + const BoolValue + const ClassValue + const Float64Value + const Int64Value + const StringValue + const UnitValue + type WorkBudget struct + func NewWorkBudget(limit int) *WorkBudget + func NewWorkBudgetWithMemory(limit int, scope *MemoryScope) (*WorkBudget, error) + func (b *WorkBudget) Exhausted() bool + func (b *WorkBudget) MemoryError() error + func (b *WorkBudget) MemoryScope() *MemoryScope + func (b *WorkBudget) Remaining() int + func (b *WorkBudget) ReserveMemory(bytes int64) bool + func (b *WorkBudget) TrySpend(units int) bool + func (b *WorkBudget) Used() int