Prefix integer variables with “N”
This prefixes integer variables with “N” to distinguish them from general variables in the output in analogy to common mathematical notations.
This commit is contained in:
parent
b60c65a810
commit
a2c4d87852
@ -13,6 +13,7 @@ namespace anthem
|
||||
constexpr const auto HeadVariablePrefix = "V";
|
||||
constexpr const auto BodyVariablePrefix = "X";
|
||||
constexpr const auto UserVariablePrefix = "U";
|
||||
constexpr const auto IntegerVariablePrefix = "N";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -35,6 +35,7 @@ struct PrintContext
|
||||
std::map<const VariableDeclaration *, size_t> userVariableIDs;
|
||||
std::map<const VariableDeclaration *, size_t> headVariableIDs;
|
||||
std::map<const VariableDeclaration *, size_t> bodyVariableIDs;
|
||||
std::map<const VariableDeclaration *, size_t> integerVariableIDs;
|
||||
|
||||
const Context &context;
|
||||
};
|
||||
@ -339,6 +340,9 @@ inline output::ColorStream &print(output::ColorStream &stream, const VariableDec
|
||||
return (stream << output::Variable(variableName.c_str()));
|
||||
};
|
||||
|
||||
if (variableDeclaration.domain == Domain::Integer)
|
||||
return printVariableDeclaration(IntegerVariablePrefix, printContext.integerVariableIDs);
|
||||
|
||||
switch (variableDeclaration.type)
|
||||
{
|
||||
case VariableDeclaration::Type::UserDefined:
|
||||
|
Loading…
Reference in New Issue
Block a user