Variable

An monotonically increasing set of Tuples.

There are three stages in the lifecycle of a tuple:

1. A tuple is added to this.toAdd, but is not yet visible externally. 2. Newly added tuples are then promoted to this.recent for one iteration. 3. After one iteration, recent tuples are moved to this.stable for posterity.

Each time this.changed() is called, the recent relation is folded into stable, and the toAdd relations are merged, potentially deduplicated against stable, and then made recent. This way, across calls to changed() all added tuples are in recent at least once and eventually all are in stable.

A Variable may optionally be instructed not to de-duplicate its tuples, for reasons of performance. Such a variable cannot be relied on to terminate iterative computation, and it is important that any cycle of derivations have at least one de-duplicating variable on it. TODO: tuple should be constrainted to something with Key/Value.

Constructors

this
this()
Undocumented in source.
this
this(string name)
Undocumented in source.
this
this(TaskPool tp)
Undocumented in source.
this
this(string name, TaskPool tp)
Undocumented in source.

Members

Aliases

TT
alias TT = TupleT

Convenient aliases to retrieve properties about the variable

ThisTS
alias ThisTS = TS
Undocumented in source.

Functions

changed
bool changed()
Undocumented in source. Be warned that the author may not have intended to support it.
complete
Relation!TupleT complete()

Consumes the variable and returns a relation.

countStable
size_t countStable()
insert
void insert(Relation!TupleT relation)
void insert(T relation)
void insert(T[][] relation)

Inserts a relation into the variable.

toString
void toString(Writer w)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

distinct
bool distinct;

Should the variable be maintained distinctly.

forceFastPath
bool forceFastPath;

Used for testing purpose to ensure both paths produce the same result.

name
string name;

A useful name for the variable.

recent
Relation!TupleT recent;

A list of recent tuples, still to be processed.

stable
Relation!TupleT[] stable;

A list of relations whose union are the accepted tuples.

taskPool
TaskPool taskPool;
Undocumented in source.
toAdd
Relation!TupleT[] toAdd;

A list of future tuples, to be introduced.

Inherited Members

From VariableTrait

changed
bool changed()

Reports whether the variable has changed since it was last asked.

Meta