use crate::enums::VerificationDomain;
use crate::enums::ViolationKind;
use crate::enums::WittLevel;
use crate::HostTypes;
pub trait Shape<H: HostTypes> {
fn target_class(&self) -> &H::HostString;
type PropertyConstraint: PropertyConstraint<H>;
fn required_property(&self) -> &[Self::PropertyConstraint];
fn surface_form(&self) -> &H::HostString;
}
pub trait PropertyConstraint<H: HostTypes> {
fn constraint_property(&self) -> &H::HostString;
fn constraint_range(&self) -> &H::HostString;
fn min_count(&self) -> u64;
fn max_count(&self) -> u64;
fn surface_keyword(&self) -> &H::HostString;
fn surface_production(&self) -> &H::HostString;
}
pub trait WittLevelShape<H: HostTypes>: Shape<H> {}
pub trait EffectShape<H: HostTypes>: Shape<H> {}
pub trait ParallelShape<H: HostTypes>: Shape<H> {}
pub trait StreamShape<H: HostTypes>: Shape<H> {}
pub trait DispatchShape<H: HostTypes>: Shape<H> {}
pub trait LeaseShape<H: HostTypes>: Shape<H> {}
pub trait GroundingShape<H: HostTypes>: Shape<H> {}
pub trait ValidationResult<H: HostTypes> {
type Shape: Shape<H>;
fn validation_shape(&self) -> &Self::Shape;
fn validation_target(&self) -> &H::HostString;
fn conforms(&self) -> bool;
}
pub trait PredicateShape<H: HostTypes>: Shape<H> {}
pub trait InteractionShape<H: HostTypes>: Shape<H> {}
pub trait WitnessDatum<H: HostTypes> {
fn witness_level(&self) -> u64;
fn witness_bytes(&self) -> &H::WitnessBytes;
}
pub trait GroundedCoordinate<H: HostTypes> {
fn coordinate_level(&self) -> WittLevel;
}
pub trait GroundedTuple<H: HostTypes> {}
pub trait GroundedValueMarker<H: HostTypes> {}
pub trait ValidatedWrapper<H: HostTypes> {
fn validated_inner(&self) -> &H::HostString;
}
pub trait WitnessDerivation<H: HostTypes> {}
pub trait WitnessSiteBudget<H: HostTypes> {}
pub trait ShapeViolationReport<H: HostTypes> {
fn shape_iri(&self) -> &H::HostString;
fn constraint_iri(&self) -> &H::HostString;
fn property_iri(&self) -> &H::HostString;
fn expected_range(&self) -> &H::HostString;
fn violation_min_count(&self) -> u64;
fn violation_max_count(&self) -> u64;
fn violation_kind(&self) -> ViolationKind;
}
pub trait CompileUnitBuilder<H: HostTypes> {
type Term: crate::kernel::schema::Term<H>;
fn builder_root_term(&self) -> &Self::Term;
fn builder_witt_level_ceiling(&self) -> WittLevel;
fn builder_thermodynamic_budget(&self) -> H::Decimal;
fn builder_target_domains(&self) -> &[VerificationDomain];
}
pub trait EffectDeclaration<H: HostTypes> {
fn effect_name(&self) -> &H::HostString;
fn target_sites(&self) -> &[u64];
fn budget_delta(&self) -> i64;
fn commutation_flag(&self) -> bool;
}
pub trait GroundingDeclaration<H: HostTypes> {
type TypeDefinition: crate::user::type_::TypeDefinition<H>;
fn grounding_source_type(&self) -> &Self::TypeDefinition;
fn ring_mapping(&self) -> &H::HostString;
fn invertibility_contract(&self) -> bool;
}
pub trait DispatchDeclaration<H: HostTypes> {
type PredicateExpression: crate::kernel::reduction::PredicateExpression<H>;
fn dispatch_predicate(&self) -> &Self::PredicateExpression;
type Resolver: crate::bridge::resolver::Resolver<H>;
fn target_resolver(&self) -> &Self::Resolver;
fn dispatch_priority(&self) -> u64;
}
pub trait LeaseDeclaration<H: HostTypes> {
fn linear_site(&self) -> u64;
fn lease_scope(&self) -> &H::HostString;
}
pub trait StreamDeclaration<H: HostTypes> {
type Term: crate::kernel::schema::Term<H>;
fn unfold_seed(&self) -> &Self::Term;
fn step_term(&self) -> &Self::Term;
fn productivity_witness(&self) -> &H::HostString;
}
pub trait PredicateDeclaration<H: HostTypes> {
type TypeDefinition: crate::user::type_::TypeDefinition<H>;
fn predicate_input_type(&self) -> &Self::TypeDefinition;
type Term: crate::kernel::schema::Term<H>;
fn evaluator_term(&self) -> &Self::Term;
fn termination_witness(&self) -> &H::HostString;
}
pub trait ParallelDeclaration<H: HostTypes> {
type Partition: crate::bridge::partition::Partition<H>;
fn site_partition(&self) -> &Self::Partition;
fn disjointness_witness(&self) -> &H::HostString;
}
pub trait WittLevelDeclaration<H: HostTypes> {
fn declared_bit_width(&self) -> u64;
fn declared_cycle_size(&self) -> u64;
fn predecessor_level(&self) -> WittLevel;
}
pub trait MintingSession<H: HostTypes> {
fn session_crossing_count(&self) -> u64;
fn session_is_idempotent(&self) -> bool;
}
pub trait PreludeExport<H: HostTypes> {
fn exports_class(&self) -> &H::HostString;
fn export_rust_name(&self) -> &H::HostString;
}
pub mod compile_unit_shape {
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",
];
pub const SURFACE_FORM: &str = "compile-unit-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/reduction/CompileUnit";
}
pub mod compile_unit_root_term_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/rootTerm";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "root_term";
pub const SURFACE_PRODUCTION: &str = "program";
}
pub mod compile_unit_unit_witt_level_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/unitWittLevel";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/WittLevel";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "witt_level_ceiling";
pub const SURFACE_PRODUCTION: &str = "name";
}
pub mod compile_unit_thermodynamic_budget_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/thermodynamicBudget";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#decimal";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "thermodynamic_budget";
pub const SURFACE_PRODUCTION: &str = "decimal-literal";
}
pub mod compile_unit_target_domains_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/reduction/targetDomains";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/op/VerificationDomain";
pub const MAX_COUNT: i64 = 0;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "target_domains";
pub const SURFACE_PRODUCTION: &str = "domain-set";
}
pub mod missing {}
pub mod type_mismatch {}
pub mod cardinality_violation {}
pub mod value_check {}
pub mod level_mismatch {}
pub mod dispatch_shape_instance {
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",
];
pub const SURFACE_FORM: &str = "dispatch-rule-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/predicate/DispatchRule";
}
pub mod dispatch_predicate_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/dispatchPredicate";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "predicate";
pub const SURFACE_PRODUCTION: &str = "term";
}
pub mod dispatch_target_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/dispatchTarget";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/resolver/Resolver";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "target_resolver";
pub const SURFACE_PRODUCTION: &str = "name";
}
pub mod dispatch_priority_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/dispatchPriority";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "priority";
pub const SURFACE_PRODUCTION: &str = "integer-literal";
}
pub mod witt_level_shape_instance {
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",
];
pub const SURFACE_FORM: &str = "witt-level-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/schema/WittLevel";
}
pub mod witt_level_bit_width_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/schema/bitsWidth";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#positiveInteger";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "bit_width";
pub const SURFACE_PRODUCTION: &str = "integer-literal";
}
pub mod witt_level_cycle_size_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/schema/cycleSize";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "cycle_size";
pub const SURFACE_PRODUCTION: &str = "integer-literal";
}
pub mod witt_level_predecessor_level_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/schema/wittLevelPredecessor";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/WittLevel";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "predecessor_level";
pub const SURFACE_PRODUCTION: &str = "name";
}
pub mod predicate_shape_instance {
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",
];
pub const SURFACE_FORM: &str = "predicate-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/predicate/Predicate";
}
pub mod predicate_input_type_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/evaluatesOver";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/type/TypeDefinition";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "input_type";
pub const SURFACE_PRODUCTION: &str = "type-expr";
}
pub mod predicate_evaluator_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/evaluatorTerm";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "evaluator";
pub const SURFACE_PRODUCTION: &str = "term";
}
pub mod predicate_termination_witness_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/predicate/terminationWitness";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "termination_witness";
pub const SURFACE_PRODUCTION: &str = "string-literal";
}
pub mod parallel_shape_instance {
pub const REQUIRED_PROPERTY: &[&str] = &[
"https://uor.foundation/conformance/parallel_sitePartition_constraint",
"https://uor.foundation/conformance/parallel_disjointnessWitness_constraint",
];
pub const SURFACE_FORM: &str = "parallel-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/parallel/ParallelProduct";
}
pub mod parallel_site_partition_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/parallel/sitePartition";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/partition/Partition";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "site_partition";
pub const SURFACE_PRODUCTION: &str = "name";
}
pub mod parallel_disjointness_witness_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/parallel/disjointnessWitness";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "disjointness_witness";
pub const SURFACE_PRODUCTION: &str = "string-literal";
}
pub mod stream_shape_instance {
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",
];
pub const SURFACE_FORM: &str = "stream-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/stream/ProductiveStream";
}
pub mod stream_unfold_seed_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/stream/unfoldSeed";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "unfold_seed";
pub const SURFACE_PRODUCTION: &str = "term";
}
pub mod stream_step_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/stream/stepTerm";
pub const CONSTRAINT_RANGE: &str = "https://uor.foundation/schema/Term";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "step";
pub const SURFACE_PRODUCTION: &str = "term";
}
pub mod stream_productivity_witness_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/stream/productivityWitness";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "productivity_witness";
pub const SURFACE_PRODUCTION: &str = "string-literal";
}
pub mod lease_shape_instance {
pub const REQUIRED_PROPERTY: &[&str] = &[
"https://uor.foundation/conformance/lease_linearSite_constraint",
"https://uor.foundation/conformance/lease_leaseScope_constraint",
];
pub const SURFACE_FORM: &str = "lease-decl";
pub const TARGET_CLASS: &str = "https://uor.foundation/state/ContextLease";
}
pub mod lease_linear_site_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/state/linearSite";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "linear_site";
pub const SURFACE_PRODUCTION: &str = "integer-literal";
}
pub mod lease_lease_scope_constraint {
pub const CONSTRAINT_PROPERTY: &str = "https://uor.foundation/state/leaseScope";
pub const CONSTRAINT_RANGE: &str = "http://www.w3.org/2001/XMLSchema#string";
pub const MAX_COUNT: i64 = 1;
pub const MIN_COUNT: i64 = 1;
pub const SURFACE_KEYWORD: &str = "lease_scope";
pub const SURFACE_PRODUCTION: &str = "string-literal";
}
pub mod prelude_export_datum {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/schema/Datum";
}
pub mod prelude_export_term {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/schema/Term";
}
pub mod prelude_export_witt_level {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/schema/WittLevel";
}
pub mod prelude_export_compile_unit {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/reduction/CompileUnit";
}
pub mod prelude_export_compile_unit_builder {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/CompileUnitBuilder";
}
pub mod prelude_export_validated_wrapper {
pub const EXPORT_RUST_NAME: &str = "Validated";
pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/ValidatedWrapper";
}
pub mod prelude_export_shape_violation_report {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/ShapeViolationReport";
}
pub mod prelude_export_validation_result {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/ValidationResult";
}
pub mod prelude_export_grounding_certificate {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/GroundingCertificate";
}
pub mod prelude_export_lift_chain_certificate {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/LiftChainCertificate";
}
pub mod prelude_export_inhabitance_certificate {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/InhabitanceCertificate";
}
pub mod prelude_export_completeness_certificate {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/cert/CompletenessCertificate";
}
pub mod prelude_export_constrained_type {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/type/ConstrainedType";
}
pub mod prelude_export_complete_type {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/type/CompleteType";
}
pub mod prelude_export_grounded_context {
pub const EXPORTS_CLASS: &str = "https://uor.foundation/state/GroundedContext";
}
pub mod prelude_export_term_arena {
pub const EXPORT_RUST_NAME: &str = "TermArena";
pub const EXPORTS_CLASS: &str = "https://uor.foundation/conformance/WitnessDatum";
}