use crate::enums::VerificationDomain;
use crate::enums::WittLevel;
use crate::HostTypes;
pub trait EulerReduction<H: HostTypes> {
fn phase_parameter(&self) -> &H::HostString;
fn stage_count(&self) -> u64;
fn convergence_angle(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn composed_of_maps(&self) -> &[Self::TermExpression];
}
pub trait PhaseRotationScheduler<H: HostTypes> {
fn rotation_schedule(&self) -> &H::HostString;
fn base_angle(&self) -> &H::HostString;
}
pub trait TargetConvergenceAngle<H: HostTypes> {
fn target_angle(&self) -> &H::HostString;
}
pub trait PhaseGateAttestation<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn gate_stage(&self) -> &Self::ReductionStep;
fn gate_expected_phase(&self) -> &H::HostString;
fn gate_result(&self) -> bool;
}
pub trait ComplexConjugateRollback<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn rollback_target(&self) -> &Self::ReductionStep;
}
pub trait ReductionStep<H: HostTypes> {
fn stage_index(&self) -> u64;
fn stage_name(&self) -> &H::HostString;
fn expected_phase(&self) -> &H::HostString;
type StatePredicate: crate::kernel::predicate::StatePredicate<H>;
fn entry_guard(&self) -> &Self::StatePredicate;
fn exit_guard(&self) -> &Self::StatePredicate;
type Effect: crate::kernel::effect::Effect<H>;
fn stage_effect(&self) -> &Self::Effect;
}
pub trait ReductionState<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn current_stage(&self) -> &Self::ReductionStep;
fn phase_angle(&self) -> &H::HostString;
fn pinned_mask(&self) -> u64;
fn free_rank(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn site_state(&self) -> &Self::TermExpression;
}
pub trait ReductionRule<H: HostTypes> {
type GuardedTransition: crate::kernel::predicate::GuardedTransition<H>;
fn transition_guard(&self) -> &Self::GuardedTransition;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn transition_effect(&self) -> &Self::TermExpression;
fn transition_advance(&self) -> bool;
}
pub trait Epoch<H: HostTypes> {
fn epoch_index(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn epoch_datum(&self) -> &Self::TermExpression;
}
pub trait EpochBoundary<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn epoch_boundary_type(&self) -> &Self::TermExpression;
fn preserved_grounding(&self) -> bool;
}
pub trait PredicateExpression<H: HostTypes> {
fn predicate_field(&self) -> &H::HostString;
fn predicate_operator(&self) -> &H::HostString;
fn predicate_value(&self) -> &H::HostString;
}
pub trait GuardExpression<H: HostTypes> {
type PredicateExpression: PredicateExpression<H>;
fn guard_predicates(&self) -> &[Self::PredicateExpression];
}
pub trait TransitionEffect<H: HostTypes> {
type PropertyBind: PropertyBind<H>;
fn effect_bindings(&self) -> &[Self::PropertyBind];
}
pub trait PropertyBind<H: HostTypes> {
fn bind_target(&self) -> &H::HostString;
fn bind_value(&self) -> &H::HostString;
}
pub trait ReductionAdvance<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn advance_from(&self) -> &Self::ReductionStep;
fn advance_to(&self) -> &Self::ReductionStep;
}
pub trait ServiceWindow<H: HostTypes> {
fn window_size(&self) -> u64;
fn window_offset(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn base_context_ref(&self) -> &Self::TermExpression;
}
pub trait ReductionTransaction<H: HostTypes> {
fn transaction_policy(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn transaction_outcome(&self) -> &Self::TermExpression;
fn transaction_scope(&self) -> &Self::TermExpression;
fn transaction_status(&self) -> &Self::TermExpression;
}
pub trait PipelineSuccess<H: HostTypes> {
fn grounding_reached(&self) -> bool;
fn final_grounding(&self) -> &H::HostString;
}
pub trait PipelineFailureReason<H: HostTypes> {
fn failure_kind(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn failure_stage(&self) -> &Self::TermExpression;
}
pub trait PreflightCheck<H: HostTypes> {
fn preflight_kind(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn preflight_result(&self) -> &Self::TermExpression;
fn preflight_order(&self) -> u64;
}
pub trait FeasibilityResult<H: HostTypes> {
fn feasibility_kind(&self) -> &H::HostString;
fn feasibility_witness(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn infeasibility_kind(&self) -> &Self::TermExpression;
}
pub trait LeaseState<H: HostTypes> {
fn lease_phase(&self) -> &H::HostString;
}
pub trait ManagedLease<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn managed_lease_id(&self) -> &Self::TermExpression;
type LeaseState: LeaseState<H>;
fn lease_lifecycle(&self) -> &Self::LeaseState;
fn expiry_epoch(&self) -> u64;
fn lease_budget(&self) -> u64;
}
pub trait LeaseCheckpoint<H: HostTypes> {
fn checkpoint_epoch(&self) -> u64;
type ReductionState: ReductionState<H>;
fn checkpoint_state(&self) -> &Self::ReductionState;
fn lease_remaining_budget(&self) -> u64;
}
pub trait BackPressureSignal<H: HostTypes> {
fn pressure_level(&self) -> &H::HostString;
fn pressure_threshold(&self) -> H::Decimal;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn source_stage(&self) -> &Self::TermExpression;
fn target_stage(&self) -> &Self::TermExpression;
}
pub trait DeferredQuerySet<H: HostTypes> {
fn deferred_count(&self) -> u64;
fn deferral_epoch(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn deferral_reason(&self) -> &Self::TermExpression;
}
pub trait SubleaseTransfer<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn source_lease_ref(&self) -> &Self::TermExpression;
fn target_lease_ref(&self) -> &Self::TermExpression;
fn transferred_budget(&self) -> u64;
fn transfer_completed(&self) -> bool;
}
pub trait ComparisonPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn comparison_field(&self) -> &Self::TermExpression;
fn comparison_operator(&self) -> &Self::TermExpression;
fn comparison_value(&self) -> &Self::TermExpression;
}
pub trait ConjunctionPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn conjuncts(&self) -> &[Self::TermExpression];
}
pub trait DisjunctionPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn disjuncts(&self) -> &[Self::TermExpression];
}
pub trait NegationPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn negated_predicate(&self) -> &Self::TermExpression;
}
pub trait MembershipPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn membership_set(&self) -> &Self::TermExpression;
fn membership_element(&self) -> &Self::TermExpression;
}
pub trait GroundingPredicate<H: HostTypes>: PredicateExpression<H> {
fn grounding_threshold(&self) -> u64;
}
pub trait SiteCoveragePredicate<H: HostTypes>: PredicateExpression<H> {
fn coverage_target(&self) -> u64;
}
pub trait EqualsPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn equality_left(&self) -> &Self::TermExpression;
fn equality_right(&self) -> &Self::TermExpression;
}
pub trait NonNullPredicate<H: HostTypes>: PredicateExpression<H> {
fn non_null_field(&self) -> u64;
}
pub trait QuerySubtypePredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn query_type_ref(&self) -> &Self::TermExpression;
}
pub trait CompileUnit<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn root_term(&self) -> &Self::TermExpression;
fn unit_witt_level(&self) -> WittLevel;
fn thermodynamic_budget(&self) -> &H::HostString;
fn target_domains(&self) -> &[VerificationDomain];
type Element: crate::kernel::address::Element<H>;
fn unit_address(&self) -> &Self::Element;
}
pub trait FailureField<H: HostTypes> {
fn of_failure(&self) -> &H::HostString;
fn field_name(&self) -> &H::HostString;
fn field_type(&self) -> &H::HostString;
}
pub trait SatBound<H: HostTypes> {
fn max_var_count(&self) -> u64;
fn max_clause_count(&self) -> u64;
fn max_literals_per_clause(&self) -> u64;
}
pub trait TimingBound<H: HostTypes> {
fn preflight_budget_ns(&self) -> u64;
fn runtime_budget_ns(&self) -> u64;
}
pub mod stage_initialization {
pub const EXPECTED_PHASE: &str = "Ω⁰";
pub const STAGE_INDEX: i64 = 0;
pub const STAGE_NAME: &str = "Initialization";
}
pub mod stage_declare {
pub const EXPECTED_PHASE: &str = "Ω¹";
pub const STAGE_INDEX: i64 = 1;
pub const STAGE_NAME: &str = "Declare";
}
pub mod stage_factorize {
pub const EXPECTED_PHASE: &str = "Ω²";
pub const STAGE_INDEX: i64 = 2;
pub const STAGE_NAME: &str = "Factorize";
}
pub mod stage_resolve {
pub const EXPECTED_PHASE: &str = "Ω³";
pub const STAGE_INDEX: i64 = 3;
pub const STAGE_NAME: &str = "Resolve";
}
pub mod stage_attest {
pub const EXPECTED_PHASE: &str = "Ω⁴";
pub const STAGE_INDEX: i64 = 4;
pub const STAGE_NAME: &str = "Attest";
}
pub mod stage_extract {
pub const EXPECTED_PHASE: &str = "Ω⁵";
pub const STAGE_INDEX: i64 = 5;
pub const STAGE_NAME: &str = "Extract";
}
pub mod stage_convergence {
pub const EXPECTED_PHASE: &str = "π";
pub const STAGE_INDEX: i64 = 6;
pub const STAGE_NAME: &str = "Convergence";
}
pub mod gate_initialization {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁰";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_initialization";
}
pub mod gate_declare {
pub const GATE_EXPECTED_PHASE: &str = "Ω¹";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_declare";
}
pub mod gate_factorize {
pub const GATE_EXPECTED_PHASE: &str = "Ω²";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_factorize";
}
pub mod gate_resolve {
pub const GATE_EXPECTED_PHASE: &str = "Ω³";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_resolve";
}
pub mod gate_attest {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁴";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_attest";
}
pub mod gate_extract {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁵";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_extract";
}
pub mod euler_reduction_instance {
pub const CONVERGENCE_ANGLE: &str = "π";
pub const PHASE_PARAMETER: &str = "e^{iπ/6}";
pub const STAGE_COUNT: i64 = 6;
}
pub mod phase_schedule {
pub const BASE_ANGLE: &str = "π/6";
pub const ROTATION_SCHEDULE: &str = "Ω⁰, Ω¹, Ω², Ω³, Ω⁴, Ω⁵";
}
pub mod convergence_target {
pub const TARGET_ANGLE: &str = "π";
}
pub mod conjugate_rollback {
pub const ROLLBACK_TARGET: &str = "https://uor.foundation/reduction/stage_initialization";
}
pub mod dispatch_miss {
pub const FAILURE_KIND: &str = "DispatchMiss";
}
pub mod grounding_failure {
pub const FAILURE_KIND: &str = "GroundingFailure";
}
pub mod convergence_stall {
pub const FAILURE_KIND: &str = "ConvergenceStall";
}
pub mod contradiction_detected {
pub const FAILURE_KIND: &str = "ContradictionDetected";
}
pub mod coherence_violation {
pub const FAILURE_KIND: &str = "CoherenceViolation";
}
pub mod shape_mismatch {
pub const FAILURE_KIND: &str = "ShapeMismatch";
}
pub mod full_grounding_success {
pub const GROUNDING_REACHED: bool = true;
}
pub mod feasibility_check {
pub const PREFLIGHT_KIND: &str = "Feasibility";
pub const PREFLIGHT_ORDER: i64 = 1;
}
pub mod dispatch_coverage_check {
pub const PREFLIGHT_KIND: &str = "DispatchCoverage";
pub const PREFLIGHT_ORDER: i64 = 2;
}
pub mod package_coherence_check {
pub const PREFLIGHT_KIND: &str = "PackageCoherence";
pub const PREFLIGHT_ORDER: i64 = 3;
}
pub mod default_service_window {
pub const WINDOW_OFFSET: i64 = 0;
pub const WINDOW_SIZE: i64 = 3;
}
pub mod advance_init_to_declare {
pub const ADVANCE_FROM: &str = "https://uor.foundation/reduction/stage_initialization";
pub const ADVANCE_TO: &str = "https://uor.foundation/reduction/stage_declare";
}
pub mod atomic_transaction {
pub const TRANSACTION_POLICY: &str = "AllOrNothing";
}
pub mod empty_guard {}
pub mod identity_effect {}
pub mod true_predicate {
pub const PREDICATE_FIELD: &str = "*";
pub const PREDICATE_OPERATOR: &str = "true";
pub const PREDICATE_VALUE: &str = "*";
}
pub mod noop_bind {
pub const BIND_TARGET: &str = "none";
pub const BIND_VALUE: &str = "unchanged";
}
pub mod pending {
pub const LEASE_PHASE: &str = "Pending";
}
pub mod active {
pub const LEASE_PHASE: &str = "Active";
}
pub mod released {
pub const LEASE_PHASE: &str = "Released";
}
pub mod expired {
pub const LEASE_PHASE: &str = "Expired";
}
pub mod suspended {
pub const LEASE_PHASE: &str = "Suspended";
}
pub mod feasibility_witness {
pub const FEASIBILITY_KIND: &str = "Feasible";
}
pub mod infeasibility_witness {
pub const FEASIBILITY_KIND: &str = "Infeasible";
pub const FEASIBILITY_WITNESS: &str = "obstruction detected";
}
pub mod preflight_timing {
pub const PREFLIGHT_KIND: &str = "Timing";
pub const PREFLIGHT_ORDER: i64 = 4;
}
pub mod runtime_timing {
pub const PREFLIGHT_KIND: &str = "RuntimeTiming";
pub const PREFLIGHT_ORDER: i64 = 5;
}
pub mod budget_solvency_check {
pub const PREFLIGHT_KIND: &str = "BudgetSolvency";
pub const PREFLIGHT_ORDER: i64 = 0;
}
pub mod back_pressure_default {
pub const PRESSURE_LEVEL: &str = "Medium";
#[allow(clippy::approx_constant)]
pub const PRESSURE_THRESHOLD: f64 = 0.75;
}
pub mod dispatch_miss_query_iri_field {
pub const FIELD_NAME: &str = "query_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/DispatchMiss";
}
pub mod dispatch_miss_table_iri_field {
pub const FIELD_NAME: &str = "table_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/DispatchMiss";
}
pub mod grounding_failure_reason_iri_field {
pub const FIELD_NAME: &str = "reason_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/GroundingFailure";
}
pub mod convergence_stall_stage_field {
pub const FIELD_NAME: &str = "stage_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ConvergenceStall";
}
pub mod convergence_stall_angle_field {
pub const FIELD_NAME: &str = "angle_milliradians";
pub const FIELD_TYPE: &str = "i64";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ConvergenceStall";
}
pub mod contradiction_detected_at_step_field {
pub const FIELD_NAME: &str = "at_step";
pub const FIELD_TYPE: &str = "usize";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ContradictionDetected";
}
pub mod contradiction_detected_trace_iri_field {
pub const FIELD_NAME: &str = "trace_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ContradictionDetected";
}
pub mod coherence_violation_site_position_field {
pub const FIELD_NAME: &str = "site_position";
pub const FIELD_TYPE: &str = "usize";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/CoherenceViolation";
}
pub mod coherence_violation_constraint_iri_field {
pub const FIELD_NAME: &str = "constraint_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/CoherenceViolation";
}
pub mod shape_mismatch_expected_field {
pub const FIELD_NAME: &str = "expected";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ShapeMismatch";
}
pub mod shape_mismatch_got_field {
pub const FIELD_NAME: &str = "got";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ShapeMismatch";
}
pub mod lift_obstruction_site_position_field {
pub const FIELD_NAME: &str = "site_position";
pub const FIELD_TYPE: &str = "usize";
pub const OF_FAILURE: &str = "https://uor.foundation/failure/LiftObstructionFailure";
}
pub mod lift_obstruction_obstruction_class_iri_field {
pub const FIELD_NAME: &str = "obstruction_class_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/failure/LiftObstructionFailure";
}
pub mod two_sat_bound {
pub const MAX_CLAUSE_COUNT: i64 = 512;
pub const MAX_LITERALS_PER_CLAUSE: i64 = 2;
pub const MAX_VAR_COUNT: i64 = 256;
}
pub mod horn_sat_bound {
pub const MAX_CLAUSE_COUNT: i64 = 512;
pub const MAX_LITERALS_PER_CLAUSE: i64 = 8;
pub const MAX_VAR_COUNT: i64 = 256;
}
pub mod preflight_timing_bound {
pub const PREFLIGHT_BUDGET_NS: i64 = 10000000;
}
pub mod runtime_timing_bound {
pub const RUNTIME_BUDGET_NS: i64 = 10000000;
}