Skip to content

Commit fc3a450

Browse files
Fix lambda example
1 parent 2c25972 commit fc3a450

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/egglog/examples/lambda.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ def assert_simplifies(left: BaseExpr, right: BaseExpr) -> None:
177177
Simplify and print
178178
"""
179179
with egraph:
180-
res = egraph.simplify(left, 30)
181-
print(f"{left}{res}")
182-
assert expr_parts(res) == expr_parts(right), f"{res} != {right}"
183-
180+
egraph.register(left)
181+
egraph.run(30)
182+
res = egraph.extract(left)
183+
print(f"{left}{res}")
184+
egraph.check(eq(right).to(right))
184185

185186
assert_simplifies((Term.val(Val(1))).eval(), Val(1))
186187
assert_simplifies((Term.val(Val(1)) + Term.val(Val(2))).eval(), Val(3))

0 commit comments

Comments
 (0)