Trait adapton::engine::AbsMapFam [] [src]

pub trait AbsMapFam<Arg, Abs, T, DiffT, S> {
    fn map(&self, arg: Arg, inp: T) -> S;
fn abs(&self, arg: Arg) -> Abs;
fn join(&self, fst: Abs, snd: Abs) -> Abs;
fn diff(&self, fst: &T, snd: &T) -> DiffT;
fn is_dirty(&self, diff: DiffT, abs: &Abs) -> bool; }

A family of mappings, with a notion of member subsets via abstract mappings. These abstractions compress sequences of observations into a single DCG force edge. See also: force_abs.

Specifically, we abstract sets of edges when the source thunk and target cell are the same two nodes, and the same abstract mapping family is used throughout.

Each mapping family uses several type parameters in its definition:

  • The family maps values of type T to values of type S
  • Each mapping in the family is identified by a distinct Arg value.
  • Each abstract mapping in the family is identified by a distinct Abs value; this Abs value represents a set of Arg values, and likewise, a set of mappings in the family.
  • The family represents (possibly abstracted) differences in type T as values of type DiffT.

Based on these types, the family defines:

  • mappings (fn map),
  • mapping abstraction (fn abs),
  • joins over abstract mappings (fn join),
  • differencing mapping inputs (fn diff),
  • and intersecting differenced inputs and abstracted mappings (fn is_dirty).

TODO: What conditions should hold for an implementation of AbsMap to be sound?

Required Methods

using an Arg, map a value of type T into one of type S

make a concrete mapping argument of type Arg into an abstracted one of type Abs

lattice join operation over two abstracted mappings (intersect fst and snd)

represent the difference between two values of type T, perhaps abstractly, as a value of type DiffT.

intersect the difference in T values (of type DiffT) with the abstract mapping; return true if non-empty.

Implementors