Class EvaluationUtils
java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.EvaluationUtils
Some evaluation utility methods.
- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classImplements a variable replacer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static intcalculateDiff(CustomOperation operation, IDatatype returns, IDatatype[] argTypes) Returns the difference of the operations in terms of different (assignable) types.(package private) static StringcreateSpaces(int count) Creates a string ofcountspaces.private static intCalculates the difference between the compoundtypeand its refinement hierarcy andopType.private static intReturns the difference indicator between two types.private static intdiffContainer(Container opCont, Container paramCont) Returns the difference of container types in terms of assignable types.(package private) static IDecisionVariablefindAttribute(IDecisionVariable var, AbstractVariable decl, boolean byName) Finds an attribute decision variable for the given decision variable and attribute declaration.(package private) static CompoundReturns the declaring compound type.(package private) static Map<IDatatype, List<AbstractVariable>> groupQuantors(Iterator<AbstractVariable> staticIter) Turns the statically accessed variables into groups of variables belonging to the same compound.(package private) static voidrelease(EvaluationAccessor[] accessors) Releases a bunch of accessors.
-
Constructor Details
-
EvaluationUtils
EvaluationUtils()
-
-
Method Details
-
createSpaces
Creates a string ofcountspaces. (debugging)- Parameters:
count- the number of spaces- Returns:
- the string
-
release
Releases a bunch of accessors.- Parameters:
accessors- the accessors to be released
-
getDeclaringCompound
Returns the declaring compound type.- Parameters:
decl- the variable declaration to return the compound parent for- Returns:
- the compound parent or null if there is none
-
groupQuantors
Turns the statically accessed variables into groups of variables belonging to the same compound. These groups will then be bound by the same quantor (iterator).- Parameters:
staticIter- the iterator providing access to the statically accessed variables- Returns:
- a mapping of compound types to used variables forming the quantor groups
-
findAttribute
static IDecisionVariable findAttribute(IDecisionVariable var, AbstractVariable decl, boolean byName) Finds an attribute decision variable for the given decision variable and attribute declaration.- Parameters:
var- the variable to search the decision variable fordecl- the attribute declarationbyName- compare by name or by declaration- Returns:
- the attribute decision variable or null if not found
-
calculateDiff
Returns the difference of the operations in terms of different (assignable) types.- Parameters:
operation- the candidate operation for dispatchreturns- the return type of the operation to be dispatched (for checking)argTypes- the actual argument types- Returns:
- the difference,
0in case of signature equality,-1if the signature does not match the required types, a the number of assignable (not equal) types else
-
diff
Returns the difference indicator between two types.- Parameters:
opType- the operation typeparamType- the parameter type- Returns:
0in case of type equality,-1if the signature does not match the required types,1in case of assignable (not equal) types else
-
diff
Calculates the difference between the compoundtypeand its refinement hierarcy andopType.- Parameters:
type- the compound type to iterate overopType- the type to compare- Returns:
- the difference count
-
diffContainer
Returns the difference of container types in terms of assignable types.- Parameters:
opCont- the container from the operation signatureparamCont- the parameter / argument container type allowed to iterate to compare refined types- Returns:
- the difference,
-1in case of a type mismatch
-