Package daikon

Class PptSlice

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    PptSlice0, PptSlice1, PptSlice2, PptSlice3, PptSliceEquality

    public abstract class PptSlice
    extends Ppt
    A Slice is a view of some of the variables for a program point. A program point (that is, PptTopLevel) does not directly contain invariants. Instead, slices contain the invariants that involve (all) the Slice's variables.

    Suppose a program point has variables A, B, C, and D.
    There would be 4 unary slices -- one each for variables A, B, C, and D.
    There would be 6 binary slices -- for {A,B}, {A,C}, {A,D}, {B,C}, {B,D}, and {C,D}.
    There would be 4 ternary slices -- for {A,B,C}, {A,B,D}, {A,C,D}, and {B,C,D}.

    See Also:
    Serialized Form
    • Method Detail

      • name

        @SideEffectFree
        public final String name​(@GuardSatisfied @UnknownInitialization(PptSlice.class) PptSlice this)
        Specified by:
        name in class Ppt
      • usesVarDerived

        public boolean usesVarDerived​(String name)
        Returns true if any of our variables is named NAME, or is derived from a variable named NAME.
        Returns:
        true if any of our variables is named NAME, or is derived from a variable named NAME
      • allPrestate

        public boolean allPrestate()
        Returns true if all of this slice's variables are orig() variables.
        Returns:
        true if all of this slice's variables are orig() variables
      • removeInvariant

        public void removeInvariant​(Invariant inv)
        This method actually removes the invariant from its PptSlice.
      • remove_falsified

        @RequiresNonNull("daikon.suppress.NIS.suppressor_map")
        protected void remove_falsified()
        Removes any falsified invariants from our list.
      • num_samples

        public abstract int num_samples​(@UnknownInitialization @GuardSatisfied PptSlice this)
        Return an approximation of the number of samples seen on this slice.
      • num_values

        public abstract int num_values()
        Return an approximation of the number of distinct values seen on this slice.
      • processOmissions

        public void processOmissions​(boolean[] omitTypes)
        Remove the invariants noted in omitTypes.
      • repCheck

        public void repCheck()
        Check the internals of this slice. Each invariant in the slice is checked for consistency and each inv.ppt must equal this.
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied PptSlice this)
        For debugging only.
        Overrides:
        toString in class Object
      • contains_inv

        public boolean contains_inv​(Invariant inv)
        Returns whether or not this slice already contains the specified invariant. Whether not invariants match is determine by Invariant.match() This will return true for invariants of the same kind with different formulas (eg, one_of, bound, linearbinary).
      • contains_inv_exact

        @EnsuresNonNullIf(result=true,
                          expression="find_inv_exact(#1)")
        public boolean contains_inv_exact​(Invariant inv)
        Returns whether or not this slice contains an exact match for the specified invariant. An exact match requires that the invariants be of the same class and have the same formula.
      • find_inv_exact

        @Pure
        public @Nullable Invariant find_inv_exact​(Invariant inv)
        Returns the invariant that matches the specified invariant if it exists. Otherwise returns null. An exact match requires that the invariants be of the same class and have the same formula.
      • is_inv_true

        @Pure
        public boolean is_inv_true​(Invariant inv)
        Returns true if the invariant is true in this slice. This can occur if the invariant exists in this slice, is suppressed, or is obvious statically.
      • log

        public void log​(String msg)
        Output specified log information if the PtpSlice class, and this ppt and variables are enabled for logging.