Type System

Definition

The UOR type system provides a structured way to classify objects in the ring. The base class is TypeDefinition.

Type Hierarchy

ClassDescription
TypeDefinitionBase type
PrimitiveTypeAtomic type (e.g., u8, u16)
ProductTypeCartesian product of types
SumTypeDiscriminated union of types
ConstrainedTypeType with additional constraints

Properties

PropertyDomainRangeDescription
bitWidthPrimitiveTypexsd:nonNegativeIntegerBit width
componentProductTypeTypeDefinitionComponent types
baseTypeSumType/ConstrainedTypeTypeDefinitionBase type
constraintConstrainedTypexsd:stringConstraint expression
contentAddressTypeDefinitionu:AddressContent address

Example: Primitive Types

<https://uor.foundation/instance/type-u8>
    a               type:PrimitiveType ;
    type:bitWidth   "8"^^xsd:nonNegativeInteger .

<https://uor.foundation/instance/type-u64>
    a               type:PrimitiveType ;
    type:bitWidth   "64"^^xsd:nonNegativeInteger .

Integration with State

Types are used in Binding to record the type of bound values:

<https://uor.foundation/instance/binding-x>
    a               state:Binding ;
    state:boundType <https://uor.foundation/instance/type-u8> .

Integration with Partition

Types serve as the source for partition computations via sourceType.