Class DefaultValueTranslator
java.lang.Object
net.ssehub.easy.reasoning.sseReasoner.functions.DefaultValueTranslator
Turns partial compound default values into complete values as EASy allows only one default
assignment per variable.
- Author:
- Holger Eichelberger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static net.ssehub.easy.varModel.cst.CompoundInitializercreateTranslatedCompoundInitializer(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String, net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String, net.ssehub.easy.varModel.model.AbstractVariable> decls) Creates a translated compound initializer.static net.ssehub.easy.varModel.cst.ConstraintSyntaxTreetranslateDefaultValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst) Translates a default value into its complete one-time default assignment value by including nested default values of the defining compound/container types.private static voidtranslateDefaultValues(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String, net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String, net.ssehub.easy.varModel.model.AbstractVariable> decls) Recursively translates the default values of type intovaluesanddecls, but only if the slots are not already allocated.static net.ssehub.easy.varModel.cst.ConstraintSyntaxTreetranslateDefaultValueSafe(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst) CallstranslateDefaultValue(ConstraintSyntaxTree)catching/logging exceptions.
-
Constructor Details
-
DefaultValueTranslator
public DefaultValueTranslator()
-
-
Method Details
-
translateDefaultValueSafe
public static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree translateDefaultValueSafe(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst) CallstranslateDefaultValue(ConstraintSyntaxTree)catching/logging exceptions.- Parameters:
cst- the constraint to be translated- Returns:
- the translated constraint or
cst
-
translateDefaultValue
public static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree translateDefaultValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst) throws net.ssehub.easy.varModel.cst.CSTSemanticException Translates a default value into its complete one-time default assignment value by including nested default values of the defining compound/container types.- Parameters:
cst- the constraint to be translated- Returns:
- the translated constraint or
cst - Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- if constraint expressions cannot correctly be built
-
translateDefaultValues
private static void translateDefaultValues(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String, net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String, throws net.ssehub.easy.varModel.cst.CSTSemanticExceptionnet.ssehub.easy.varModel.model.AbstractVariable> decls) Recursively translates the default values of type intovaluesanddecls, but only if the slots are not already allocated.- Parameters:
type- the type to be translatedvalues- the values, i.e., slot name to value expression mappingsdecls- the declarations, i.e., slot name to declaration mappings- Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- if constraint expressions cannot correctly be built
-
createTranslatedCompoundInitializer
private static net.ssehub.easy.varModel.cst.CompoundInitializer createTranslatedCompoundInitializer(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String, net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String, throws net.ssehub.easy.varModel.cst.CSTSemanticExceptionnet.ssehub.easy.varModel.model.AbstractVariable> decls) Creates a translated compound initializer.- Parameters:
type- the type initializer representsvalues- the values, i.e., slot name to value expression mappingsdecls- the declarations, i.e., slot name to declaration mappings- Returns:
- the created initializer
- Throws:
net.ssehub.easy.varModel.cst.CSTSemanticException- if constraint expressions cannot correctly be built
-