Skip to content

Commit 0b12003

Browse files
Merge pull request #17 from metadsl/16-change-name-to-egglog
Rename to egglog and add citation
2 parents 2dffc81 + 4407fa7 commit 0b12003

39 files changed

+97
-96
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ jobs:
9595
command: build
9696
args: --release --sdist -o dist --find-interpreter
9797
# Pin rust toolchain, so it won't install 1.65.0, otherwise get this error:
98-
# Attempting to include the sdist output tarball dist/egg_smol-0.1.0.tar.gz into itself! Check 'cargo package --list' output.
99-
# https://github.com/metadsl/egg-smol-python/actions/runs/3388178229/jobs/5629843303
98+
# Attempting to include the sdist output tarball dist/egglog-0.1.0.tar.gz into itself! Check 'cargo package --list' output.
99+
# https://github.com/metadsl/egglog-python/actions/runs/3388178229/jobs/5629843303
100100
rust-toolchain: "1.64.0"
101101
- name: Upload wheels
102102
uses: actions/upload-artifact@v2

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: stubtest
3030
name: stubtest
31-
entry: python -m mypy.stubtest egg_smol.bindings --allowlist stubtest_allow
31+
entry: python -m mypy.stubtest egglog.bindings --allowlist stubtest_allow
3232
language: system
3333
pass_filenames: false
3434
require_serial: true

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[package]
2-
name = "egg-smol-python"
2+
name = "egglog-python"
33
version = "0.3.1"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77
[lib]
8-
name = "egg_smol_python"
8+
name = "egglog_python"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
# Use unreleased version to depend on signature improvements https://github.com/PyO3/pyo3/pull/2702
1313
pyo3 = { version = "0.18.1", features = ["extension-module"] }
14-
egg-smol = { git = "https://github.com/mwillsey/egg-smol", rev = "30feaaab88452ec4b6c5f7a199345298bac2dd0f" }
15-
# egg-smol = { path = "../egg-smol" }
14+
egg-smol = { git = "https://github.com/egraphs-good/egglog", rev = "30feaaab88452ec4b6c5f7a199345298bac2dd0f" }
15+
# egg-smol = { path = "../egglog" }
1616
pyo3-log = "0.8.1"
1717
log = "0.4.17"
1818
lalrpop-util = { version = "0.19.8", features = ["lexer"] }
1919
ordered-float = "3.4"
2020

2121
[package.metadata.maturin]
22-
name = "egg_smol.bindings"
22+
name = "egglog.bindings"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# `egg-smol` Python wrapper
1+
# `egglog` Python wrapper
22

