foresight.eqsat.lang.LanguageOp
See theLanguageOp companion object
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 associatedLanguageOp[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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article