LanguageOp

foresight.eqsat.lang.LanguageOp
See theLanguageOp companion object
final case class LanguageOp[E]

Canonical node representation for a surface language E.

LanguageOp[E] is the internal node type used by e-graphs. It is not constructed directly; instead, use the encoders and tree-conversion methods provided by Language. This ensures that nodes are created consistently and can be compared, ordered, and rewritten reliably.

Key points:

  • Each surface language E has an associated LanguageOp[E] type.
  • You typically encounter it inside MixedTree or when working with an EGraph that has been parameterized by your language.
  • You do not construct or pattern match on it yourself. Go through the Language[E] instance instead.

Example:

sealed trait ArithExpr derives Language
final case class Add(x: ArithExpr, y: ArithExpr) extends ArithExpr

val Lang = summon[Language[ArithExpr]]
val expr: ArithExpr = Add(x, y)

// Core representation: tree of LanguageOp[ArithExpr] + atoms
val tree: Lang.MTree[Pattern.Var] = Lang.toTree(expr)

Type parameters

E

the surface language this node belongs to.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product