kleene-index
Static indexes over a GraphAr set. A set never changes once written, so each index is built once, kept beside the set (<set>.kix) and keyed by the set's root hash; the set stays the truth and an index only answers faster what the set already says. Queries allocate nothing.
AddrColumn/AddrLookup: address to function, block, line or call site, on a static search tree (zoomies-stree).Reach: "can A reach B" from the strong-component condensation and 2-hop labels;ReverseReach: who reaches a target set.Groups(key to ids),ParentTree(the why chain from an entry),NestingandIntervals.Central: a split graph's coordinator index built from the ones above (anIdSpacerow per part, the part graph'sReachfor pruning, the placement part -> machine,Names), kept in aStore.save_computed_split/load_computed_split: a computed split (kleene-graphcomputed_split) kept beside the set per edge type and part count, one byte a node, with what it was made by; refused for another snapshot or node count.Loads: parts (or the whole graph) loaded ahead of any query from anEdgeSource(GarEdges, orTransposedfor its edges by target) at a snapshot, each with its graph and reach index; their summaries buildCentral, and a later query finds them instead of building them.IndexSetopens a set's indexes, building what is missing.relations: each index as an external relation of rules (kleene-planExternal):AddrRel,ReachRel,ReverseReachRel,NestRel,IntervalRel,GroupRel,ParentRel,LazyReachRel,RangeRel,NameRowsRel,KindsRel.catalog/indexed: a set's catalog (kleene-gar) with its indexes added (a range index per number property, a name index per string one, a kind label per value of akindcolumn, a reach index per edge label), so Datalog and GQL bind the set and its indexes by name.
Part of kleene.
use kleene_index::{AddrColumn, Reach};
// 0 -> 1 -> 2, and 3 alone, as CSR offsets and neighbours.
let (off, adj) = (vec![0u64, 1, 2, 2, 2], vec![1u32, 2]);
let reach = Reach::build(&off, &adj)?;
assert!(reach.reaches(0, 2));
assert!(!reach.reaches(2, 0));
assert!(!reach.reaches(0, 3));
// Functions starting at 0x100, 0x200 and 0x300: which one holds 0x2a0?
let starts = AddrColumn::build(vec![0x100u64, 0x200, 0x300].into(), None)?;
assert_eq!(starts.lookup()?.floor(0x2a0), Some(1));
# Ok::<(), kleene_index::IndexError>(())
Licence
MIT or Apache-2.0, at your option.