Expand description
UOR Foundation SDK — procedural-macro ergonomics for uor-foundation.
Emitted by codegen/src/sdk_macros.rs from the ontology. Consumers of
this crate must also depend on uor-foundation; the macros emit
absolute-path references (::uor_foundation::…) that resolve in the
consumer’s dependency graph.
§Macros
product_shape!— emits aConstrainedTypeShapeimpl and amint_product_witnesshelper for the UOR product typeA × B(PT_1 / PT_2a / PT_3 / PT_4).coproduct_shape!— emits aConstrainedTypeShapeimpl and amint_coproduct_witnesshelper for the UOR sum typeA + B(ST_1 / ST_2 / ST_6 / ST_7 / ST_8 / ST_9 / ST_10).cartesian_product_shape!— emits aConstrainedTypeShapeimpl, aCartesianProductShapemarker impl, and amint_cartesian_witnesshelper for the UOR Cartesian-partition productA ⊠ B(CPT_1 / CPT_2a / CPT_3 / CPT_4 / CPT_5).prism_model!— emits the seal impls (__sdk_seal::Sealedfor the model and the route witness), theFoundationClosedimpl on the route witness, and thePrismModel<H, B, A>impl whoseforwardbody delegates topipeline::run_route(wiki ADR-020 + ADR-022 D1, D3, D4, D5).
§Operand support
Operand CONSTRAINTS arrays may contain every ConstraintRef
variant: Residue, Hamming, Depth, Carry, Site, Affine,
SatClauses, Bound, and Conjunction. Phase 17 stores
Affine.coefficients as a fixed-size
[i64; AFFINE_MAX_COEFFS] array (capacity 8) and limits
Conjunction.conjuncts to a [LeafConstraintRef; CONJUNCTION_MAX_TERMS]
depth-1 array; both are stable-Rust const-buildable, so the SDK
macros support the full operand catalogue. Inputs exceeding the
caps fail validate_const() with a typed ShapeViolation.
Macros§
- axis
axis!— wiki ADR-030 substrate-extension axis declaration.- cartesian_
product_ shape - Cartesian-product shape constructor. See crate-level docs.
- coproduct_
shape - Coproduct shape constructor. See crate-level docs.
- output_
shape output_shape!— wiki ADR-027 custom Output shape declaration.- partition_
coproduct partition_coproduct!— wiki ADR-026 G18 type-level shape constructor. Variadic named form. Folds left-associatively into binary coproducts. Each binary step emits the same shapecoproduct_shape!produces (ST_10 canonical structure).- partition_
product partition_product!— wiki ADR-026 G17 type-level shape constructor. Emits aConstrainedTypeShapeimpl whoseCONSTRAINTScarry the canonically-joined PT_3 form (algebraic-product per ADR-025), withSITE_COUNT = Σ operands' SITE_COUNT.- prism_
model prism_model!— wiki ADR-020 + ADR-022 D3 closure-bodied form.- product_
shape - Product-type shape constructor. See crate-level docs.
- register_
shape register_shape!— wiki ADR-057 shape-IRI registration. Emits a marker type +ShapeRegistryProviderimpl whoseREGISTRYconst carries oneRegisteredShapeentry per shape, populated from each shape’sConstrainedTypeShapeassociated items.- resolver
resolver!— wiki ADR-036 ResolverTuple declaration macro.- use_
verbs use_verbs!— wiki ADR-024 cross-implementation verb imports.- verb
verb!— wiki ADR-024 Layer-3 verb declaration. Emits a const term-tree fragment and a public accessor.