Skip to main content

DeferredSet

Trait DeferredSet 

Source
pub trait DeferredSet:
    Send
    + Sync
    + Debug
    + Any {
    // Required methods
    fn kind(&self) -> DeferredKind;
    fn elements(&self, ctx: Ctx) -> Result<Vec<Value>>;
    fn member(&self, elem: &Value, ctx: Ctx) -> Option<Result<bool>>;

    // Provided methods
    fn key(&self) -> Vec<Value> { ... }
    fn as_any(&self) -> Option<&dyn Any> { ... }
}
Expand description

The source of an evaluator-driven lazy set ({x \in S : P} or {e : x \in S}).

dive-value stores and prints such sets but cannot evaluate them: dive-eval implements this trait.

Required Methods§

Source

fn kind(&self) -> DeferredKind

Which construct the set is.

Source

fn elements(&self, ctx: Ctx) -> Result<Vec<Value>>

Computes the set’s elements in any order; dive-value normalizes them.

§Errors

Any evaluation error.

Source

fn member(&self, elem: &Value, ctx: Ctx) -> Option<Result<bool>>

Decides membership without enumerating, if the source can.

§Errors

Any evaluation error.

Provided Methods§

Source

fn key(&self) -> Vec<Value>

A stable description of the definition (for example the bound set and the values the predicate closes over). Two unenumerable deferred sets of the same kind are equal, and ordered, by their keys; enumerable ones by their elements. The default, an empty key, makes all unenumerable sets of one kind equal.

Source

fn as_any(&self) -> Option<&dyn Any>

The source as std::any::Any, so that its owner can recover its own type (the evaluator reproduces TLC’s unnormalized enumeration of its lazy sets). The default, None, hides it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§