use crate::enums::VerificationDomain;
use crate::enums::ViolationKind;
use crate::enums::WittLevel;
use crate::Primitives;
pub trait Shape<P: Primitives> {
fn target_class(&self) -> &P::String;
type PropertyConstraint: PropertyConstraint<P>;
fn required_property(&self) -> &[Self::PropertyConstraint];
}
pub trait PropertyConstraint<P: Primitives> {
fn constraint_property(&self) -> &P::String;
fn constraint_range(&self) -> &P::String;
fn min_count(&self) -> P::NonNegativeInteger;
fn max_count(&self) -> P::NonNegativeInteger;
}
pub trait WittLevelShape<P: Primitives>: Shape<P> {}
pub trait EffectShape<P: Primitives>: Shape<P> {}
pub trait ParallelShape<P: Primitives>: Shape<P> {}
pub trait StreamShape<P: Primitives>: Shape<P> {}
pub trait DispatchShape<P: Primitives>: Shape<P> {}
pub trait LeaseShape<P: Primitives>: Shape<P> {}
pub trait GroundingShape<P: Primitives>: Shape<P> {}
pub trait ValidationResult<P: Primitives> {
type Shape: Shape<P>;
fn validation_shape(&self) -> &Self::Shape;
fn validation_target(&self) -> &P::String;
fn conforms(&self) -> P::Boolean;
}
pub trait PredicateShape<P: Primitives>: Shape<P> {}
pub trait WitnessDatum<P: Primitives> {
fn witness_level(&self) -> P::NonNegativeInteger;
fn witness_bytes(&self) -> &P::String;
}
pub trait GroundedCoordinate<P: Primitives> {
fn coordinate_level(&self) -> WittLevel;
}
pub trait GroundedTuple<P: Primitives> {}
pub trait GroundedValueMarker<P: Primitives> {}
pub trait ValidatedWrapper<P: Primitives> {
fn validated_inner(&self) -> &P::String;
}
pub trait WitnessDerivation<P: Primitives> {}
pub trait WitnessSiteBudget<P: Primitives> {}
pub trait ShapeViolationReport<P: Primitives> {
fn shape_iri(&self) -> &P::String;
fn constraint_iri(&self) -> &P::String;
fn property_iri(&self) -> &P::String;
fn expected_range(&self) -> &P::String;
fn violation_min_count(&self) -> P::NonNegativeInteger;
fn violation_max_count(&self) -> P::NonNegativeInteger;
fn violation_kind(&self) -> ViolationKind;
}
pub trait CompileUnitBuilder<P: Primitives> {
type Term: crate::kernel::schema::Term<P>;
fn builder_root_term(&self) -> &Self::Term;
fn builder_witt_level_ceiling(&self) -> WittLevel;
fn builder_thermodynamic_budget(&self) -> P::Decimal;
fn builder_target_domains(&self) -> &[VerificationDomain];
}
pub trait EffectDeclaration<P: Primitives> {
fn effect_name(&self) -> &P::String;
fn target_sites(&self) -> &[P::NonNegativeInteger];
fn budget_delta(&self) -> P::Integer;
fn commutation_flag(&self) -> P::Boolean;
}
pub trait GroundingDeclaration<P: Primitives> {
type TypeDefinition: crate::user::type_::TypeDefinition<P>;
fn grounding_source_type(&self) -> &Self::TypeDefinition;
fn ring_mapping(&self) -> &P::String;
fn invertibility_contract(&self) -> P::Boolean;
}
pub trait DispatchDeclaration<P: Primitives> {
type PredicateExpression: crate::kernel::reduction::PredicateExpression<P>;
fn dispatch_predicate(&self) -> &Self::PredicateExpression;
type Resolver: crate::bridge::resolver::Resolver<P>;
fn target_resolver(&self) -> &Self::Resolver;
fn dispatch_priority(&self) -> P::NonNegativeInteger;
}
pub trait LeaseDeclaration<P: Primitives> {
fn linear_site(&self) -> P::NonNegativeInteger;
fn lease_scope(&self) -> &P::String;
}
pub trait StreamDeclaration<P: Primitives> {
type Term: crate::kernel::schema::Term<P>;
fn unfold_seed(&self) -> &Self::Term;
fn step_term(&self) -> &Self::Term;
fn productivity_witness(&self) -> &P::String;
}
pub trait PredicateDeclaration<P: Primitives> {
type TypeDefinition: crate::user::type_::TypeDefinition<P>;
fn predicate_input_type(&self) -> &Self::TypeDefinition;
type Term: crate::kernel::schema::Term<P>;
fn evaluator_term(&self) -> &Self::Term;
fn termination_witness(&self) -> &P::String;
}
pub trait ParallelDeclaration<P: Primitives> {
type Partition: crate::bridge::partition::Partition<P>;
fn site_partition(&self) -> &Self::Partition;
fn disjointness_witness(&self) -> &P::String;
}
pub trait WittLevelDeclaration<P: Primitives> {
fn declared_bit_width(&self) -> P::PositiveInteger;
fn declared_cycle_size(&self) -> P::NonNegativeInteger;
fn predecessor_level(&self) -> WittLevel;
}
pub trait MintingSession<P: Primitives> {
fn session_crossing_count(&self) -> P::NonNegativeInteger;
fn session_is_idempotent(&self) -> P::Boolean;
}
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 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 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 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 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 mod missing {}
pub mod type_mismatch {}
pub mod cardinality_violation {}
pub mod value_check {}
pub mod level_mismatch {}