uor-foundation 0.3.0

UOR Foundation — typed Rust traits for the complete ontology. Import and implement.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
// @generated by uor-crate from uor-ontology — do not edit manually

//! `conformance/` namespace — SHACL-equivalent constraint shapes defining what a Prism implementation must provide at each extension point. Machine-verifiable contracts..
//!
//! Space: Bridge

use crate::enums::VerificationDomain;
use crate::enums::ViolationKind;
use crate::enums::WittLevel;
use crate::HostTypes;

/// A constraint shape that a Prism-declared extension must satisfy. Analogous to sh:NodeShape in SHACL.
pub trait Shape<H: HostTypes> {
    /// The OWL class that instances of this shape must belong to.
    fn target_class(&self) -> &H::HostString;
    /// Associated type for `PropertyConstraint`.
    type PropertyConstraint: PropertyConstraint<H>;
    /// A required property in this shape.
    fn required_property(&self) -> &[Self::PropertyConstraint];
    /// Top-level EBNF non-terminal name this Shape generates (e.g., "compile-unit-decl" for CompileUnitShape).
    fn surface_form(&self) -> &H::HostString;
}

/// A single required property within a shape: the property URI, its expected range, minimum and maximum cardinality.
pub trait PropertyConstraint<H: HostTypes> {
    /// The property URI that must be present.
    fn constraint_property(&self) -> &H::HostString;
    /// The expected range of the required property.
    fn constraint_range(&self) -> &H::HostString;
    /// Minimum cardinality of the required property.
    fn min_count(&self) -> u64;
    /// Maximum cardinality (0 = unbounded).
    fn max_count(&self) -> u64;
    /// Literal surface keyword used in the conformance grammar for this property constraint (e.g., "root_term", "witt_level_ceiling").
    fn surface_keyword(&self) -> &H::HostString;
    /// EBNF non-terminal that the value at this constraint slot must match (e.g., "program" for Term ranges, "name" for WittLevel ranges, "decimal-literal" for xsd:decimal, "domain-set" for non-functional IRI lists).
    fn surface_production(&self) -> &H::HostString;
}

/// Shape for declaring a new WittLevel beyond Q3.
pub trait WittLevelShape<H: HostTypes>: Shape<H> {}

/// Shape for declaring an ExternalEffect.
pub trait EffectShape<H: HostTypes>: Shape<H> {}

/// Shape for declaring a ParallelProduct.
pub trait ParallelShape<H: HostTypes>: Shape<H> {}

/// Shape for declaring a ProductiveStream (targets stream:Unfold, the coinductive constructor).
pub trait StreamShape<H: HostTypes>: Shape<H> {}

/// Shape for declaring a new DispatchRule in a DispatchTable.
pub trait DispatchShape<H: HostTypes>: Shape<H> {}

/// Shape for declaring a Lease with LinearSite allocation.
pub trait LeaseShape<H: HostTypes>: Shape<H> {}

/// Shape for declaring a GroundingMap from surface data to the ring.
pub trait GroundingShape<H: HostTypes>: Shape<H> {}

/// The result of validating an extension against a shape: conforms (boolean), and violation details if non-conformant.
pub trait ValidationResult<H: HostTypes> {
    /// Associated type for `Shape`.
    type Shape: Shape<H>;
    /// The shape that was validated against.
    fn validation_shape(&self) -> &Self::Shape;
    /// The instance that was validated.
    fn validation_target(&self) -> &H::HostString;
    /// True iff the target satisfies all constraints of the shape.
    fn conforms(&self) -> bool;
}

/// Shape for user-declared predicates. Requires a bounded evaluator (termination witness) and input type declaration.
pub trait PredicateShape<H: HostTypes>: Shape<H> {}

/// Shape describing the required surface of an InteractionDeclaration consumed by the foundation's InteractionDeclarationBuilder: peer protocol, convergence predicate, and commutator state class. Rejects builders missing any of the three.
pub trait InteractionShape<H: HostTypes>: Shape<H> {}

/// Opaque ring element witness. Cannot be constructed outside the foundation crate — only produced by reduction evaluation or the two-phase minting boundary.
pub trait WitnessDatum<H: HostTypes> {
    /// The quantum level at which this witness datum was minted.
    fn witness_level(&self) -> u64;
    /// The raw byte representation of this witness datum.
    fn witness_bytes(&self) -> &H::WitnessBytes;
}

