SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Brown.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "McCallum.h"
4 #include "utils.h"
5 
6 namespace smtrat {
7 namespace cad {
8 namespace projection {
9 
10 /**
11  * Contains the implementation of Browns projection operator as specified in @cite Brown2001 after Theorem 3.1.
12  */
13 namespace brown {
14 
15 /**
16  * Implements the part of Browns projection operator from @cite Brown2001 that deals with a single polynomial `p`:
17  * \f$ \{ leading_coeff(p), discriminant(p) \} \f$
18  */
19 template<typename Poly, typename Callback>
20 void single(const Poly& p, carl::Variable variable, Callback&& cb) {
21  SMTRAT_LOG_DEBUG("smtrat.cad.projection", "Brown_single(" << p << ")");
22  returnPoly(projection::discriminant(variable, p), cb);
23  returnPoly(projection::normalize(carl::to_univariate_polynomial(p.lcoeff(), variable)), cb);
24 }
25 
26 /**
27  * Implements the part of Browns projection operator from @cite Brown2001 that deals with two polynomials `p` and `q` which is just the respective part of McCallums projection operator mccallum::paired.
28  */
29 template<typename Poly, typename Callback>
30 void paired(const Poly& p, const UPoly& q, carl::Variable variable, Callback&& cb) {
31  SMTRAT_LOG_DEBUG("smtrat.cad.projection", "Brown_paired(" << p << ", " << q << ") -> McCallum_paired");
32  mccallum::paired(p, q, variable, std::forward<Callback>(cb));
33 }
34 
35 } // namespace brown
36 } // namespace projection
37 } // namespace cad
38 } // namespace smtrat
void single(const Poly &p, carl::Variable variable, Callback &&cb)
Implements the part of Browns projection operator from that deals with a single polynomial p: .
Definition: Brown.h:20
void paired(const Poly &p, const UPoly &q, carl::Variable variable, Callback &&cb)
Implements the part of Browns projection operator from that deals with two polynomials p and q which...
Definition: Brown.h:30
void paired(const Poly &p, const UPoly &q, carl::Variable variable, Callback &&cb)
Implements the part of McCallums projection operator from that deals with two polynomials p and q: .
Definition: McCallum.h:35
void returnPoly(const Poly &p, Callback &&cb)
Definition: utils.h:95
Poly discriminant(carl::Variable variable, const Poly &p)
Computes the discriminant of a polynomial.
Definition: utils.h:63
Poly normalize(const Poly &p)
Normalizes the given Poly by removing constant and duplicate factors.
Definition: utils.h:32
carl::UnivariatePolynomial< Poly > UPoly
Definition: common.h:17
Class to create the formulas for axioms.
carl::MultivariatePolynomial< Rational > Poly
Definition: types.h:25
#define SMTRAT_LOG_DEBUG(channel, msg)
Definition: logging.h:35