Package daikon.inv

Class DummyInvariant

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class DummyInvariant
    extends Invariant
    This is a special invariant used internally by Daikon to represent invariants whose meaning Daikon doesn't understand. The only operation that can be performed on a DummyInvariant is to print it. In particular, the invariant cannot be tested against a sample: the invariant is always assumed to hold and is always considered to be statistically justified.

    The main use for a dummy invariant is to represent a splitting condition that appears in a .spinfo file. The .spinfo file can indicate an arbitrary Java expression, which might not be equivalent to any invariant in Daikon's grammar.

    Ordinarily, Daikon uses splitting conditions to split data, then seeks to use that split data to form conditional invariants out of its standard built-in invariants. If you wish the expression in the .spinfo file to be printed as an invariant, whether or not it is itself discovered by Daikon during invariant detection, then the configuration option daikon.split.PptSplitter.dummy_invariant_level must be set, and formatting information must be supplied in the splitter info file.

    See Also:
    Serialized Form
    • Field Detail

      • valid

        public boolean valid
    • Method Detail

      • negate

        public void negate()
      • format_esc

        public String format_esc​(@GuardSatisfied DummyInvariant this)
      • format_jml

        public String format_jml​(@GuardSatisfied DummyInvariant this)
      • format_dbc

        public String format_dbc​(@GuardSatisfied DummyInvariant this)
      • 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
      • isSameFormula

        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
      • enabled

        public boolean enabled​( DummyInvariant this)
        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​( DummyInvariant this,
                                   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[])