-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
To reproduce:
- uv venv
- uv pip install egglog
- uv run python main.py
where main.py:
from __future__ import annotations
from egglog import *
class Num(Expr):
def __init__(self, value: i64Like) -> None: ...
@classmethod
def var(cls, name: StringLike) -> Num: ...
def __add__(self, other: Num) -> Num: ...
def __mul__(self, other: Num) -> Num: ...
egraph = EGraph()
expr1 = egraph.let("expr1", Num(2) * (Num.var("x") + Num(3)))
expr2 = egraph.let("expr2", Num(6) + Num(2) * Num.var("x"))
@egraph.register
def _num_rule(a: Num, b: Num, c: Num, i: i64, j: i64):
yield rewrite(a + b).to(b + a)
yield rewrite(a * (b + c)).to((a * b) + (a * c))
yield rewrite(Num(i) + Num(j)).to(Num(i + j))
yield rewrite(Num(i) * Num(j)).to(Num(i * j))
egraph.saturate()
egraph.check(expr1 == expr2)
egraph.extract(expr1)
What get:
Traceback (most recent call last):
File "/home/hzhangxyz/Cloud/Desktop/ddss/main.py", line 2, in <module>
from egglog import *
File "/home/hzhangxyz/Cloud/Desktop/ddss/.venv/lib/python3.13/site-packages/egglog/__init__.py", line 7, in <module>
from .builtins import * # noqa: UP029
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hzhangxyz/Cloud/Desktop/ddss/.venv/lib/python3.13/site-packages/egglog/builtins.py", line 16, in <module>
import cloudpickle
ModuleNotFoundError: No module named 'cloudpickle'
Why?
cloudpickle is currently placed in optional deps, but it seems not "optional".
Metadata
Metadata
Assignees
Labels
No labels