de.rwth.dfa.jvm.samples
Class CFPAbstraction.BinaryFunction

java.lang.Object
  |
  +--de.rwth.dfa.jvm.samples.CPAbstraction.CPFunction
        |
        +--de.rwth.dfa.jvm.samples.CFPAbstraction.ArithmeticFunction
              |
              +--de.rwth.dfa.jvm.samples.CFPAbstraction.BinaryFunction
All Implemented Interfaces:
Function
Enclosing class:
CFPAbstraction

protected class CFPAbstraction.BinaryFunction
extends CFPAbstraction.ArithmeticFunction

Binary arithmetic operations.


Inner classes inherited from class de.rwth.domains.Function
Function.Tools
 
Field Summary
protected static int ADD_TYPE
           
protected static int AND_TYPE
           
protected static int DIV_TYPE
           
protected static int MUL_TYPE
           
protected static int OR_TYPE
           
protected static int REM_TYPE
           
protected static int SHL_TYPE
           
protected static int SHR_TYPE
           
protected static int SUB_TYPE
           
protected  int type
          Type of binary operation.
protected static int USHR_TYPE
           
protected static int XOR_TYPE
           
 
Fields inherited from class de.rwth.dfa.jvm.samples.CFPAbstraction.ArithmeticFunction
n
 
Fields inherited from class de.rwth.dfa.jvm.samples.CPAbstraction.CPFunction
consume, produce
 
Constructor Summary
CFPAbstraction.BinaryFunction(int type, int consume, int produce)
          Creates a new BinaryFunction instance.
 
Method Summary
protected  double eval(double x, double y)
          Performs the operation on double.
protected  float eval(float x, float y)
          Performs the operation on float.
protected  int eval(int x, int y)
          Performs the operation on int.
protected  long eval(long x, long y)
          Performs the operation on long.
 java.lang.Number evaluate(java.lang.Number[] values)
          Supposed to do the actual operation.
 java.lang.String toString()
           
 
Methods inherited from class de.rwth.dfa.jvm.samples.CFPAbstraction.ArithmeticFunction
apply
 
Methods inherited from class de.rwth.dfa.jvm.samples.CPAbstraction.CPFunction
apply, getDomain, getRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD_TYPE

protected static final int ADD_TYPE

SUB_TYPE

protected static final int SUB_TYPE

MUL_TYPE

protected static final int MUL_TYPE

DIV_TYPE

protected static final int DIV_TYPE

REM_TYPE

protected static final int REM_TYPE

AND_TYPE

protected static final int AND_TYPE

OR_TYPE

protected static final int OR_TYPE

XOR_TYPE

protected static final int XOR_TYPE

SHL_TYPE

protected static final int SHL_TYPE

SHR_TYPE

protected static final int SHR_TYPE

USHR_TYPE

protected static final int USHR_TYPE

type

protected int type
Type of binary operation. Must be one of the constants in this class.
Constructor Detail

CFPAbstraction.BinaryFunction

public CFPAbstraction.BinaryFunction(int type,
                                     int consume,
                                     int produce)
Creates a new BinaryFunction instance. The type must be one of the constants in this class.
Parameters:
type - an int value
consume - an int value
produce - an int value
Method Detail

eval

protected double eval(double x,
                      double y)
Performs the operation on double.
Parameters:
x - a double value
y - a double value
Returns:
a double value

eval

protected float eval(float x,
                     float y)
Performs the operation on float.
Parameters:
x - a float value
y - a float value
Returns:
a float value

eval

protected long eval(long x,
                    long y)
Performs the operation on long.
Parameters:
x - a long value
y - a long value
Returns:
a long value

eval

protected int eval(int x,
                   int y)
Performs the operation on int.
Parameters:
x - an int value
y - an int value
Returns:
an int value

toString

public java.lang.String toString()
Overrides:
toString in class CFPAbstraction.ArithmeticFunction

evaluate

public java.lang.Number evaluate(java.lang.Number[] values)
                          throws FunctionException
Description copied from class: CFPAbstraction.ArithmeticFunction
Supposed to do the actual operation.
Overrides:
evaluate in class CFPAbstraction.ArithmeticFunction
Following copied from class: de.rwth.dfa.jvm.samples.CFPAbstraction.ArithmeticFunction
Parameters:
values - a Number[] value
Returns:
a Number value
Throws:
FunctionException - if an error occurs