Class VariableValueCopier.SourceBasedFreezeProvider
java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.VariableValueCopier.SourceBasedFreezeProvider
- All Implemented Interfaces:
IFreezeSelector,VariableValueCopier.IFreezeProvider
- Enclosing class:
VariableValueCopier
private static class VariableValueCopier.SourceBasedFreezeProvider
extends Object
implements VariableValueCopier.IFreezeProvider, IFreezeSelector
A freeze provider based on known frozen assignment states.
- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSourceBasedFreezeProvider(IDecisionVariable source, IDecisionVariable target) Creates a freeze provider based on a given variable pair. -
Method Summary
Modifier and TypeMethodDescriptioncreateButExpression(DecisionVariableDeclaration freezeIter) Creates the freeze-but expression.private IDecisionVariableThe name of the freeze variable.Returns a freeze selector to use.booleanshallFreeze(IDecisionVariable variable) Returns whethervariableshall be frozen.
-
Field Details
-
source
-
target
-
-
Constructor Details
-
SourceBasedFreezeProvider
Creates a freeze provider based on a given variable pair.- Parameters:
source- the source variable to take the states fromtarget- the target variable to identify variables to be frozen within and to search for a correspondence withinsource
-
-
Method Details
-
getFreezeVariableName
Description copied from interface:VariableValueCopier.IFreezeProviderThe name of the freeze variable.- Specified by:
getFreezeVariableNamein interfaceVariableValueCopier.IFreezeProvider- Returns:
- the name
-
createButExpression
public ConstraintSyntaxTree createButExpression(DecisionVariableDeclaration freezeIter) throws CSTSemanticException, ValueDoesNotMatchTypeException Description copied from interface:VariableValueCopier.IFreezeProviderCreates the freeze-but expression.- Specified by:
createButExpressionin interfaceVariableValueCopier.IFreezeProvider- Parameters:
freezeIter- the freeze iterator variable (of typeFreezeVariableType)- Returns:
- the but-expression
- Throws:
CSTSemanticException- in case that the but-expression was not constructed correctlyValueDoesNotMatchTypeException- in case that creating values fails
-
getSelector
Description copied from interface:VariableValueCopier.IFreezeProviderReturns a freeze selector to use.- Specified by:
getSelectorin interfaceVariableValueCopier.IFreezeProvider- Returns:
- the selector or null for none, i.e., create an internal freeze-block based on the information in this provider
-
shallFreeze
Description copied from interface:IFreezeSelectorReturns whethervariableshall be frozen.- Specified by:
shallFreezein interfaceIFreezeSelector- Parameters:
variable- the variable to be tested- Returns:
trueifvariableshall be frozen,falseelse
-
findCorrespondence
Finds the corresponding variable fortVar(assumed to be within the nesting hierarchy oftarget) within the nesting hierarchy ofsource.- Parameters:
tVar- the variable to search for- Returns:
- the corresponding variable within the nesting hierarchy of
sourceor null for none found.
-