Crate datafrog[][src]

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.

Structs

ExtendAnti

Wraps a Relation as a leaper.

ExtendWith

Wraps a Relation as a leaper.

FilterAnti

Wraps a Relation as a leaper.

FilterWith

Wraps a Relation as a leaper.

Iteration

An iterative context for recursive evaluation.

PrefixFilter

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).

Relation

A static, ordered list of key-value pairs.

ValueFilter

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.

Variable

An monotonically increasing set of Tuples.

Traits

JoinInput

An input that can be used with from_join; either a Variable or a Relation.

Leaper

Methods to support treefrog leapjoin.

Leapers

Implemented for a tuple of leapers

RelationLeaper

Extension method for relations.