Class BinaryInvariant

    • Method Detail

      • add_unordered

        public InvariantStatus add_unordered​(@Interned Object val1,
                                             @Interned Object val2,
                                             int mod_index,
                                             int count)
        Applies the variables in the correct order. If the second variable is an array and the first variable is not, the order of the values is reversed (so that the array is always the first argument).
      • check_unordered

        public InvariantStatus check_unordered​( BinaryInvariant this,
                                               @Interned Object val1,
                                               @Interned Object val2,
                                               int mod_index,
                                               int count)
        Checks the specified values in the correct order. If the second value is an array and the first value is not, the order of the values is reversed (so that the array is always the first argument).

        The values are checked rather than the variables because this is sometimes called on prototype invariants.

      • is_symmetric

        @Pure
        public boolean is_symmetric()
        Returns true if the binary function is symmetric (x,y ⇒ y,x). Subclasses that are symmetric should override.
      • get_swap

        public boolean get_swap()
        Returns the swap setting for invariants that support a swap boolean to handle different permutations. This version should never be called.
      • find

        protected @Nullable Invariant find​(Class<? extends Invariant> cls,
                                           VarInfo v1,
                                           VarInfo v2)
        Searches for the specified binary invariant (by class) in the specified slice. Returns null if the invariant is not found.