Type System
Definition
The UOR type system provides a structured way to classify objects in the ring. The base class is TypeDefinition.
Type Hierarchy
| Class | Description |
|---|---|
| TypeDefinition | Base type |
| PrimitiveType | Atomic type (e.g., u8, u16) |
| ProductType | Cartesian product of types |
| SumType | Discriminated union of types |
| ConstrainedType | Type with additional constraints |
Properties
| Property | Domain | Range | Description |
|---|---|---|---|
| bitWidth | PrimitiveType | xsd:nonNegativeInteger | Bit width |
| component | ProductType | TypeDefinition | Component types |
| baseType | SumType/ConstrainedType | TypeDefinition | Base type |
| constraint | ConstrainedType | xsd:string | Constraint expression |
| contentAddress | TypeDefinition | u:Address | Content 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.