Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ default = ["bin"]
bin = ["egglog/bin"]

[dependencies]
egglog = { git = "https://github.com/egraphs-good/egglog.git", rev = "5294cdc66a7b90a9a1480cb2d930f2ee5785c8dd", default-features = false }
egglog-ast = { git = "https://github.com/egraphs-good/egglog.git", rev = "5294cdc66a7b90a9a1480cb2d930f2ee5785c8dd", default-features = false }
egglog-reports = { git = "https://github.com/egraphs-good/egglog.git", rev = "5294cdc66a7b90a9a1480cb2d930f2ee5785c8dd", default-features = false }
egglog = { git = "https://github.com/egraphs-good/egglog.git", rev = "9d58d2e4922b28c12aeb032420d09bae1df69718", default-features = false }
egglog-ast = { git = "https://github.com/egraphs-good/egglog.git", rev = "9d58d2e4922b28c12aeb032420d09bae1df69718", default-features = false }
egglog-reports = { git = "https://github.com/egraphs-good/egglog.git", rev = "9d58d2e4922b28c12aeb032420d09bae1df69718", default-features = false }

num = "0.4.3"
lazy_static = "1.4"
Expand All @@ -28,3 +28,7 @@ log = "0.4"
[dev-dependencies]
glob = "0.3.1"
libtest-mimic = "0.8.1"


# Local dev against the forked egglog (quasiquote `:#field` keyword-splice etc.)
# not yet pushed. Remove and bump the `rev` above once egglog is pushed.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
//! - [`(get-size!)` primitive](https://github.com/egraphs-good/egglog-experimental/blob/main/tests/web-demo/node-limit.egg)
//! for inspecting total tuple counts or counts for specific tables
//! - [Multi-extraction](https://github.com/egraphs-good/egglog-experimental/blob/main/tests/web-demo/multi-extract.egg)
//! - Named arguments for declarations. `constructor`, `function`, `relation`,
//! `datatype`, and `datatype*` may name their fields, e.g.
//! `(constructor MyCar (:color Color :numwheel i64) Vehicle)`. Call sites can
//! then pass arguments by name in any order, mix leading positional arguments
//! with trailing named ones, and use a trailing `...` to bind every
//! unspecified field to a fresh variable (see [`named_args`]).
//! - Body-defined primitives with `(primitive name (InputSort*) OutputSort body)`.
//! Body variables are positional (`_0`, `_1`, ...), and a partial primitive
//! body result propagates as primitive failure. The registered primitive uses
Expand Down Expand Up @@ -50,6 +56,8 @@ pub use multi_extract::*;
mod size;
pub use size::*;
mod primitive;
pub mod named_args;
pub use named_args::*;
mod table_stats;
pub use table_stats::*;

Expand Down Expand Up @@ -112,5 +120,11 @@ pub fn experimental_parser() -> Parser {
let mut parser = Parser::default();
parser.add_command_macro(Arc::new(sugar::For));
parser.add_command_macro(Arc::new(sugar::WithRuleset));
// Named arguments for declarations, e.g.
// (constructor MyCar (:color Color :numwheel i64) Vehicle)
// These shadow the built-in declaration commands and register per-name
// expression macros so call sites can pass args by name, reorder them, and
// fill the rest with fresh variables using a trailing `...`.
named_args::register_named_args(&mut parser);
parser
}
Loading
Loading