SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Lazard.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 Lazards projection operator as specified in @cite Lauard1994.
12  */
13 namespace lazard {
14 
15 /**
16  * Implements the part of Lazards projection operator from @cite Lazard1994 that deals with a single polynomial `p`:
17  * \f$ \{ leading_coeff(p), trailing_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", "Lazard_single(" << p << ")");
22  returnPoly(projection::discriminant(variable, p), cb);
23  returnPoly(projection::normalize(carl::to_univariate_polynomial(p.lcoeff(), variable)), cb);
24  returnPoly(projection::normalize(carl::to_univariate_polynomial(p.tcoeff(), variable)), cb);
25 }
26 
27 /**
28  * Implements the part of Lazard projection operator from @cite Lazard1994 that deals with two polynomials `p` and `q` which is just the respective part of McCallums projection operator mccallum::paired.
29  */
30 template<typename Poly, typename Callback>
31 void paired(const Poly& p, const UPoly& q, carl::Variable variable, Callback&& cb) {
32  SMTRAT_LOG_DEBUG("smtrat.cad.projection", "Lazard_paired(" << p << ", " << q << ") -> McCallum_paired");
33  mccallum::paired(p, q, variable, std::forward<Callback>(cb));
34 }
35 
36 } // namespace lazard
37 } // namespace projection
38 } // namespace cad
39 } // namespace smtrat
void paired(const Poly &p, const UPoly &q, carl::Variable variable, Callback &&cb)
Implements the part of Lazard projection operator from that deals with two polynomials p and q which...
Definition: Lazard.h:31
void single(const Poly &p, carl::Variable variable, Callback &&cb)
Implements the part of Lazards projection operator from that deals with a single polynomial p: .
Definition: Lazard.h:20
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