6 #define BOOST_SPIRIT_USE_PHOENIX_V3
7 #include <boost/spirit/include/qi.hpp>
14 std::vector<FormulaT> args;
15 if (!
convert(arguments, args))
return false;
22 for (
size_t i = prev_idx+1; i < set.size(); i++) {
23 working.push_back(set[i].negated());
24 if (working.size() == k+1) {
33 if (k >= set.size()) {
34 return FormulaT(carl::FormulaType::TRUE);
45 if (arguments.size() == 0) {
46 errors.
next() <<
"The operator \"at-most\" expects at least one argument.";
49 if (indices.size() != 1) {
50 errors.
next() <<
"The operator \"at-most\" expects exactly one index.";
carl::mpl_variant_of< TermTypes >::type TermType
Variant type for all terms.
FormulaT at_most_k(size_t k, const std::vector< FormulaT > &set)
void at_most_k_helper(size_t k, const std::vector< FormulaT > &set, FormulasT &working, long long int prev_idx, FormulasT &results)
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::Formulas< Poly > FormulasT
Base class for all theories.
bool apply(const std::vector< std::size_t > &indices, const std::vector< FormulaT > &arguments, types::TermType &result, TheoryError &errors) const
BooleanEncodingTheory(ParserState *state)
virtual bool apply(const std::vector< std::size_t > &indices, const std::vector< FormulaT > &arguments, types::TermType &result, TheoryError &errors) const =0
bool operator()(const std::vector< std::size_t > &indices, const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors) const
bool convert(const std::vector< types::TermType > &from, std::vector< T > &to) const
void registerFunction(const std::string &name, const FunctionInstantiator *fi)