[][src]Trait egg::expr::Language

pub trait Language: Debug + PartialEq + Eq + Hash + Clone {
    type Constant: Debug + PartialEq + Eq + Hash + Clone + Display;
    type Variable: Debug + PartialEq + Eq + Hash + Clone + Display;
    type Operator: Debug + PartialEq + Eq + Hash + Clone + Display;
    type Wildcard: Debug + PartialEq + Eq + Hash + Clone;
    fn cost(node: &Expr<Self, u64>) -> u64;
fn eval(op: Self::Operator, args: &[Self::Constant]) -> Self::Constant; }

Trait that wraps up information from the client about the langauge we're working with.

TestLang is provided as a simple implementation.

TODO I think I can remove the requirements on Language itself if I manually derive these things for Expr

Associated Types

Loading content...

Required methods

fn cost(node: &Expr<Self, u64>) -> u64

fn eval(op: Self::Operator, args: &[Self::Constant]) -> Self::Constant

Loading content...

Implementors

impl Language for TestLang[src]

type Constant = i32

type Variable = Name

type Operator = Name

type Wildcard = QuestionMarkName

Loading content...