Class GeneralStatement<T extends IVariable<?>>

    • Constructor Detail

      • GeneralStatement

        public GeneralStatement​(T lhs,
                                AbstractOperator<T> operator)
        Constructor for case of zero operands on the right-hand side.
        Parameters:
        lhs - the lattice cell set by this equation
        operator - the equation operator
      • GeneralStatement

        public GeneralStatement​(T lhs,
                                AbstractOperator<T> operator,
                                T op1,
                                T op2)
        Constructor for case of two operands on the right-hand side.
        Parameters:
        lhs - the lattice cell set by this equation
        operator - the equation operator
        op1 - the first operand on the rhs
        op2 - the second operand on the rhs
      • GeneralStatement

        public GeneralStatement​(T lhs,
                                AbstractOperator<T> operator,
                                T op1,
                                T op2,
                                T op3)
        Constructor for case of three operands on the right-hand side.
        Parameters:
        lhs - the lattice cell set by this equation
        operator - the equation operator
        op1 - the first operand on the rhs
        op2 - the second operand on the rhs
        op3 - the third operand on the rhs
      • GeneralStatement

        public GeneralStatement​(T lhs,
                                AbstractOperator<T> operator,
                                T[] rhs)
        Constructor for case of more than three operands on the right-hand side.
        Parameters:
        lhs - the lattice cell set by this equation
        operator - the equation operator
        rhs - the operands of the right-hand side in order
        Throws:
        IllegalArgumentException - if rhs is null
    • Method Detail

      • evaluate

        public byte evaluate()
        Evaluate this equation, setting a new value for the left-hand side.
        Returns:
        true if the lhs value changed. false otherwise
      • getLHS

        public T getLHS()
        Return the left-hand side of this equation.
        Returns:
        the lattice cell this equation computes
      • hasVariable

        public boolean hasVariable​(T cell)
        Does this equation contain an appearance of a given cell? Note: this uses reference equality, assuming that the variables are canonical! This is fragile. TODO: Address it perhaps, but be careful not to sacrifice efficiency.
        Parameters:
        cell - the cell in question
        Returns:
        true or false
      • makeRHS

        protected abstract T[] makeRHS​(int size)
      • getRHS

        public T[] getRHS()
        Description copied from interface: IFixedPointStatement
        returns the list of free variables appearing in the right-hand side of the statement