13 auto it =
mPool.find(_poly);
14 if(it ==
mPool.end()) {
25 std::size_t nrTerms = poly.nr_terms();
31 auto lastTerm = poly.rbegin();
35 const TermT& term = poly[0];
38 if(term.is_constant()) {
39 return create(carl::to_int<Integer>(coeff));
42 const carl::Monomial::Arg monomial = term.monomial();
44 if(! carl::is_one(coeff)) {
48 auto variableAndExponent = *(monomial->begin());
50 if(monomial->num_variables() > 1) {
51 carl::Monomial::Arg head = carl::MonomialPool::getInstance().create(variableAndExponent.first, variableAndExponent.second);
52 carl::Monomial::Arg tail = monomial->drop_variable(variableAndExponent.first);
56 if(variableAndExponent.second > 1) {
57 carl::Monomial::Arg remainder = carl::MonomialPool::getInstance().create(variableAndExponent.first, variableAndExponent.second - 1);
61 return create(variableAndExponent.first);
83 auto insertion =
mPool.insert(std::make_pair(_element->
poly(), _element));
84 if(! insertion.second) {
88 return insertion.first->second;
const Poly & poly() const
std::map< Poly, PolyTreeContent * > mPool
const PolyTreeContent * create(const Poly &_pol)
const PolyTreeContent * get(const Poly &_pol)
const PolyTreeContent * add(PolyTreeContent *_element)
Class to create the formulas for axioms.
carl::Term< Rational > TermT
carl::MultivariatePolynomial< Rational > Poly
carl::IntegralType< Rational >::type Integer