ascent!() { /* proc-macro */ }Expand description
The main macro of the ascent library. Allows writing logical inference rules similar to Datalog.
Example:
ascent!{
relation edge(i32, i32);
relation path(i32, i32);
path(x, y) <-- edge(x,y);
path(x, z) <-- edge(x,y), path(y, z);
}
fn main() {
let mut tc_comp = AscentProgram::default();
tc_comp.edge = vec![(1,2), (2,3)];
tc_comp.run();
println!("{:?}", tc_comp.path);
}this macro creates a type named AscentProgram that can be instantiated using AscentProgram::default().
The type has a run() method, which runs the computation to a fixed point.