Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/kleene

crates/kleene-index/README.md

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.

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.