pub trait ValueAlgebra: TowerValue {
// Required methods
fn add(a: Self, b: Self) -> Result<Self, String>;
fn subtract(a: Self, b: Self) -> Result<Self, String>;
fn multiply(a: Self, b: Self) -> Result<Self, String>;
fn exact_divide(a: Self, b: Self) -> Result<Self, String>;
fn modulo(a: Self, b: Self) -> Result<Self, String>;
fn holds(rel: Rel, a: &Self, b: &Self) -> Result<bool, String>;
fn power(a: Self, b: Self) -> Result<Self, String>;
fn floor(v: Self) -> Result<Self, String>;
fn ceil(v: Self) -> Result<Self, String>;
fn list(values: Vec<Self>) -> Self;
fn shape(&self) -> Shape<Self>;
}Expand description
A value model’s whole arithmetic and its lists: what the supertask runtime computes with. Each operation is the language’s own on that model, exact types and standard numbers alike.
Required Methods§
fn add(a: Self, b: Self) -> Result<Self, String>
fn subtract(a: Self, b: Self) -> Result<Self, String>
fn multiply(a: Self, b: Self) -> Result<Self, String>
Sourcefn exact_divide(a: Self, b: Self) -> Result<Self, String>
fn exact_divide(a: Self, b: Self) -> Result<Self, String>
/ in an exact context: field division, integers included.
Sourcefn holds(rel: Rel, a: &Self, b: &Self) -> Result<bool, String>
fn holds(rel: Rel, a: &Self, b: &Self) -> Result<bool, String>
Whether a rel b holds, decided: an answer that depends on the residue, or a provisional
one, is the refusal of the branch.
fn list(values: Vec<Self>) -> Self
fn shape(&self) -> Shape<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.