/// Boundary crossing intermediate for a single grounded coordinate value. Not a WitnessDatum — must be validated and minted by the foundation.
pub trait GroundedCoordinate<H: HostTypes> {
    /// The quantum level tag of this grounded coordinate.
    fn coordinate_level(&self) -> WittLevel;
}

/// Boundary crossing intermediate for a fixed-size array of GroundedCoordinate values. Stack-resident, no heap allocation.
pub trait GroundedTuple<H: HostTypes> {}

/// Sealed marker trait class. Implemented only for GroundedCoordinate and GroundedTuple. Prevents downstream crates from substituting arbitrary types.
pub trait GroundedValueMarker<H: HostTypes> {}

/// Generic validation-proof wrapper. Proves that the inner value was produced by the conformance checker, not fabricated by Prism code.
pub trait ValidatedWrapper<H: HostTypes> {
    /// The validated inner value wrapped by this proof.
    fn validated_inner(&self) -> &H::HostString;
}

/// Opaque derivation trace that can only be extended by the rewrite engine. Records rewrite step count and root term content address.
pub trait WitnessDerivation<H: HostTypes> {}

/// Opaque site budget that can only be decremented by PinningEffect and incremented by UnbindingEffect — never by direct mutation.
pub trait WitnessSiteBudget<H: HostTypes> {}

/// Structured violation diagnostic carrying the shape IRI, constraint IRI, property IRI, expected range, cardinality bounds, and violation kind.
pub trait ShapeViolationReport<H: HostTypes> {
    /// IRI of the conformance:Shape that was validated against.
    fn shape_iri(&self) -> &H::HostString;
    /// IRI of the specific PropertyConstraint that failed.
    fn constraint_iri(&self) -> &H::HostString;
    /// IRI of the property that was missing or invalid.
    fn property_iri(&self) -> &H::HostString;
    /// The expected range class IRI for the violated property.
    fn expected_range(&self) -> &H::HostString;
    /// The minimum cardinality from the violated constraint.
    fn violation_min_count(&self) -> u64;
    /// The maximum cardinality from the violated constraint (0 = unbounded).
    fn violation_max_count(&self) -> u64;
    /// The kind of violation that occurred.
    fn violation_kind(&self) -> ViolationKind;
}

/// Builder for CompileUnit admission. Collects rootTerm, quantumLevelCeiling, thermodynamicBudget, and targetDomains. Validates against CompileUnitShape.
pub trait CompileUnitBuilder<H: HostTypes> {
    /// Associated type for `Term`.
    type Term: crate::kernel::schema::Term<H>;
    /// The root term expression for the CompileUnit.
    fn builder_root_term(&self) -> &Self::Term;
    /// The widest quantum level the computation may reference.
    fn builder_witt_level_ceiling(&self) -> WittLevel;
    /// Landauer-bounded energy budget in kBT ln 2 units.
    fn builder_thermodynamic_budget(&self) -> H::Decimal;
    /// Verification domains targeted by the CompileUnit.
    fn builder_target_domains(&self) -> &[VerificationDomain];
}

/// Builder for EffectShape. Collects effect name, target sites, budget delta, and commutation flag.
pub trait EffectDeclaration<H: HostTypes> {
    /// The name of the declared effect.
    fn effect_name(&self) -> &H::HostString;
    /// Site coordinates this effect reads or writes.
    fn target_sites(&self) -> &[u64];
    /// The site budget delta (positive = increment, negative = decrement).
    fn budget_delta(&self) -> i64;
    /// Whether this effect commutes with effects on disjoint sites.
    fn commutation_flag(&self) -> bool;
}

/// Builder for GroundingShape. Collects source type, ring mapping, and invertibility contract.
pub trait GroundingDeclaration<H: HostTypes> {
    /// Associated type for `TypeDefinition`.
    type TypeDefinition: crate::user::type_::TypeDefinition<H>;
    /// The source type of incoming external data.
    fn grounding_source_type(&self) -> &Self::TypeDefinition;
    /// Description of the mapping from surface data to ring.
    fn ring_mapping(&self) -> &H::HostString;
    /// Whether the grounding map is invertible.
    fn invertibility_contract(&self) -> bool;
}

