Indexing variables from 1 on and not 0.
This commit is contained in:
parent
de34d05898
commit
223d380a03
@ -19,7 +19,7 @@ struct Context
|
|||||||
output::Logger logger;
|
output::Logger logger;
|
||||||
|
|
||||||
std::vector<const Clingo::AST::Term *> headTerms;
|
std::vector<const Clingo::AST::Term *> headTerms;
|
||||||
size_t auxiliaryBodyLiteralID = 0;
|
size_t auxiliaryBodyLiteralID = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -175,7 +175,7 @@ struct TermPrintSubstitutedVisitor
|
|||||||
|
|
||||||
assert(matchingTerm != context.headTerms.cend());
|
assert(matchingTerm != context.headTerms.cend());
|
||||||
|
|
||||||
const auto variableName = std::string(AuxiliaryHeadVariablePrefix) + std::to_string(matchingTerm - context.headTerms.cbegin());
|
const auto variableName = std::string(AuxiliaryHeadVariablePrefix) + std::to_string(matchingTerm - context.headTerms.cbegin() + 1);
|
||||||
|
|
||||||
outputStream << output::Variable(variableName.c_str());
|
outputStream << output::Variable(variableName.c_str());
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ struct StatementVisitor
|
|||||||
if (i != context.headTerms.cbegin())
|
if (i != context.headTerms.cbegin())
|
||||||
outputStream << ", ";
|
outputStream << ", ";
|
||||||
|
|
||||||
const auto variableName = std::string(AuxiliaryHeadVariablePrefix) + std::to_string(i - context.headTerms.cbegin());
|
const auto variableName = std::string(AuxiliaryHeadVariablePrefix) + std::to_string(i - context.headTerms.cbegin() + 1);
|
||||||
|
|
||||||
outputStream
|
outputStream
|
||||||
<< output::Variable(variableName.c_str())
|
<< output::Variable(variableName.c_str())
|
||||||
|
Loading…
Reference in New Issue
Block a user