3-
[![Documentation Status](https://readthedocs.org/projects/egg-smol-python/badge/?version=latest)](https://egg-smol-python.readthedocs.io/en/latest/?badge=latest) [![Test](https://github.com/metadsl/egg-smol-python/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/metadsl/egg-smol-python/actions/workflows/CI.yml) [![PyPi Package](https://img.shields.io/pypi/v/egg-smol.svg)](https://pypi.org/project/egg-smol/) [![License](https://img.shields.io/pypi/l/egg-smol.svg)](https://pypi.org/project/egg-smol/) [![Python Versions](https://img.shields.io/pypi/pyversions/egg-smol.svg)](https://pypi.org/project/egg-smol/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
3+
[![Documentation Status](https://readthedocs.org/projects/egg-smol-python/badge/?version=latest)](https://egg-smol-python.readthedocs.io/en/latest/?badge=latest) [![Test](https://github.com/metadsl/egglog-python/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/metadsl/egglog-python/actions/workflows/CI.yml) [![PyPi Package](https://img.shields.io/pypi/v/egglog.svg)](https://pypi.org/project/egglog/) [![License](https://img.shields.io/pypi/l/egglog.svg)](https://pypi.org/project/egglog/) [![Python Versions](https://img.shields.io/pypi/pyversions/egglog.svg)](https://pypi.org/project/egglog/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
44

5-
`egg-smol` is a Python package that provides bindings to the Rust library [`egg-smol`](https://github.com/mwillsey/egg-smol/),
5+
`egglog` is a Python package that provides bindings to the Rust library [`egglog`](https://github.com/egraphs-good/egglog/),
66
allowing you to use e-graphs in Python for optimization, symbolic computation, and analysis.
77

8-
Please see the [documentation](https://egg-smol-python.readthedocs.io/en/latest/) for more information.
8+
Please see the [documentation](https://egglog-python.readthedocs.io/en/latest/) for more information.

docs/changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
## Unreleased
44

5+
- Change name to `egglog` from `egg-smol`, to mirror [upstream change](https://github.com/egraphs-good/egglog/commit/9484242f025f6c2adb6f29d75a45dd77b0eaad57). Note that all previous versions are published under the `egg-smol` PyPi package while this and later are under `egglog`.
6+
57
## 0.3.1 (2023-05-02)
68

79
- Fix bug calling methods on paramterized types (e.g. `Map[i64, i64].empty().insert(i64(0), i64(1))`)
810
- Fix bug for Unit type (egg name is `Unit` not `unit`)
911
- Use `@class_` decorator to force subclassing `BaseExpr`
10-
- Workaround extracting definitions until [upstream is fixed](https://github.com/mwillsey/egg-smol/pull/140)
12+
- Workaround extracting definitions until [upstream is fixed](https://github.com/egraphs-good/egglog/pull/140)
1113
- Rename `Map.map_remove` to `Map.remove`.
1214
- Add lambda calculus example
1315

1416
## 0.3.0 (2023-04-26)
1517

16-
- [Upgrade `egg-smol` from `08a6e8fecdb77e6ba72a1b1d9ff4aff33229912c` to `6f2633a5fa379487fb389b80fc1225866f8b8c1a`.](https://github.com/metadsl/egg-smol-python/pull/14)
18+
- [Upgrade `egglog` from `08a6e8fecdb77e6ba72a1b1d9ff4aff33229912c` to `6f2633a5fa379487fb389b80fc1225866f8b8c1a`.](https://github.com/metadsl/egglog-python/pull/14)
1719

1820
## 0.2.0 (2023-03-27)
1921

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
sphinx_gallery_conf = {
1919
# Run all scripts
2020
"filename_pattern": r".*",
21-
"examples_dirs": "../python/egg_smol/examples",
21+
"examples_dirs": "../python/egglog/examples",
2222
"gallery_dirs": "auto_examples",
2323
"abort_on_example_error": True,
2424
"run_stale_examples": True,
@@ -34,7 +34,7 @@
3434

3535
# specify project details
3636
master_doc = "index"
37-
project = "egg-smol Python"
37+
project = "egglog Python"
3838

3939

4040
# basic build settings
@@ -55,7 +55,7 @@
5555
"icon_links": [
5656
{
5757
"name": "GitHub",
58-
"url": "https://github.com/metadsl/egg-smol-python",
58+
"url": "https://github.com/metadsl/egglog-python",
5959
"icon": "fa-brands fa-square-github",
6060
"type": "fontawesome",
6161
},

docs/explanation.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,3 @@ explanation/compared_to_rust
55
explanation/optional_values
66
explanation/define_and_define
77
```
8-
9-
## Status of this project
10-
11-
This package is in development and is not ready for production use. `egg-smol` itself
12-
is also subject to changes and is less stable than [`egg`](https://github.com/egraphs-good/egg).
13-
If you are looking for a more stable e-graphs library in Python, you can try [`snake-egg`](https://github.com/egraphs-good/snake-egg), which wraps `egg`.
14-
15-
`egg-smol` is a rewrite of the egg library to use [relational e-matching](https://arxiv.org/abs/2108.02290):
16-
17-
> We have determined the relational e-matching is somewhat of a poor match for egg as it's currently structured for a couple reasons. (1) Most workloads that egg users encounter focus on small, simple patterns, so relational e-matching is no better and sometimes slower because you have to build the database "from scratch" every iteration. (2) egg gives the user a little too much flexibility in manipulating e-nodes (in particular, you the e-node list in each e-class is exposed); this makes it hard to incrementally maintain the datastructures you'd need for relational e-matching. egg-smol (name temporary) is a clean slate approach to this and some other shortcomings of egg. No promises on its stabilization or merging into egg yet.
18-
>
19-
> - [Max Willsey](https://egraphs.zulipchat.com/#narrow/stream/328972-general/topic/roadmap/near/297442354)
20-
21-
## How documentation is organized
22-
23-
We use the [Diátaxis framework](https://diataxis.fr/) to organize our documentation. This helps with figuring out where different content should live and how it should be organized.

docs/explanation/compared_to_rust.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ egg text version of this from the tests is:
4747
## Low Level API
4848

4949
One way to run this in Python is to parse the text and run it similar to how the
50-
egg-smol CLI works:
50+
egglog CLI works:
5151

5252
```{code-cell} python
53-
from egg_smol.bindings import *
53+
from egglog.bindings import *
5454
5555
eqsat_basic = """(datatype Math
5656
(Num i64)
@@ -81,7 +81,7 @@ commands = egraph.parse_program(eqsat_basic)
8181
egraph.run_program(*commands)
8282
```
8383

84-
The commands are a representation which is close the AST of the egg-smol text language. We
84+
The commands are a representation which is close the AST of the egglog text language. We
8585
can see this by printing the commands:
8686

8787
```{code-cell} python
@@ -102,7 +102,7 @@ Here is the same example using the high level API:
102102
```{code-cell} python
103103
from __future__ import annotations
104104
105-
from egg_smol import *
105+
from egglog import *
106106
107107
egraph = EGraph()
108108
@@ -148,7 +148,7 @@ Here are a number of the low level commands, with how they map to the high levle
148148

149149
- `(datatype Math ...)` -> `@egraph.class_` on a Python class. Internally, each method and classmethod are registered as functions, not as `Variant`s of the datatype, but the end result is the same.
150150
- `(set-option enable_proofs 1)` -> Not supported
151-
- `(declare True Bool)` -> As a class variable `True: Bool` or as a constant `True_ = egraph.constant("True", Bool)`. Internally, we don't actually use the `Constant` command but instead map constants to nullary functions which are immediately evaluated. This is how the `Constant` command is desugared in egg-smol anyways.
151+
- `(declare True Bool)` -> As a class variable `True: Bool` or as a constant `True_ = egraph.constant("True", Bool)`. Internally, we don't actually use the `Constant` command but instead map constants to nullary functions which are immediately evaluated. This is how the `Constant` command is desugared in egglog anyways.
152152
- `(define expr1 ...)` -> `expr1 = egraph.define("expr1", ...)` or just `expr1 = ...` if it doesn't need to be added to the e-graph.
153153
- `(sort MyMap (Map i64 String))` -> `MyMap = Map[i64, String]`. We can use the normal Python generic typing syntax. Internally, when this is used in a type definition, we would create a new sort with the name `Map__i64__String`.
154154
- `(function f ...)` -> `@egraph.function` on a Python function with no body.

docs/explanation/optional_values.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# How does egg-smol handle boolean values?
1+
# How does egglog handle boolean values?
22

33
Some functions, like `<<` return an optional int.
44
Others, like `<` return an optional unit.
@@ -9,7 +9,7 @@ Are optional values automatically unwrapped?
99

1010
It looks like we can use them as conditionals as well, like this `(check (< 1 2))`.
1111

12-
Let's look at how check will be implemented in egg-smol:
12+
Let's look at how check will be implemented in egglog:
1313

1414
1. The rule for parsing `check` in `parse.lalrpop` is:
1515

@@ -23,7 +23,7 @@ Let's look at how check will be implemented in egg-smol:
2323
Let's see what happens if we call check on something that is not true:
2424

2525
```python
26-
from egg_smol.bindings import *
26+
from egglog.bindings import *
2727
egraph = EGraph()
2828
egraph.check_fact(Fact(
2929
Call(
@@ -43,7 +43,7 @@ PanicException: prim was partial... do we allow this?
4343
And what if we call check with a non-unit value?
4444

4545
```python
46-
from egg_smol.bindings import *
46+
from egglog.bindings import *
4747
egraph = EGraph()
4848
egraph.check_fact(Fact(
4949
Call(

0 commit comments

Comments
 (0)