Trait ContainerSort

Source
pub trait ContainerSort:
    Any
    + Send
    + Sync
    + Debug {
    type Container: ContainerValue;

    // Required methods
    fn name(&self) -> &str;
    fn is_eq_container_sort(&self) -> bool;
    fn inner_sorts(&self) -> Vec<ArcSort> ;
    fn inner_values(
        &self,
        _: &ContainerValues,
        _: Value,
    ) -> Vec<(ArcSort, Value)>;
    fn reconstruct_termdag(
        &self,
        _: &ContainerValues,
        _: Value,
        _: &mut TermDag,
        _: Vec<Term>,
    ) -> Term;
    fn serialized_name(
        &self,
        container_values: &ContainerValues,
        value: Value,
    ) -> String;

    // Provided methods
    fn register_primitives(&self, _eg: &mut EGraph) { ... }
    fn to_arcsort(self) -> ArcSort
       where Self: Sized { ... }
}
Expand description

A “default” implementation of Sort for types which just want to store a pure data structure in the e-graph. If you implement this trait, do not implement Sort or BaseSort. Use add_container_sort to register container sorts with the EGraph. See Sort for documentation of the methods. Do not override to_arcsort.

Required Associated Types§

Required Methods§

Source

fn name(&self) -> &str

Source

fn is_eq_container_sort(&self) -> bool

Source

fn inner_sorts(&self) -> Vec<ArcSort>

Source

fn inner_values(&self, _: &ContainerValues, _: Value) -> Vec<(ArcSort, Value)>

Source

fn reconstruct_termdag( &self, _: &ContainerValues, _: Value, _: &mut TermDag, _: Vec<Term>, ) -> Term

Source

fn serialized_name( &self, container_values: &ContainerValues, value: Value, ) -> String

Provided Methods§

Source

fn register_primitives(&self, _eg: &mut EGraph)

Source

fn to_arcsort(self) -> ArcSort
where Self: Sized,

Implementors§