/// Builder for DispatchShape. Collects predicate, target resolver, and dispatch priority.
pub trait DispatchDeclaration<H: HostTypes> {
    /// Associated type for `PredicateExpression`.
    type PredicateExpression: crate::kernel::reduction::PredicateExpression<H>;
    /// The predicate expression guarding this dispatch rule.
    fn dispatch_predicate(&self) -> &Self::PredicateExpression;
    /// Associated type for `Resolver`.
    type Resolver: crate::bridge::resolver::Resolver<H>;
    /// The resolver to dispatch to when the predicate holds.
    fn target_resolver(&self) -> &Self::Resolver;
    /// Priority ordering for this dispatch rule (lower = first).
    fn dispatch_priority(&self) -> u64;
}

/// Builder for LeaseShape. Collects linear site and lease scope.
pub trait LeaseDeclaration<H: HostTypes> {
    /// The site coordinate allocated linearly by this lease.
    fn linear_site(&self) -> u64;
    /// The scope within which this lease is valid.
    fn lease_scope(&self) -> &H::HostString;
}

/// Builder for StreamShape. Collects unfold seed, step term, and productivity witness.
pub trait StreamDeclaration<H: HostTypes> {
    /// Associated type for `Term`.
    type Term: crate::kernel::schema::Term<H>;
    /// The seed term for the stream unfold constructor.
    fn unfold_seed(&self) -> &Self::Term;
    /// The step function term for the stream unfold.
    fn step_term(&self) -> &Self::Term;
    /// Evidence that the stream is productive (always produces a next element).
    fn productivity_witness(&self) -> &H::HostString;
}

/// Builder for PredicateShape. Collects input type, evaluator term, and termination witness.
pub trait PredicateDeclaration<H: HostTypes> {
    /// Associated type for `TypeDefinition`.
    type TypeDefinition: crate::user::type_::TypeDefinition<H>;
    /// The input type for the declared predicate.
    fn predicate_input_type(&self) -> &Self::TypeDefinition;
    /// Associated type for `Term`.
    type Term: crate::kernel::schema::Term<H>;
    /// The evaluator term for the declared predicate.
    fn evaluator_term(&self) -> &Self::Term;
    /// Evidence that the predicate evaluator terminates on all inputs.
    fn termination_witness(&self) -> &H::HostString;
}

/// Builder for ParallelShape. Collects site partition and disjointness witness.
pub trait ParallelDeclaration<H: HostTypes> {
    /// Associated type for `Partition`.
    type Partition: crate::bridge::partition::Partition<H>;
    /// The site partition for the parallel composition.
    fn site_partition(&self) -> &Self::Partition;
    /// Evidence that the site partition components are pairwise disjoint.
    fn disjointness_witness(&self) -> &H::HostString;
}

/// Builder for WittLevelShape. Collects declared bit width, cycle size, and predecessor level.
pub trait WittLevelDeclaration<H: HostTypes> {
    /// The declared bit width for this quantum level.
    fn declared_bit_width(&self) -> u64;
    /// The declared number of ring states at this level.
    fn declared_cycle_size(&self) -> u64;
    /// The predecessor quantum level in the chain.
    fn predecessor_level(&self) -> WittLevel;
}

/// Boundary session state tracker. Records crossing count and idempotency flag for the two-phase minting boundary.
pub trait MintingSession<H: HostTypes> {
    /// Total boundary crossings in this minting session.
    fn session_crossing_count(&self) -> u64;
    /// Whether applying this session's boundary effect twice equals applying it once.
    fn session_is_idempotent(&self) -> bool;
}

/// An ontology fact recording that a particular OWL class should appear in the foundation crate's `prelude` module re-exports. The v0.2.1 Rust codegen walks PreludeExport individuals filtered by exportsClass to assemble the prelude membership list.
pub trait PreludeExport<H: HostTypes> {
    /// The OWL class IRI that the foundation crate's prelude module should re-export.
    fn exports_class(&self) -> &H::HostString;
    /// The Rust identifier under which the prelude exposes this symbol. Codegen uses this when the class's generated Rust name differs from a desired prelude alias.
    fn export_rust_name(&self) -> &H::HostString;
}

/// Shape validating that a CompileUnit carries all required properties before reduction admission. The unitAddress property is NOT required — it is computed by stage_initialization after shape validation passes.
pub mod compile_unit_shape {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/compileUnit_rootTerm_constraint",
        "https://uor.foundation/conformance/compileUnit_unitWittLevel_constraint",
        "https://uor.foundation/conformance/compileUnit_thermodynamicBudget_constraint",
        "https://uor.foundation/conformance/compileUnit_targetDomains_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "compile-unit-decl";
    /// `targetClass` -> `CompileUnit`
    pub const TARGET_CLASS: &str = "https://uor.foundation/reduction/CompileUnit";
}

