anthem/include/anthem/Utils.h

38 lines
964 B
C++

#ifndef __ANTHEM__UTILS_H
#define __ANTHEM__UTILS_H
#include <iostream>
#include <clingo.hh>
namespace anthem
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Utils
//
////////////////////////////////////////////////////////////////////////////////////////////////////
inline void throwErrorAtLocation(const Clingo::Location &location, const char *errorMessage)
{
std::cerr
<< location.begin_file() << ":"
<< location.begin_line() << ":" << location.begin_column()
<< ": error: "
<< errorMessage << std::endl;
throw std::runtime_error(errorMessage);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
constexpr const auto AuxiliaryHeadVariablePrefix = "AUX_H";
constexpr const auto AuxiliaryBodyVariablePrefix = "AUX_B";
////////////////////////////////////////////////////////////////////////////////////////////////////
}
#endif