Class DiffDummyInvariant

    • Field Detail

      • formula

        public String formula
        A string representation of the formula that this dummy invariant represents.
      • confidence

        public double confidence
        The confidence fro this dummy invariant.
      • isWorthPrinting

        public boolean isWorthPrinting
        Whether the invariant is worth printing.
    • Method Detail

      • resurrect_done

        protected Invariant resurrect_done​(int[] permutation)
        Description copied from class: Invariant
        Called on the new invariant just before resurrect() returns it to allow subclasses to fix any information they might have cached from the old Ppt and VarInfos.
        Specified by:
        resurrect_done in class Invariant
        Parameters:
        permutation - the permutation
        Returns:
        the permuted invariant
      • isSameInvariant

        @Pure
        public boolean isSameInvariant​(Invariant other)
        Description copied from class: Invariant
        Returns true iff the argument is the "same" invariant as this. Same, in this case, means a matching type, formula, and variable names.
        Overrides:
        isSameInvariant in class Invariant
        Parameters:
        other - the other invariant to compare to this one
        Returns:
        true iff the argument is the "same" invariant as this
      • isSameFormula

        @Pure
        public boolean isSameFormula​(Invariant other)
        Description copied from class: Invariant
        Returns true iff the two invariants represent the same mathematical formula. Does not consider the context such as variable names, confidences, sample counts, value counts, or related quantities. As a rule of thumb, if two invariants format the same, this method returns true. Furthermore, in many cases, if an invariant does not involve computed constants (as "x>c" and "y=ax+b" do for constants a, b, and c), then this method vacuously returns true.
        Specified by:
        isSameFormula in class Invariant
        Parameters:
        other - the invariant to compare to this one
        Returns:
        true iff the two invariants represent the same mathematical formula. Does not consider
      • repr

        public String repr​(@GuardSatisfied DiffDummyInvariant this)
        Description copied from class: Invariant
        For printing invariants, there are two interfaces: repr gives a low-level representation (Invariant.repr_prob() also prints the confidence), and Invariant.format() gives a high-level representation for user output.
        Overrides:
        repr in class Invariant
        Returns:
        a string representation of this
      • enabled

        public boolean enabled()
        Description copied from class: Invariant
        Returns whether or not this class of invariants is currently enabled.

        Its implementation is almost always return dkconfig_enabled;.

        Specified by:
        enabled in class Invariant
      • valid_types

        public boolean valid_types​(VarInfo[] vis)
        Description copied from class: Invariant
        Returns whether or not the invariant is valid over the basic types in vis. This only checks basic types (scalar, string, array, etc) and should match the basic superclasses of invariant (SingleFloat, SingleScalarSequence, ThreeScalar, etc). More complex checks that depend on variable details can be implemented in instantiate_ok().
        Specified by:
        valid_types in class Invariant
        See Also:
        Invariant.instantiate_ok(VarInfo[])
      • merge

        public @Nullable DiffDummyInvariant merge​( DiffDummyInvariant this,
                                                  List<Invariant> invs,
                                                  PptSlice parent_ppt)
        Description copied from class: Invariant
        Merge the invariants in invs to form a new invariant. This implementation merely returns a clone of the first invariant in the list. This is correct for simple invariants whose equation or statistics don't depend on the actual samples seen. It should be overriden for more complex invariants (eg, bound, oneof, linearbinary, etc).
        Overrides:
        merge in class Invariant
        Parameters:
        invs - list of invariants to merge. The invariants must all be of the same type and should come from the children of parent_ppt. They should also all be permuted to match the variable order in parent_ppt.
        parent_ppt - slice that will contain the new invariant
        Returns:
        the merged invariant or null if the invariants didn't represent the same invariant