Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Operators

See Concepts: Operators for the full overview.

Bind

bound = hv.bind(a, b)
released = hv.release(bound, b)  # this will recover `a`

hv.equal(a, b)                   # hash equality

Release

Extracts one component from a binding:

release returns a Pointer — a directional reference from composite to role that retains both endpoints for inspection and serialization. The bit-level value is identical to bind(composite, inverse(role)).

bound = hv.bind(role, filler)
recovered = hv.release(bound, role)  # Pointer; ≈ filler at the bit level

Expand (extend a Knot)

Extends an existing Knot with additional operands without re-binding from scratch. k.expand(c) on k = bind(a, b) gives the same result as bind(a, b, c) — but mutates k in place, so clone first if you need the original.

import copy

k = hv.bind(a, b)
k.expand(c)                 # k is now equivalent to hv.bind(a, b, c)

# To preserve the original, clone first:
base = hv.bind(a, b)
k1 = copy.copy(base)
k1.expand(c)                # base is untouched

BindDirect

Like Bind, but returns a raw SparseSegmented instead of a Knot — no operand tracking. Cheaper for intermediate computations where you don’t need to reverse the bind or inspect the operand list.

# domain/pod default to the zero Domain/Pod
ss = hv.bind_direct(a, b, c)

# Or supply an explicit seed (annotates the resulting SparseSegmented):
ss = hv.bind_direct(a, b, domain=d, pod=p)

Bundle

p = hv.bundle(hv.Seed128(10, 1), a, b, c)
Last change: , commit: a781c58