The tiered handle posting — a sorted int[] while small, a RoaringBitmap past
promote — and the intersections over it, as a held namespace
(vaelii.impl.types.prover states what that means). IntPostings mutates its own
fields, which only its inline methods can do, so the type and the code it calls live
here together. The dense index backend (vaelii.impl.dense-kv), the columnar trie and
the dense TMS's adjacency columns store their handle sets in it.
The tiered handle posting — a sorted `int[]` while small, a `RoaringBitmap` past `promote` — and the intersections over it, as a held namespace (`vaelii.impl.types.prover` states what that means). `IntPostings` mutates its own fields, which only its inline methods can do, so the type and the code it calls live here together. The dense index backend (`vaelii.impl.dense-kv`), the columnar trie and the dense TMS's adjacency columns store their handle sets in it.
(intersect-postings postings)The intersection of postings — each an IntPostings or an ascending int[] — as a
Clojure set of Longs.
Smallest first, which is not the tie-break it looks like: the accumulator can only shrink, so seeding it with the narrowest column is what keeps every later step a probe of a few entries rather than a scan of a hot one. An accumulator that empties stops the fold, since nothing after it can put a handle back.
Public because vaelii.impl.dense-roots holds the same postings under its own keys and
must narrow them the same way.
The intersection of `postings` — each an `IntPostings` or an ascending `int[]` — as a Clojure set of Longs. **Smallest first**, which is not the tie-break it looks like: the accumulator can only shrink, so seeding it with the narrowest column is what keeps every later step a probe of a few entries rather than a scan of a hot one. An accumulator that empties stops the fold, since nothing after it can put a handle back. Public because `vaelii.impl.dense-roots` holds the same postings under its own keys and must narrow them the same way.
(padd! p h)Add handle h (in place); return p.
Add handle h (in place); return p.
(pand p acc)acc — a sorted int[] or a RoaringBitmap — narrowed to the handles this posting
also holds, as a fresh accumulator. Dispatches on both representations: two hot
postings meet in RoaringBitmap/and, two cold ones in a sorted merge, and a mixed
pair probes the cold side's entries into the bitmap. So neither side is materialized,
and neither side is mutated — RoaringBitmap.and the instance method would mutate
its receiver, and a query that quietly shrank a posting is a corrupt index the oracle
finds late rather than never.
`acc` — a sorted `int[]` or a `RoaringBitmap` — narrowed to the handles this posting also holds, as a **fresh** accumulator. Dispatches on both representations: two hot postings meet in `RoaringBitmap/and`, two cold ones in a sorted merge, and a mixed pair probes the cold side's entries into the bitmap. So neither side is materialized, and neither side is mutated — `RoaringBitmap.and` the *instance* method would mutate its receiver, and a query that quietly shrank a posting is a corrupt index the oracle finds late rather than never.
(pcard p)Cardinality.
Cardinality.
(pcontains? p h)Is handle h present? A binary search on the int[], or the bitmap's own test —
the O(log n) / O(1) probe that answers membership without building the set
pmembers builds, which is what an index gate calling it per firing needs.
Is handle h present? A binary search on the `int[]`, or the bitmap's own test — the O(log n) / O(1) probe that answers membership without building the set `pmembers` builds, which is what an index gate calling it per firing needs.
(pints p)A fresh sorted int[] of the handles — the boxing-free read, for a caller that
iterates rather than set-tests. Fresh (never the live array) because callers walk
it while mutating the posting, which is exactly what vaelii.impl.dense-jtms does
when it pushes a node's justifications onto a worklist.
A fresh sorted `int[]` of the handles — the boxing-free read, for a caller that iterates rather than set-tests. Fresh (never the live array) because callers walk it while mutating the posting, which is exactly what `vaelii.impl.dense-jtms` does when it pushes a node's justifications onto a worklist.
(pmembers p)A fresh Clojure set of the handles (as Longs).
A fresh Clojure set of the handles (as Longs).
(prem! p h)Remove handle h (in place); return p.
Remove handle h (in place); return p.
(pseed p)This posting as an intersection accumulator — its own int[] or its own
RoaringBitmap, handed back rather than copied. Safe because pand allocates its
result on every arm, so nothing downstream can write through it.
This posting as an intersection accumulator — its own `int[]` or its own `RoaringBitmap`, handed back rather than copied. Safe because `pand` allocates its result on every arm, so nothing downstream can write through it.
(postings-set p)A posting — an IntPostings or an ascending int[] — as a fresh Clojure set of Longs,
for the mixed fold a caller falls back to when one of the keys is not a handle family.
A posting — an `IntPostings` or an ascending `int[]` — as a fresh Clojure set of Longs, for the mixed fold a caller falls back to when one of the keys is not a handle family.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |