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 #
layoutBodyWords: faithful three-word encoding ofMemory.Layout nviaword_enc_structure.HeapLayout,layoutWords: the existing layout and its faithful four-word encoding.IndexArgument,indexWords: append a runtime heap position to the layout.HandleArgument,handleWords: the same word vector for a typed valid handle.
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.
The tuple word encoding of the fields of layoutBodyWords.
The existing dependent layout, including the runtime number of handles.
The runtime layout has a faithful four-word representation.
A runtime layout with a heap position or handle word.
The runtime heap layout with its capacity.
The number of handles.
The heap layout.
The heap position or handle word.
Faithful runtime layout and heap position.
A valid handle packaged with the runtime layout; no new layout or machine state is added.
The number of handles.
The heap layout.
The valid handle.
Forget the handle's bound, keeping its word.
The typed handle reuses the same layout/index encoding by faithful inclusion.