Skip to content

Commit 7614a61

Browse files
Fix remaining tests
1 parent 4353653 commit 7614a61

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

python/egglog/declarations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ class ConstructorDecl:
517517
@dataclass(frozen=True)
518518
class UnboundVarDecl:
519519
name: str
520+
egg_name: str | None = None
520521

521522

522523
@dataclass(frozen=True)

python/egglog/egraph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ def _fn_decl(
609609
else resolve_literal(
610610
return_type,
611611
merge(
612-
RuntimeExpr.__from_values__(decls, TypedExprDecl(return_type.to_just(), UnboundVarDecl("old"))),
613-
RuntimeExpr.__from_values__(decls, TypedExprDecl(return_type.to_just(), UnboundVarDecl("new"))),
612+
RuntimeExpr.__from_values__(decls, TypedExprDecl(return_type.to_just(), UnboundVarDecl("old", "old"))),
613+
RuntimeExpr.__from_values__(decls, TypedExprDecl(return_type.to_just(), UnboundVarDecl("new", "new"))),
614614
),
615615
lambda: decls,
616616
)

python/egglog/egraph_state.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,8 @@ def _expr_to_egg(self, expr_decl: ExprDecl) -> bindings._Expr: # noqa: PLR0912,
405405
match expr_decl:
406406
case LetRefDecl(name):
407407
res = bindings.Var(span(), f"{name}")
408-
case UnboundVarDecl(name):
409-
# Prefix vars with an _ to avoid name conflicts
410-
res = bindings.Var(span(), f"_{name}")
408+
case UnboundVarDecl(name, egg_name):
409+
res = bindings.Var(span(), egg_name or f"_{name}")
411410
case LitDecl(value):
412411
l: bindings._Literal
413412
match value:

0 commit comments

Comments
 (0)