Class TernaryDerivationFactory

    • Method Detail

      • instantiate

        public abstract TernaryDerivation @Nullable [] instantiate​(VarInfo vi1,
                                                                   VarInfo vi2,
                                                                   VarInfo vi3)
        Create a set of derivations from three base variables. If the base variables aren't worth deriving from, returns null.
        Parameters:
        vi1 - the first of the three base variables
        vi2 - the second of the three base variables
        vi3 - the third of the three base variables
        Returns:
        a set of derivations based on three base variables. We allow more than one because the base variables may have multiple derived variables, per type of derivation. Can also be null if the variables have nothing to derive from.
      • checkType

        public static boolean checkType​(VarInfo vi1,
                                        VarInfo vi2)
        Check if vi1 and vi2 can be a part of a VarInfo triple based on their types.
        Returns:
        true if vi1 and vi2 can belong to a valid VarInfo triple; false otherwise
      • returnType

        public static @Nullable ProglangType returnType​(VarInfo vi1,
                                                        VarInfo vi2)
        Check if vi1 and vi2 can be a part of a VarInfo triple based on their types.
        Returns:
        a ProglangType which is the type of VarInfo needed to make a valid VarInfo triple out of vi1 and vi2 (null otherwise)
      • checkComparability

        public static boolean checkComparability​(VarInfo vi1,
                                                 VarInfo vi2)
        Checks if two base variables are comparable to each other.
        Returns:
        true if vi1 and vi2 are comparable; false otherwise