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 java.lang.Object implements VariableValueCopier.IFreezeProvider, IFreezeSelector
A freeze provider based on known frozen assignment states.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private IDecisionVariablesourceprivate IDecisionVariabletarget
-
Constructor Summary
Constructors Modifier Constructor Description privateSourceBasedFreezeProvider(IDecisionVariable source, IDecisionVariable target)Creates a freeze provider based on a given variable pair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstraintSyntaxTreecreateButExpression(DecisionVariableDeclaration freezeIter)Creates the freeze-but expression.private IDecisionVariablefindCorrespondence(IDecisionVariable tVar)java.lang.StringgetFreezeVariableName()The name of the freeze variable.IFreezeSelectorgetSelector()Returns a freeze selector to use.booleanshallFreeze(IDecisionVariable variable)Returns whethervariableshall be frozen.
-
-
-
Field Detail
-
source
private IDecisionVariable source
-
target
private IDecisionVariable target
-
-
Constructor Detail
-
SourceBasedFreezeProvider
private SourceBasedFreezeProvider(IDecisionVariable source, IDecisionVariable target)
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 Detail
-
getFreezeVariableName
public java.lang.String 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
public IFreezeSelector 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
public boolean shallFreeze(IDecisionVariable variable)
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
private IDecisionVariable findCorrespondence(IDecisionVariable tVar)
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.
-
-