[][src]Trait tract_core::analyser::rules::expr::TExp

pub trait TExp<T>: Debug {
    fn get(&self, context: &Context) -> TractResult<T>;
fn set(&self, context: &mut Context, value: T) -> TractResult<bool>;
fn get_paths(&self) -> Vec<&Path>; }

An expression that can be compared by the solver.

Required methods

fn get(&self, context: &Context) -> TractResult<T>

Returns the current value of the expression in the given context.

fn set(&self, context: &mut Context, value: T) -> TractResult<bool>

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>

Returns the paths that the expression depends on.

Loading content...

Implementors

impl TExp<GenericFact<TDim>> for IntoDimExp[src]

fn get(&self, context: &Context) -> TractResult<DimFact>[src]

Returns the current value of the expression in the given context.

fn set(&self, context: &mut Context, value: DimFact) -> TractResult<bool>[src]

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>[src]

Returns the paths that the expression depends on.

impl<T> TExp<T> for ConstantExp<T> where
    T: Fact + Output + Clone + Debug
[src]

fn get(&self, _: &Context) -> TractResult<T>[src]

Returns the current value of the expression in the given context.

fn set(&self, _: &mut Context, value: T) -> TractResult<bool>[src]

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>[src]

Returns the paths that the expression depends on.

impl<T> TExp<T> for ScaledExp<T> where
    T: Fact + Output + Zero + Mul<i32, Output = T> + Div<i32, Output = T> + Clone
[src]

fn get(&self, context: &Context) -> TractResult<T>[src]

Returns the current value of the expression in the given context.

fn set(&self, context: &mut Context, value: T) -> TractResult<bool>[src]

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>[src]

Returns the paths that the expression depends on.

impl<T> TExp<T> for SumExp<T> where
    T: Fact + Output + Zero + Add<T> + Neg<Output = T> + Clone + Debug
[src]

fn get(&self, context: &Context) -> TractResult<T>[src]

Returns the current value of the expression in the given context.

fn set(&self, context: &mut Context, value: T) -> TractResult<bool>[src]

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>[src]

Returns the paths that the rule depends on.

impl<T> TExp<T> for VariableExp<T> where
    T: Fact + Output + Clone + Debug
[src]

fn get(&self, context: &Context) -> TractResult<T>[src]

Returns the current value of the expression in the given context.

fn set(&self, context: &mut Context, value: T) -> TractResult<bool>[src]

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>[src]

Returns the paths that the expression depends on.

impl<T: Fact + Output + Clone + Debug> TExp<T> for Exp<T>[src]

fn get(&self, context: &Context) -> TractResult<T>[src]

Returns the current value of the expression in the given context.

fn set(&self, context: &mut Context, value: T) -> TractResult<bool>[src]

Tries to set the value of the expression in the given context.

fn get_paths(&self) -> Vec<&Path>[src]

Returns the paths that the expression depends on.

Loading content...