/// Exactly one root term is required. Range is schema:Term.
pub mod compile_unit_root_term_constraint {
    /// `constraintProperty` -> `rootTerm`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/rootTerm";
    /// `constraintRange` -> `Term`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "root_term";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "program";
}

/// Exactly one quantum level is required. Range is schema:WittLevel.
pub mod compile_unit_unit_witt_level_constraint {
    /// `constraintProperty` -> `unitWittLevel`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/unitWittLevel";
    /// `constraintRange` -> `WittLevel`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/WittLevel";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "witt_level_ceiling";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "name";
}

/// Exactly one thermodynamic budget is required. Shape validates presence and type; the BudgetSolvencyCheck preflight validates the value against the Landauer bound.
pub mod compile_unit_thermodynamic_budget_constraint {
    /// `constraintProperty` -> `thermodynamicBudget`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/thermodynamicBudget";
    /// `constraintRange` -> `decimal`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#decimal";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "thermodynamic_budget";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "decimal-literal";
}

/// At least one target verification domain is required. maxCount 0 means unbounded.
pub mod compile_unit_target_domains_constraint {
    /// `constraintProperty` -> `targetDomains`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/targetDomains";
    /// `constraintRange` -> `VerificationDomain`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/op/VerificationDomain";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 0;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "target_domains";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "domain-set";
}

/// Required property was not set on the builder.
pub mod missing {}

/// Property was set but its value is not an instance of the constraintRange.
pub mod type_mismatch {}

/// Cardinality violated: too few or too many values provided.
pub mod cardinality_violation {}

/// Value-dependent check failed (Tier 2). For example, thermodynamic budget insufficient for Landauer bound.
pub mod value_check {}

/// A term's quantum level annotation exceeds the CompileUnit ceiling, or binary operation operands are at different levels without an intervening lift or project.
pub mod level_mismatch {}

/// Shape instance validating predicate:DispatchRule declarations against the dispatch-rule-decl grammar.
pub mod dispatch_shape_instance {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/dispatch_predicate_constraint",
        "https://uor.foundation/conformance/dispatch_target_constraint",
        "https://uor.foundation/conformance/dispatch_priority_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "dispatch-rule-decl";
    /// `targetClass` -> `DispatchRule`
    pub const TARGET_CLASS: &str = "https://uor.foundation/predicate/DispatchRule";
}

/// Exactly one predicate term selecting this dispatch rule.
pub mod dispatch_predicate_constraint {
    /// `constraintProperty` -> `dispatchPredicate`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/dispatchPredicate";
    /// `constraintRange` -> `Term`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "predicate";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "term";
}

/// The resolver class invoked when the predicate holds.
pub mod dispatch_target_constraint {
    /// `constraintProperty` -> `dispatchTarget`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/dispatchTarget";
    /// `constraintRange` -> `Resolver`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/resolver/Resolver";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "target_resolver";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "name";
}

/// Non-negative integer evaluation order; lower values evaluate first.
pub mod dispatch_priority_constraint {
    /// `constraintProperty` -> `dispatchPriority`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/dispatchPriority";
    /// `constraintRange` -> `nonNegativeInteger`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "priority";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "integer-literal";
}

/// Shape instance validating schema:WittLevel declarations against the witt-level-decl grammar.
pub mod witt_level_shape_instance {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/wittLevel_bitWidth_constraint",
        "https://uor.foundation/conformance/wittLevel_cycleSize_constraint",
        "https://uor.foundation/conformance/wittLevel_predecessorLevel_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "witt-level-decl";
    /// `targetClass` -> `WittLevel`
    pub const TARGET_CLASS: &str = "https://uor.foundation/schema/WittLevel";
}

/// Bit width must equal 8·(k+1) for some non-negative integer k.
pub mod witt_level_bit_width_constraint {
    /// `constraintProperty` -> `bitsWidth`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/schema/bitsWidth";
    /// `constraintRange` -> `positiveInteger`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#positiveInteger";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "bit_width";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "integer-literal";
}

