tokitai-operator 0.1.0

Verified DL kernel compiler: formally-checked GEMM, p-adic, sheaf, contract-carrying ops. Paper-artifact grade.
Documentation
//! Valuation bound for p-adic and similar valued domains.
//!
//! `ValuationBound` is the type that records the upper-bound on
//! the p-adic valuation that the planner is allowed to skip. The
//! p-adic valuation-skip planner uses `ValuationBound` to decide
//! which terms of a sum-product can be skipped without affecting
//! the output up to the active precision.
//!
use super::Domain;

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ValuationBound {
    pub lower: Option<i64>,
    pub upper: Option<i64>,
}

pub trait ValuedDomain: Domain {
    type ValueGroup;

    fn valuation(&self, value: &Self::Element) -> Self::ValueGroup;
}

pub trait NonArchimedeanDomain: ValuedDomain {
    fn satisfies_ultrametric(&self) -> bool {
        true
    }
}