Class FunctionBinary

    • Field Detail

      • dkconfig_enabled

        public static boolean dkconfig_enabled
        Boolean. True if FunctionBinary invariants should be considered.
    • Method Detail

      • enabled

        public boolean enabled()
        returns whether or not this invariant is enabled
        Specified by:
        enabled in class Invariant
      • check_ordered

        public InvariantStatus check_ordered​(long result,
                                             long arg1,
                                             long arg2,
                                             int count)
        Apply the specified sample to the function, returning the result. The caller is responsible for permuting the arguments.
      • add_ordered

        public InvariantStatus add_ordered​(long result,
                                           long arg1,
                                           long arg2,
                                           int count)
        Apply the specified sample to the function, returning the result. The caller is responsible for permuting the arguments.
      • resurrect_done

        protected Invariant resurrect_done​(int[] permutation)
        Reorganize our already-seen state as if the variables had shifted order underneath us (re-arrangement given by the permutation). We accomplish this by returning the class that corresponds to the new permutation.
        Overrides:
        resurrect_done in class TernaryInvariant
        Parameters:
        permutation - the permutation
        Returns:
        the permuted invariant
      • repr

        public String repr​(@GuardSatisfied FunctionBinary 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
      • 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
      • 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
      • isMinimum

        @Pure
        public boolean isMinimum()
      • isMaximum

        @Pure
        public boolean isMaximum()
      • isPower

        @Pure
        public boolean isPower()
      • isGcd

        @Pure
        public boolean isGcd()
      • isMod

        @Pure
        public boolean isMod()
      • isLshift

        @Pure
        public boolean isLshift()