/// Cycle size must equal 2^bit_width.
pub mod witt_level_cycle_size_constraint {
    /// `constraintProperty` -> `cycleSize`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/schema/cycleSize";
    /// `constraintRange` -> `nonNegativeInteger`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "cycle_size";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "integer-literal";
}

/// The predecessor WittLevel individual whose nextWittLevel will be updated to point at this new level.
pub mod witt_level_predecessor_level_constraint {
    /// `constraintProperty` -> `wittLevelPredecessor`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/schema/wittLevelPredecessor";
    /// `constraintRange` -> `WittLevel`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/WittLevel";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "predecessor_level";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "name";
}

/// Shape instance for predicate:Predicate declarations.
pub mod predicate_shape_instance {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/predicate_inputType_constraint",
        "https://uor.foundation/conformance/predicate_evaluator_constraint",
        "https://uor.foundation/conformance/predicate_terminationWitness_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "predicate-decl";
    /// `targetClass` -> `Predicate`
    pub const TARGET_CLASS: &str = "https://uor.foundation/predicate/Predicate";
}

/// Input type the predicate evaluates over.
pub mod predicate_input_type_constraint {
    /// `constraintProperty` -> `evaluatesOver`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/evaluatesOver";
    /// `constraintRange` -> `TypeDefinition`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/type/TypeDefinition";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "input_type";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "type-expr";
}

/// The evaluator term producing a boolean.
pub mod predicate_evaluator_constraint {
    /// `constraintProperty` -> `evaluatorTerm`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/evaluatorTerm";
    /// `constraintRange` -> `Term`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "evaluator";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "term";
}

/// IRI of a proof:Proof attesting that the evaluator halts on all inputs.
pub mod predicate_termination_witness_constraint {
    /// `constraintProperty` -> `terminationWitness`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/terminationWitness";
    /// `constraintRange` -> `string`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "termination_witness";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "string-literal";
}

/// Shape instance for parallel:ParallelProduct declarations.
pub mod parallel_shape_instance {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/parallel_sitePartition_constraint",
        "https://uor.foundation/conformance/parallel_disjointnessWitness_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "parallel-decl";
    /// `targetClass` -> `ParallelProduct`
    pub const TARGET_CLASS: &str = "https://uor.foundation/parallel/ParallelProduct";
}

/// The site partition this parallel product is over.
pub mod parallel_site_partition_constraint {
    /// `constraintProperty` -> `sitePartition`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/parallel/sitePartition";
    /// `constraintRange` -> `Partition`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/partition/Partition";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "site_partition";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "name";
}

/// IRI of a proof of pairwise disjointness of the partition components.
pub mod parallel_disjointness_witness_constraint {
    /// `constraintProperty` -> `disjointnessWitness`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/parallel/disjointnessWitness";
    /// `constraintRange` -> `string`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "disjointness_witness";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "string-literal";
}

/// Shape instance for stream:ProductiveStream declarations.
pub mod stream_shape_instance {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/stream_unfoldSeed_constraint",
        "https://uor.foundation/conformance/stream_step_constraint",
        "https://uor.foundation/conformance/stream_productivityWitness_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "stream-decl";
    /// `targetClass` -> `ProductiveStream`
    pub const TARGET_CLASS: &str = "https://uor.foundation/stream/ProductiveStream";
}

/// Initial seed value from which the stream unfolds.
pub mod stream_unfold_seed_constraint {
    /// `constraintProperty` -> `unfoldSeed`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/stream/unfoldSeed";
    /// `constraintRange` -> `Term`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "unfold_seed";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "term";
}

/// Function from current seed to (head, next_seed).
pub mod stream_step_constraint {
    /// `constraintProperty` -> `stepTerm`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/stream/stepTerm";
    /// `constraintRange` -> `Term`
    pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "step";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "term";
}

/// IRI of a proof of stream productivity (coinductive well-foundedness).
pub mod stream_productivity_witness_constraint {
    /// `constraintProperty` -> `productivityWitness`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/stream/productivityWitness";
    /// `constraintRange` -> `string`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "productivity_witness";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "string-literal";
}

/// Shape instance for state:ContextLease declarations.
pub mod lease_shape_instance {
    /// `requiredProperty`
    pub const REQUIRED_PROPERTY: &[&str] = &[
        "https://uor.foundation/conformance/lease_linearSite_constraint",
        "https://uor.foundation/conformance/lease_leaseScope_constraint",
    ];
    /// `surfaceForm`
    pub const SURFACE_FORM: &str = "lease-decl";
    /// `targetClass` -> `ContextLease`
    pub const TARGET_CLASS: &str = "https://uor.foundation/state/ContextLease";
}

