12 releases (6 breaking)

0.6.0 Jul 16, 2020
0.5.0 Jun 22, 2020
0.4.1 May 26, 2020
0.3.0 Feb 27, 2020
0.0.2 May 21, 2019

#122 in Data structures

Download history 35/week @ 2020-05-27 45/week @ 2020-06-03 2/week @ 2020-06-10 30/week @ 2020-06-17 42/week @ 2020-06-24 16/week @ 2020-07-01 36/week @ 2020-07-08 81/week @ 2020-07-15 57/week @ 2020-07-22 18/week @ 2020-07-29 16/week @ 2020-08-05 64/week @ 2020-08-12 49/week @ 2020-08-19 49/week @ 2020-08-26 36/week @ 2020-09-02 52/week @ 2020-09-09

98 downloads per month

MIT license

205KB
3K SLoC

egg logo egg: egraphs good

Build Status Crates.io Docs.rs

Check out the web demo for some quick egraph action.

Using egg

Add egg to your Cargo.toml like this:

[dependencies]
egg = "0.6.0"

Developing

It's written in Rust. Typically, you install Rust using rustup.

Run cargo doc --open to build and open the documentation in a browser.

Before committing/pushing, make sure to run make, which runs all the tests and lints that CI will.

Tests

You will need graphviz to run the tests. Running cargo test will run the tests. Some tests may time out; try cargo test --release if that happens.

There are a couple interesting tests in the tests directory:

  • prop.rs implements propositional logic and proves some simple theorems.
  • math.rs implements real arithmetic, with a little bit of symbolic differentiation.
  • lambda.rs implements a small lambda calculus, using egg as a partial evaluator.

Dependencies

~0.6–1.3MB
~26K SLoC