pub(crate) struct Minimums {
    pub(crate) positive: TimeStamp,
    pub(crate) negative: TimeStamp,
}
Expand description

The Minimums structure is used to track the dependencies between some item E on the evaluation stack. In particular, it tracks cases where the success of E depends (or may depend) on items deeper in the stack than E (i.e., with lower DFNs).

positive tracks the lowest index on the stack to which we had a POSITIVE dependency (e.g. foo(X) :- bar(X)) – meaning that in order for E to succeed, the dependency must succeed. It is initialized with the index of the predicate on the stack. So imagine we have a stack like this:

    // 0 foo(X)   <-- bottom of stack
    // 1 bar(X)
    // 2 baz(X)   <-- top of stack

In this case, positive would be initially 0, 1, and 2 for foo, bar, and baz respectively. This reflects the fact that the answers for foo(X) depend on the answers for foo(X). =)

Now imagine that we had a clause baz(X) :- foo(X), inducing a cycle. In this case, we would update positive for baz(X) to be 0, reflecting the fact that its answers depend on the answers for foo(X). Similarly, the minimum for bar would (eventually) be updated, since it too transitively depends on foo. foo is unaffected.

negative tracks the lowest index on the stack to which we had a NEGATIVE dependency (e.g., foo(X) :- not { bar(X) }) – meaning that for E to succeed, the dependency must fail. This is initially usize::MAX, reflecting the fact that the answers for foo(X) do not depend on not(foo(X)). When negative cycles are encountered, however, this value must be updated.

Fields

positive: TimeStampnegative: TimeStamp

Implementations

Update our fields to be the minimum of our current value and the values from other.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Cast a value to type U using CastTo.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more