Compare commits
2 Commits
v0.1.9-rc.
...
v0.1.9-rc.
Author | SHA1 | Date | |
---|---|---|---|
934dceac6e
|
|||
4a57a9e502
|
@@ -1,6 +1,6 @@
|
||||
# Change Log
|
||||
|
||||
## 0.1.9 RC 3 (2018-04-22)
|
||||
## 0.1.9 RC 4 (2018-04-22)
|
||||
|
||||
### Features
|
||||
|
||||
|
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (version)
|
||||
{
|
||||
std::cout << "anthem version 0.1.9-rc.3" << std::endl;
|
||||
std::cout << "anthem version 0.1.8-rc.4" << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
};
|
||||
@@ -322,22 +323,6 @@ inline output::ColorStream &print(output::ColorStream &stream, const Variable &v
|
||||
|
||||
inline output::ColorStream &print(output::ColorStream &stream, const VariableDeclaration &variableDeclaration, PrintContext &printContext, bool)
|
||||
{
|
||||
const auto domainSuffix =
|
||||
[&variableDeclaration]()
|
||||
{
|
||||
switch (variableDeclaration.domain)
|
||||
{
|
||||
case Domain::Unknown:
|
||||
return "";
|
||||
case Domain::Noninteger:
|
||||
return "n";
|
||||
case Domain::Integer:
|
||||
return "i";
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
const auto printVariableDeclaration =
|
||||
[&](const auto *prefix, auto &variableIDs) -> output::ColorStream &
|
||||
{
|
||||
@@ -350,11 +335,14 @@ inline output::ColorStream &print(output::ColorStream &stream, const VariableDec
|
||||
matchingVariableID = emplaceResult.first;
|
||||
}
|
||||
|
||||
const auto variableName = std::string(prefix) + std::to_string(matchingVariableID->second) + domainSuffix();
|
||||
const auto variableName = std::string(prefix) + std::to_string(matchingVariableID->second);
|
||||
|
||||
return (stream << output::Variable(variableName.c_str()));
|
||||
};
|
||||
|
||||
if (variableDeclaration.domain == Domain::Integer)
|
||||
return printVariableDeclaration(IntegerVariablePrefix, printContext.integerVariableIDs);
|
||||
|
||||
switch (variableDeclaration.type)
|
||||
{
|
||||
case VariableDeclaration::Type::UserDefined:
|
||||
|
Reference in New Issue
Block a user