pub trait AbstractDomain: Sized + Eq + Clone {
    // Required methods
    fn merge(&self, other: &Self) -> Self;
    fn is_top(&self) -> bool;

    // Provided method
    fn merge_with(&mut self, other: &Self) -> &mut Self { ... }
}
Expand description

The main trait describing an abstract domain.

Each abstract domain is partially ordered. Abstract domains of the same type can be merged.

Required Methods§

source

fn merge(&self, other: &Self) -> Self

Returns an upper bound (with respect to the partial order on the domain) for the two inputs self and other.

source

fn is_top(&self) -> bool

Returns whether the element represents the top element (i.e. maximal with respect to the partial order) or not. If a domain has no maximal element, this function should always return false.

Provided Methods§

source

fn merge_with(&mut self, other: &Self) -> &mut Self

Returns an upper bound (with respect to the partial order on the domain) for the two inputs self and other.

Modifies self in-place to hold the result. This can be useful in situations where it is not necessary to create a new object and more efficient to modify an existing one in-place.

Default

Calls AbstractDomain::merge on the inputs and overwrites self with the result. Does nothing when self is equal to other.

Object Safety§

This trait is not object safe.

Implementors§