Crate datafrog

source ·
Expand description

A lightweight Datalog engine in Rust

The intended design is that one has static Relation types that are sets of tuples, and Variable types that represent monotonically increasing sets of tuples.

The types are mostly wrappers around Vec<Tuple> indicating sorted-ness, and the intent is that this code can be dropped in the middle of an otherwise normal Rust program, run to completion, and then the results extracted as vectors again.


Wraps a Relation as a leaper.
Wraps a Relation as a leaper.
Wraps a Relation as a leaper.
Wraps a Relation as a leaper.
An iterative context for recursive evaluation.
A treefrog leaper that tests each of the tuples from the main input (the “prefix”). Use like PrefixFilter::from(|tuple| ...); if the closure returns true, then the tuple is retained, else it will be ignored. This leaper can be used in isolation in which case it just acts like a filter on the input (the “proposed value” will be () type).
A static, ordered list of key-value pairs.
A treefrog leaper based on a predicate of prefix and value. Use like ValueFilter::from(|tuple, value| ...). The closure should return true if value ought to be retained. The value will be a value proposed elsewhere by an extend_with leaper.
An monotonically increasing set of Tuples.


An input that can be used with from_join; either a Variable or a Relation.
Methods to support treefrog leapjoin.
Implemented for a tuple of leapers
Extension method for relations.