Skip to main content

Module codemodule

Module codemodule 

Source
Expand description

uor_addr::codemodule — the code-module AST realization of UOR-ADDR (ARCHITECTURE.md “Format-specific realizations” § uor-addr-codemodule).

Code-module AST typed-input content-addressing under the Canonical Code-Module AST Serialization (CCMAS) — a S-expression-shaped canonical AST grammar pinned by this crate and serialized through Rivest 1997’s canonical S-expression form.

§Authoritative sources

§CCMAS grammar

The Canonical Code-Module AST Serialization (CCMAS) is a S-expression-shaped grammar over five AST cases:

CodeModuleValue ::= Module(name, items)
                  | Function(name, parameters, return_type, body)
                  | TypeDeclaration(name, fields)
                  | ConstDeclaration(name, type, value)
                  | Expression(literal | variable | call)

Each AST node serializes to a structurally-tagged byte form whose canonical-form output is a Rivest canonical S-expression shaped as:

Module(name, [items])         → (3:mod  <n:name>  <item_1> <item_2> ... <item_k>)
Function(name, params, ret, body)
                               → (3:fun  <n:name>  (<param_1> ... <param_p>)  <ret_type>  <body_expr>)
TypeDeclaration(name, fields) → (3:type <n:name>  (<field_1> ... <field_f>))
ConstDeclaration(name, ty, v) → (3:const <n:name> <ty> <v>)
Expression                    → format-specific case (atom for literal, atom for variable, (3:call ...) for call)

The CCMAS canonical form is byte-output-equivalent to crate::sexp::canonicalize applied to the tagged surface AST — the canonicalization composes Rivest §4.2/§4.3 over the AST’s grammar cases.

Re-exports§

pub use model::AddressModel;
pub use model::AddressModelBlake3;
pub use model::AddressModelKeccak256;
pub use model::AddressModelSha3_256;
pub use model::AddressModelSha512;
pub use model::AddressRoute;
pub use pipeline::address;
pub use pipeline::address_blake3;
pub use pipeline::address_keccak256;
pub use pipeline::address_sha3_256;
pub use pipeline::address_sha512;
pub use pipeline::AddressFailure;
pub use pipeline::AddressOutcome;
pub use pipeline::AddressWitness;
pub use pipeline::VerifyError;
pub use value::CodeModuleCarrier;
pub use value::canonicalize;
pub use value::CodeModuleValue;
pub use verbs::address_inference;
pub use verbs::VERB_TERMS_ADDRESS_INFERENCE;
pub use crate::resolvers::AddressResolverTuple;

Modules§

model
codemodule::AddressModel* — the codemodule realization’s PrismModel declarations, one per admissible σ-axis (crate::hash). Each binds the shared AddressResolverTuple ψ-tower and the axis’s capacity profile (AddrBounds for the 32-byte axes, AddrBounds64 for sha512). AddressModel (sha256) is the default.
pipeline
codemodule::address — the code-module AST realization’s public entry point.
value
Code-module AST typed input under the Canonical Code-Module AST Serialization (CCMAS) form (ADR-023 amended by ADR-060).
verbs
code-module AST realization’s ψ-chain content-address derivation verb (wiki ADR-024 + ADR-035 + ADR-036 + ARCHITECTURE.md “Common verb arena”).