Expand description
prism — the Prism standard library (wiki ADR-031).
Per Wiki ADR-031, the prism crate is the standard
library: a façade re-exporting uor_foundation’s substrate
together with the built-in axes and built-in types the Layer-3
sub-crates of the standard library declare. The wiki’s user-facing
promise is “depend on uor-prism, write a prism_model!, done”
— application authors do not need to add uor-foundation,
uor-foundation-sdk, or the individual uor-prism-<domain> crates
to their dependency list. Everything composes through
use prism::*; (or finer-grained imports like
use prism::crypto::Sha256Hasher).
Per ADR-024, the standard library is Layer 2 of
the three-layer algebraic closure spine: substrate (uor-foundation)
is Layer 1; verbs and axes declared by application crates are
Layer 3.
§Standard-library Layer-3 sub-crate roster
Per ADR-031’s roster commitment, the standard library publishes
four canonical sub-crates from the Prism repository, each consumed
through the façade re-exports below. Every axis impl is parametric
in its natural axis (byte-width, Q-format split, hasher, dimension)
so application authors instantiate the impl their model needs
without re-rolling the kernel body; canonical type aliases (e.g.,
Sha256Hasher, BigInt256Numeric, CpuI8Tensor4x4Matmul) name
the most common instantiations.
crypto— wiki: hashes, curves, signatures, commitments.HashAxisimpls:Sha256Hasher,Sha512Hasher,Sha3_256Hasher,Keccak256Hasher,Blake3Hasher.CommitmentAxisimpl:MerkleRoot<H, LEAF_BYTES>(parametric overHashAxis), default aliasMerkleRootCommitment= SHA-256. Shapes:Digest<N>,PublicKey<N>,Signature<N>,MerkleProofShape<MAX_DEPTH, LEAF_BYTES>.numerics— wiki: integer, fixed-point, prime-field, GF(2) arithmetic. Parametric:BigIntModularNumeric<BYTES>(8..=512 bits),FixedPointQNumeric<I, F>(any Q-format split ≤ 64 bits total),Gf2NumericAxisN<BYTES>(1..=128 bytes). Concrete:PrimeFieldNumericSecp256k1. Shapes:BigIntShape<N>,FixedPointShape<I, F>,FieldElementShape<N>,Gf2RingShape<N>.tensor— wiki: tensor compute + activations. Parametric:CpuI8MatmulSquare<DIM>(1..=16 squarei8→i16matmul),CpuI8VectorActivation<N>(1..=256-lengthi8vector ReLU / Q1.7 sigmoid). Shapes:MatrixShape<R, C, ELEM_BYTES>,VectorShape<N, ELEM_BYTES>.fhe— wiki: homomorphic encryption. Parametric reference impl:OneTimePadFhe<BLOCK_BYTES>(1..=256). Shape:CiphertextShape<N>.
§SDK macros (re-exported)
Per ADR-031’s façade commitment, the SDK macros declared by
uor-foundation-sdk are re-exported through pipeline so a
single use prism::pipeline::prism_model; reaches the canonical
application-author surface:
prism_model!(ADR-020 / ADR-022) — declare a typed routeverb!(ADR-024) — declare a Layer-3 verb (named composition)axis!(ADR-030) — declare a Layer-3 axis (substrate-extension vocabulary)resolver!(ADR-036) — declare aResolverTuplevalueoutput_shape!(ADR-027) — declare a custom Output shapeuse_verbs!(ADR-024) — import verbs from another implementationproduct_shape!,coproduct_shape!,cartesian_product_shape!,partition_product!,partition_coproduct!(ADR-026 / ADR-033) — shape constructors
§See also
- Wiki: 01 Introduction and Goals
- Wiki: 04 Solution Strategy
- Wiki: 05 Building Block View § Whitebox
prism - Wiki: 06 Runtime View § Scenario 1: Principal Data Path Execution
- Wiki: 09 Architecture Decisions § ADR-024 — Three-layer algebraic closure
- Wiki: 09 Architecture Decisions § ADR-030 —
axis!SDK macro - Wiki: 09 Architecture Decisions § ADR-031 —
prismis the standard library - Wiki: 10 Quality Requirements § Quality Scenarios
- Wiki: 12 Glossary
- Wiki: Conceptual Model § SD — OPM (ISO 19450) overall system diagram naming the three actors and Prism as the system-of-interest
- Wiki: Conceptual Model § SD1 Prism Structure — OPM decomposition of Prism into Substrate, Runtime, and Replay Surface
§Constraints
This crate is normatively bound by:
- TC-01 — zero-cost runtime; no Prism interpreter layer at execution
- TC-02 — sealing of
Validated,Grounded,Certifiedvia the Rust type system, enforced throughpub(crate)constructors in the substrate - TC-03 — singular principal data path; exactly one constructor for
Grounded<T>, reached only throughpipeline::run - TC-04 — bilateral compile-time UORassembly enforcement
- TC-05 — replayability without invoking author deciders or hash
functions; surfaced through
replay::certify_from_trace - TC-06 — no application-author infrastructure at runtime
- ADR-006 — UORassembly is enforced bilaterally at compile time through the Rust type system; this is the architectural commitment that makes TC-04 enforceable rather than aspirational
Substitution axes per ADR-007/030/036: HostTypes, HostBounds,
AxisTuple, ResolverTuple, TypedCommitment.
Additionally:
- ADR-019 —
uor-foundation’s vocabulary is the signature category,Termis its initial algebra,pipeline::runis the catamorphism. - ADR-020 — application authors declare a Prism application by
implementing the sealed
pipeline::PrismModeltrait; theprism_model!macro derivesforward’s body via initiality. - ADR-024 — three-layer algebraic closure (substrate, prism, implementation).
- ADR-030 — the
axis!SDK macro is the universal substrate-extension declaration mechanism. - ADR-031 —
prismIS the standard library: a façade overuor-foundationplus Layer-3 sub-crates published from the Prism repository. - ADR-040 — closed
BoundShapecatalog (7 individuals) withtype:LexicographicLessEqBoundfor byte-sequence-valued observables; 1:1 correspondence with the foundation-publishedObservablePredicateimpl surface per ADR-049. - ADR-048 — typed-commitment substrate: the
TypedCommitmenttrait with three built-in impls (EmptyCommitment,SingletonCommitment<P>,AndCommitment<A, B>) and the canonicalTargetCommitment = SingletonCommitment<LexicographicLessEqThreshold>alias. The 5th model-declaration parameterConPrismModel. - ADR-049 — five foundation-published typed UOR observable
primitives (
Stratum<P>,WalshHadamardParity,UltrametricCloseTo<P>,AffineParity,LexicographicLessEqThreshold) realizing the four taxonomy subclasses of ADR-038’s closed observable catalog. Each isCopy + Sealedand consumable as aSingletonCommitment<P>operand per ADR-048. - ADR-057 — bounded recursive structural typing via
ConstraintRef::Recurse { shape_iri, descent_bound }plus the foundation shape-IRI registry (RegisteredShape,ShapeRegistryProvider,EmptyShapeRegistry,lookup_shape,lookup_shape_in). Apps emit a registry via theregister_shape!SDK macro;partition_product!/partition_coproduct!operand grammar admitsrecurse[(<bound>)]:Tto declare recursive references without const-eval cycles. The registry-aware nerve / Betti substrate primitives shipped in foundation 0.4.15 —primitive_simplicial_nerve_betti_in::<T, R>,primitive_cartesian_nerve_betti_in::<S, R>, andexpand_constraints_in::<R>— walk Recurse entries throughR’s registry plus foundation’s built-in registry, giving the structurally-correct nerve / Betti reading of recursively-expanded constraint sets. Wire-format trace events gain aRecursediscriminant;TRACE_REPLAY_FORMAT_VERSIONbumps to 10.
§C4 placement
Container prism (Level 2) of the Prism system. The submodules
mirror the Level 2 components named in the wiki’s
Building Block View § Whitebox prism, with the
ADR-031-introduced standard-library Layer-3 sub-crate re-exports
sitting beside the foundation runtime surface:
pipeline— the principal data path + SDK macro re-exportsseal— the sealed Prism-mechanism typesreplay— trace-replay verification surfaceoperation— operation declaration vocabularystd_types— standard type library (baseline primitives)vocabulary— foundation surface re-exportscrypto— standard-library cryptography axes (ADR-031)numerics— standard-library numerics axes (ADR-031)tensor— standard-library tensor-compute axes (ADR-031)fhe— standard-library homomorphic-encryption axes (ADR-031)
§Behavior
// Given: the substrate dependency `uor-foundation` is in scope
// When: the prism standard-library façade is loaded
// Then: every wiki Level 2 module of `prism` AND every ADR-031
// standard-library sub-crate is reachable through `use prism::*;`
use prism::{operation as _, pipeline as _, replay as _};
use prism::{seal as _, std_types as _, vocabulary as _};
use prism::{crypto as _, fhe as _, numerics as _, tensor as _};
use uor_foundation as _;
assert_eq!(prism::WIKI, "https://github.com/UOR-Foundation/UOR-Framework/wiki");Re-exports§
pub use uor_foundation;
Modules§
- crypto
- Cryptography axes per Wiki ADR-031
(re-export of
uor-prism-crypto). - fhe
- Homomorphic-encryption axes per Wiki ADR-031
(re-export of
uor-prism-fhe). - numerics
- Numerics axes per Wiki ADR-031
(re-export of
uor-prism-numerics). - operation
- Operation-declaration vocabulary.
- pipeline
- The principal data path: admission, validation, and grounding.
- replay
- Trace-replay verification surface.
- seal
- The seal regime: the three sealed Prism-mechanism types.
- std_
types - Standard type library.
- tensor
- Tensor-compute axes per Wiki ADR-031
(re-export of
uor-prism-tensor). - vocabulary
- Foundation surface re-exports — the single-import vocabulary.