/// Site coordinate allocated linearly by this lease.
pub mod lease_linear_site_constraint {
    /// `constraintProperty` -> `linearSite`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/state/linearSite";
    /// `constraintRange` -> `nonNegativeInteger`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "linear_site";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "integer-literal";
}

/// Lexical or session scope within which the lease is valid.
pub mod lease_lease_scope_constraint {
    /// `constraintProperty` -> `leaseScope`
    pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/state/leaseScope";
    /// `constraintRange` -> `string`
    pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
    /// `maxCount`
    pub const MAX_COUNT: i64 = 1;
    /// `minCount`
    pub const MIN_COUNT: i64 = 1;
    /// `surfaceKeyword`
    pub const SURFACE_KEYWORD: &str = "lease_scope";
    /// `surfaceProduction`
    pub const SURFACE_PRODUCTION: &str = "string-literal";
}

/// Prelude re-export for schema:Datum.
pub mod prelude_export_datum {
    /// `exportsClass` -> `Datum`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/schema/Datum";
}

/// Prelude re-export for schema:Term.
pub mod prelude_export_term {
    /// `exportsClass` -> `Term`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/schema/Term";
}

/// Prelude re-export for schema:WittLevel.
pub mod prelude_export_witt_level {
    /// `exportsClass` -> `WittLevel`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/schema/WittLevel";
}

/// Prelude re-export for reduction:CompileUnit.
pub mod prelude_export_compile_unit {
    /// `exportsClass` -> `CompileUnit`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/reduction/CompileUnit";
}

/// Prelude re-export for conformance:CompileUnitBuilder.
pub mod prelude_export_compile_unit_builder {
    /// `exportsClass` -> `CompileUnitBuilder`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/CompileUnitBuilder";
}

/// Prelude re-export for conformance:ValidatedWrapper (exposed in Rust as `Validated`).
pub mod prelude_export_validated_wrapper {
    /// `exportRustName`
    pub const EXPORT_RUST_NAME: &str = "Validated";
    /// `exportsClass` -> `ValidatedWrapper`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/ValidatedWrapper";
}

/// Prelude re-export for conformance:ShapeViolationReport.
pub mod prelude_export_shape_violation_report {
    /// `exportsClass` -> `ShapeViolationReport`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/ShapeViolationReport";
}

/// Prelude re-export for conformance:ValidationResult.
pub mod prelude_export_validation_result {
    /// `exportsClass` -> `ValidationResult`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/ValidationResult";
}

/// Prelude re-export for cert:GroundingCertificate.
pub mod prelude_export_grounding_certificate {
    /// `exportsClass` -> `GroundingCertificate`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/GroundingCertificate";
}

/// Prelude re-export for cert:LiftChainCertificate.
pub mod prelude_export_lift_chain_certificate {
    /// `exportsClass` -> `LiftChainCertificate`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/LiftChainCertificate";
}

/// Prelude re-export for cert:InhabitanceCertificate (v0.2.1).
pub mod prelude_export_inhabitance_certificate {
    /// `exportsClass` -> `InhabitanceCertificate`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/InhabitanceCertificate";
}

/// Prelude re-export for cert:CompletenessCertificate.
pub mod prelude_export_completeness_certificate {
    /// `exportsClass` -> `CompletenessCertificate`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/CompletenessCertificate";
}

/// Prelude re-export for type:ConstrainedType.
pub mod prelude_export_constrained_type {
    /// `exportsClass` -> `ConstrainedType`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/type/ConstrainedType";
}

/// Prelude re-export for type:CompleteType.
pub mod prelude_export_complete_type {
    /// `exportsClass` -> `CompleteType`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/type/CompleteType";
}

/// Prelude re-export for state:GroundedContext.
pub mod prelude_export_grounded_context {
    /// `exportsClass` -> `GroundedContext`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/state/GroundedContext";
}

/// Prelude re-export for the foundation enforcement TermArena type. Backed by conformance:WitnessDatum since TermArena has no direct OWL class but is the term-storage container.
pub mod prelude_export_term_arena {
    /// `exportRustName`
    pub const EXPORT_RUST_NAME: &str = "TermArena";
    /// `exportsClass` -> `WitnessDatum`
    pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/WitnessDatum";
}