Skip to content

Commit b12408c

Browse files
Update egglog dep and visualizer
1 parent 4d3e5bd commit b12408c

10 files changed

Lines changed: 1270 additions & 1333 deletions

File tree

Cargo.lock

Lines changed: 135 additions & 226 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,27 @@ num-rational = "*"
1616
# egglog = { git = "https://github.com/egraphs-good/egglog.git", branch = "main", default-features = false }
1717
# egglog-bridge = { git = "https://github.com/egraphs-good/egglog.git", branch = "main" }
1818
# egglog-core-relations = { git = "https://github.com/egraphs-good/egglog.git", branch = "main" }
19-
egglog = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost", default-features = false }
20-
egglog-bridge = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
21-
egglog-core-relations = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
22-
egglog-experimental = { git = "https://github.com/egraphs-good/egglog-experimental", branch = "cli", default-features = false }
23-
egraph-serialize = { version = "0.2", features = ["serde", "graphviz"] }
19+
egglog = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again", default-features = false }
20+
egglog-bridge = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
21+
egglog-core-relations = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
22+
egglog-experimental = { git = "https://github.com/egraphs-good/egglog-experimental", branch = "update-egglog", default-features = false }
23+
egglog-ast = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
24+
egraph-serialize = { version = "0.3", features = ["serde", "graphviz"] }
2425
serde_json = "1"
2526
pyo3-log = "0.13"
2627
log = "0.4"
2728
lalrpop-util = { version = "0.22", features = ["lexer"] }
28-
ordered-float = "3.7"
29+
ordered-float = "5"
2930
uuid = { version = "1.18", features = ["v4"] }
3031
rayon = "1.11"
3132

3233
# Use patched version of egglog in experimental
3334
[patch.'https://github.com/egraphs-good/egglog']
3435
# egglog = { git = "https://github.com/egraphs-good//egglog.git", branch = "main" }
35-
egglog = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
36-
egglog-bridge = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
37-
egglog-core-relations = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "clone-cost" }
36+
egglog = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
37+
egglog-bridge = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
38+
egglog-core-relations = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
39+
egglog-ast = { git = "https://github.com/saulshanabrook/egg-smol.git", branch = "let-bindings-again" }
3840
# egglog = { path = "../egg-smol" }
3941
# egglog = { git = "https://github.com/egraphs-good//egglog.git", rev = "5542549" }
4042

python/egglog/bindings.pyi

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,14 @@ _Action: TypeAlias = Let | Set | Change | Union | Panic | Expr_
357357

358358
@final
359359
class Variant:
360-
def __init__(self, span: _Span, name: str, types: list[str], cost: int | None = None) -> None: ...
360+
def __init__(
361+
self, span: _Span, name: str, types: list[str], cost: int | None = None, unextractable: bool = False
362+
) -> None: ...
361363
span: _Span
362364
name: str
363365
types: list[str]
364366
cost: int | None
367+
unextractable: bool
365368

366369
@final
367370
class Schema:
@@ -374,7 +377,9 @@ class Rule:
374377
span: _Span
375378
head: list[_Action]
376379
body: list[_Fact]
377-
def __init__(self, span: _Span, head: list[_Action], body: list[_Fact]) -> None: ...
380+
name: str
381+
ruleset: str
382+
def __init__(self, span: _Span, head: list[_Action], body: list[_Fact], name: str, ruleset: str) -> None: ...
378383

379384
@final
380385
class Rewrite:
@@ -586,10 +591,8 @@ class AddRuleset:
586591

587592
@final
588593
class RuleCommand:
589-
name: str
590-
ruleset: str
591594
rule: Rule
592-
def __init__(self, name: str, ruleset: str, rule: Rule) -> None: ...
595+
def __init__(self, rule: Rule) -> None: ...
593596

594597
@final
595598
class RewriteCommand:

python/egglog/egraph_state.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,15 @@ def command_to_egg(self, cmd: CommandDecl, ruleset: Ident) -> bindings._Command
279279
else bindings.BiRewriteCommand(str(ruleset), rewrite)
280280
)
281281
case RuleDecl(head, body, name):
282-
rule = bindings.Rule(
283-
span(),
284-
[self.action_to_egg(a) for a in head],
285-
[self.fact_to_egg(f) for f in body],
282+
return bindings.RuleCommand(
283+
bindings.Rule(
284+
span(),
285+
[self.action_to_egg(a) for a in head],
286+
[self.fact_to_egg(f) for f in body],
287+
name or "",
288+
str(ruleset),
289+
)
286290
)
287-
return bindings.RuleCommand(name or "", str(ruleset), rule)
288291
# TODO: Replace with just constants value and looking at REF of function
289292
case DefaultRewriteDecl(ref, expr, subsume):
290293
sig = self.__egg_decls__.get_callable_decl(ref).signature

python/egglog/visualizer.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)