Flatten

foresight.eqsat.rewriting.Searcher.Flatten
final case class Flatten[NodeT, MatchT, EGraphT <: EGraphLike[NodeT, EGraphT] & EGraph[NodeT]](searcher: Searcher[NodeT, Seq[Iterable[MatchT]], EGraphT]) extends Searcher[NodeT, Seq[MatchT], EGraphT]

Flatten a searcher that yields nested sequences, e.g., from a flatMap-like phase.

Type parameters

EGraphT

E-graph type.

MatchT

Match element type.

NodeT

Node payload type.

Value parameters

searcher

Inner searcher producing Seq[Iterable[MatchT]].

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Searcher[NodeT, Seq[MatchT], EGraphT]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def search(egraph: EGraphT, parallelize: ParallelMap): Seq[MatchT]

Execute this search over the given e-graph.

Execute this search over the given e-graph.

For structured parallel work, use parallelize.child("phase-name").

Value parameters

egraph

E-graph to search.

parallelize

Parallel mapping/labeling strategy.

Attributes

Returns

Search output (often a sequence of matches).

Definition Classes

Inherited methods

final def chain[IntermediateT, OutputT2](phase: SearcherPhase[NodeT, Seq[MatchT], IntermediateT, OutputT2, EGraphT]): Searcher[NodeT, OutputT2, EGraphT]

Append a SearcherPhase that consumes this searcher's output and produces a new output.

Append a SearcherPhase that consumes this searcher's output and produces a new output.

This is the primary way to build multi-stage searches while keeping each stage testable.

Type parameters

IntermediateT

The input type that phase expects from this searcher (must match this OutputT).

OutputT2

The new output type after applying phase.

Value parameters

phase

Phase to run after this searcher.

Attributes

Returns

A composed searcher that runs this then phase.

Inherited from:
Searcher
final def product[OutputT2](other: Searcher[NodeT, OutputT2, EGraphT]): Searcher[NodeT, (Seq[MatchT], OutputT2), EGraphT]

Run this searcher and another searcher independently over the same e-graph and pair the results.

Run this searcher and another searcher independently over the same e-graph and pair the results.

Useful when two match sets are later combined (e.g., via cartesian product or keyed joins).

Type parameters

OutputT2

The other searcher's output type.

Value parameters

other

The other searcher to execute alongside this one.

Attributes

Returns

A searcher that returns (thisOutput, otherOutput).

Inherited from:
Searcher
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def requireMetadata: Searcher[NodeT, Seq[MatchT], EGraphWithMetadata[NodeT, EGraphT]]

Adapt this searcher so it accepts an foresight.eqsat.metadata.EGraphWithMetadata without changing the search logic.

Adapt this searcher so it accepts an foresight.eqsat.metadata.EGraphWithMetadata without changing the search logic.

The adapter simply unwraps .egraph and delegates to this searcher.

Attributes

Returns

A searcher over foresight.eqsat.metadata.EGraphWithMetadata that forwards to this searcher.

Inherited from:
Searcher
final def requireRoot: Searcher[NodeT, Seq[MatchT], EGraphWithRoot[NodeT, EGraphT]]

Adapt this searcher so it accepts an foresight.eqsat.saturation.EGraphWithRoot without changing the search logic.

Adapt this searcher so it accepts an foresight.eqsat.saturation.EGraphWithRoot without changing the search logic.

The adapter simply unwraps .egraph and delegates to this searcher.

Attributes

Returns

A searcher over foresight.eqsat.saturation.EGraphWithRoot that forwards to this searcher.

Inherited from:
Searcher