Class PairwiseIntLessEqual

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class PairwiseIntLessEqual
    extends TwoSequence
    Represents an invariant between corresponding elements of two sequences of long values. The length of the sequences must match for the invariant to hold. A comparison is made over each (x[i], y[i]) pair. Thus, x[0] is compared to y[0], x[1] to y[1], and so forth. Prints as x[] <= y[].
    See Also:
    Serialized Form
    • Field Detail

      • debug

        public static final Logger debug
        Debug tracer.
      • dkconfig_enabled

        public static boolean dkconfig_enabled
        Boolean. True iff PairwiseIntComparison invariants should be considered.
    • Method Detail

      • enabled

        public boolean enabled()
        Returns whether or not this invariant is enabled.
        Specified by:
        enabled in class Invariant
      • isObviousStatically

        @Pure
        public @Nullable DiscardInfo isObviousStatically​(VarInfo[] vis)
        Description copied from class: Invariant
        Return true if this invariant is necessarily true from a fact that can be determined statically -- for the given varInfos rather than the varInfos of this. Conceptually, this means "is this invariant statically obvious if its VarInfos were switched with vis?" Intended to be overridden by subclasses. Should only do static checking.

        Precondition: vis.length == this.ppt.var_infos.length

        Overrides:
        isObviousStatically in class Invariant
        Parameters:
        vis - the VarInfos this invariant is obvious over. The position and data type of the variables is the *same* as that of this.ppt.var_infos.
      • isObviousDynamically

        @Pure
        public @Nullable DiscardInfo isObviousDynamically​(VarInfo[] vis)
        Description copied from class: Invariant
        Return non-null if this invariant is necessarily true from a fact that can be determined dynamically (after checking data) -- for the given varInfos rather than the varInfos of this. Conceptually, this means, "Is this invariant dynamically obvious if its VarInfos were switched with vis?" Intended to be overriden by subclasses so they can filter invariants after checking; the overriding method should first call "super.isObviousDynamically(vis)". Since this method is dynamic, it should only be called after all processing.
        Overrides:
        isObviousDynamically in class Invariant
      • repr

        public String repr​(@GuardSatisfied PairwiseIntLessEqual this)
        Description copied from class: TwoSequence
        Returns a representation of the class. This includes the classname, variables, and swap state.
        Overrides:
        repr in class TwoSequence
        Returns:
        a string representation of this
      • format_esc

        public String format_esc​(@GuardSatisfied PairwiseIntLessEqual this)
      • check_modified

        public InvariantStatus check_modified​(long @Interned [] a1,
                                              long @Interned [] a2,
                                              int count)
        Description copied from class: TwoSequence
        Presents a sample to the invariant. Returns whether the sample is consistent with the invariant. Does not change the state of the invariant.
        Specified by:
        check_modified in class TwoSequence
        count - how many identical samples were observed in a row. For example, three calls to check_modified with a count parameter of 1 is equivalent to one call to check_modified with a count parameter of 3.
        Returns:
        whether or not the sample is consistent with the invariant
      • isSameFormula

        @Pure
        public boolean isSameFormula​(Invariant other)
        Description copied from class: TwoSequence
        Return true if both invariants are the same class and the order of the variables (swap) is the same.
        Overrides:
        isSameFormula in class TwoSequence
        Parameters:
        other - the invariant to compare to this one
        Returns:
        true iff the two invariants represent the same mathematical formula. Does not consider
      • isExclusiveFormula

        @Pure
        public boolean isExclusiveFormula​(Invariant other)
        Description copied from class: Invariant
        Returns true iff the two invariants represent mutually exclusive mathematical formulas -- that is, if one of them is true, then the other must be false. This method does not consider the context such as variable names, confidences, sample counts, value counts, or related quantities.
        Overrides:
        isExclusiveFormula in class Invariant
        Parameters:
        other - the other invariant to compare to this one
        Returns:
        true iff the two invariants represent mutually exclusive mathematical formulas