soot.shimple.toolkits.scalar
Class SEvaluator

java.lang.Object
  extended by soot.shimple.toolkits.scalar.SEvaluator

public class SEvaluator
extends Object

Extension of soot.jimple.toolkits.scalar.Evaluator to handle Phi expressions.

Author:
Navindra Umanee.
See Also:
Evaluator, SConstantPropagatorAndFolder

Nested Class Summary
static class SEvaluator.BottomConstant
          Bottom i.e.
static class SEvaluator.MetaConstant
          Head of a new hierarchy of constants -- Top and Bottom.
static class SEvaluator.TopConstant
          Top i.e.
 
Constructor Summary
SEvaluator()
           
 
Method Summary
static Value getConstantValueOf(Value op)
          Returns the constant value of op if it is easy to find the constant value; else returns null.
static Constant getFuzzyConstantValueOf(Value v)
          If a normal expression contains Bottom, always return Bottom.
static Constant getFuzzyConstantValueOf(Value v, Map<Local,Constant> localToConstant)
          Get the constant value of the expression given the assumptions in the localToConstant map (may contain Top and Bottom).
static boolean isValueConstantValued(Value op)
          Returns true if given value is determined to be constant valued, false otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SEvaluator

public SEvaluator()
Method Detail

isValueConstantValued

public static boolean isValueConstantValued(Value op)
Returns true if given value is determined to be constant valued, false otherwise


getConstantValueOf

public static Value getConstantValueOf(Value op)
Returns the constant value of op if it is easy to find the constant value; else returns null.


getFuzzyConstantValueOf

public static Constant getFuzzyConstantValueOf(Value v)
If a normal expression contains Bottom, always return Bottom. Otherwise, if a normal expression contains Top, returns Top. Else determine the constant value of the expression if possible, if not return Bottom.

If a Phi expression contains Bottom, always return Bottom. Otherwise, if all the constant arguments are the same (ignoring Top and locals) return that constant or Top if no concrete constant is present, else return Bottom.

See Also:
SEvaluator.TopConstant, SEvaluator.BottomConstant

getFuzzyConstantValueOf

public static Constant getFuzzyConstantValueOf(Value v,
                                               Map<Local,Constant> localToConstant)
Get the constant value of the expression given the assumptions in the localToConstant map (may contain Top and Bottom). Does not change expression.

See Also:
SEvaluator.TopConstant, SEvaluator.BottomConstant