Documentation

CslibFrontier.DataStructure.PriorityQueue.BinaryHeap.Native.Encoding

Runtime word encodings for the memory heap #

Every native method uses the existing dependent Memory.Layout, including its runtime number of handles. The size address/length and array base remain values, rather than selecting code. The same encoding is shared by both sifts and the finite family of operation bodies.

Main definitions #

Implementation notes #

The native arguments are nested pairs read through named abbrev accessors such as IndexArgument.layout, not structures. realize matches a call such as Memory.insert L v k against a certificate by expanding only Prod and Sigma arguments (callArgument), so a structure argument would no longer match the plain-argument call sites in Extract and in Dijkstra's native client.

Faithful three-word representation of a heap layout: size block (base, length) then array base.

@[reducible, inline]

The tuple word encoding of the fields of layoutBodyWords.

@[reducible, inline]

The existing dependent layout, including the runtime number of handles.

The runtime layout has a faithful four-word representation.

@[reducible, inline]

A runtime layout with a heap position or handle word.

@[reducible, inline]

The runtime heap layout with its capacity.

@[reducible, inline]

The heap position or handle word.

@[reducible, inline]

Faithful runtime layout and heap position.

@[reducible, inline]

A valid handle packaged with the runtime layout; no new layout or machine state is added.

@[reducible, inline]

Forget the handle's bound, keeping its word.

The typed handle reuses the same layout/index encoding by faithful inclusion.