Remove Constant class

Constants are not a construct present in Clingo’s AST and were
unintentionally made part of anthem’s AST. This removes the unused
classes for clarity.
This commit is contained in:
2018-04-19 15:36:57 +02:00
parent 165f6ac059
commit b5b05b766c
10 changed files with 0 additions and 76 deletions

View File

@@ -103,13 +103,6 @@ Comparison prepareCopy(const Comparison &other)
////////////////////////////////////////////////////////////////////////////////////////////////////
Constant prepareCopy(const Constant &other)
{
return Constant(std::string(other.name));
}
////////////////////////////////////////////////////////////////////////////////////////////////////
Function prepareCopy(const Function &other)
{
return Function(std::string(other.name), prepareCopy(other.arguments));
@@ -293,11 +286,6 @@ struct FixDanglingVariablesInTermVisitor
{
}
template <class... Arguments>
void visit(Constant &, Arguments &&...)
{
}
template <class... Arguments>
void visit(Function &function, Arguments &&... arguments)
{

View File

@@ -150,10 +150,6 @@ struct CollectFreeVariablesVisitor
binaryOperation.right.accept(*this, variableStack, freeVariables);
}
void visit(Constant &, VariableStack &, std::vector<VariableDeclaration *> &)
{
}
void visit(Function &function, VariableStack &variableStack, std::vector<VariableDeclaration *> &freeVariables)
{
for (auto &argument : function.arguments)

View File

@@ -49,14 +49,6 @@ struct TermDomainVisitor
return ast::VariableDeclaration::Domain::General;
}
static ast::VariableDeclaration::Domain visit(ast::Constant &)
{
// Constants may be set to values of any type
// TODO: implement explicit integer specifications
return ast::VariableDeclaration::Domain::General;
}
static ast::VariableDeclaration::Domain visit(ast::Function &)
{
// Functions may return values of any type