Skip to content

Commit d894355

Browse files
Fix docs
1 parent 1a84910 commit d894355

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/explanation/compared_to_rust.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ One way to run this in Python is to parse the text and run it similar to how the
5252
egg CLI works:
5353

5454
```{code-cell} python
55+
from egg_smol.bindings import *
56+
from egg_smol.bindings_py import *
57+
5558
eqsat_basic = """(datatype Math
5659
(Num i64)
5760
(Var String)
@@ -78,8 +81,6 @@ eqsat_basic = """(datatype Math
7881
(run 10)
7982
(check (= expr1 expr2))"""
8083
81-
from egg_smol.bindings import EGraph
82-
8384
egraph = EGraph()
8485
egraph.parse_and_run_program(eqsat_basic)
8586
```
@@ -90,8 +91,6 @@ However, this isn't the most friendly for Python users. Instead, we can use the
9091
low level APIs that mirror the rust APIs to build the same egraph:
9192

9293
```{code-cell} python
93-
from egg_smol.bindings_py import *
94-
9594
egraph = EGraph()
9695
egraph.declare_sort("Math")
9796
egraph.declare_constructor(Variant("Num", ["i64"]), "Math")

0 commit comments

Comments
 (0)