de.rwth.dfa.jvm.samples
Class CPAbstraction.DupFunction

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

protected class CPAbstraction.DupFunction
extends CPAbstraction.CPFunction

Duplicates n elements on the stack under x other elements.


Inner classes inherited from class de.rwth.domains.Function
Function.Tools
 
Field Summary
protected  int n
          The number of elements on top to duplicate.
protected  int x
          The number of elements under the n original elements.
 
Fields inherited from class de.rwth.dfa.jvm.samples.CPAbstraction.CPFunction
consume, produce
 
Constructor Summary
CPAbstraction.DupFunction(int x, int n, int consume, int produce)
          Creates a new DupFunction instance.
 
Method Summary
protected  void apply(java.lang.Object[] locals, java.util.Stack stack)
          Removes the n top elements from the stack, then removes x elements from the remaining stack, pushes the n elements, pushed the x elements, and pushes the n elements again.
 java.lang.String toString()
           
 
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

n

protected int n
The number of elements on top to duplicate.

x

protected int x
The number of elements under the n original elements.
Constructor Detail

CPAbstraction.DupFunction

public CPAbstraction.DupFunction(int x,
                                 int n,
                                 int consume,
                                 int produce)
Creates a new DupFunction instance.
Parameters:
x - an int value
n - an int value
consume - an int value
produce - an int value
Method Detail

apply

protected void apply(java.lang.Object[] locals,
                     java.util.Stack stack)
              throws FunctionException
Removes the n top elements from the stack, then removes x elements from the remaining stack, pushes the n elements, pushed the x elements, and pushes the n elements again.
Overrides:
apply in class CPAbstraction.CPFunction
Parameters:
locals - an Object[] value
stack - a Stack value
Throws:
FunctionException - if an error occurs

toString

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