18 inline void texpr1::init_from(ap_environment_t* e, ap_texpr0_t* x)
24 inline void texpr1::init_from(ap_texpr1_t* x)
30 inline texpr1::texpr1(ap_texpr1_t* x)
35 inline texpr1::texpr1(
const texpr1& x)
37 init_from(ap_texpr1_copy(
const_cast<ap_texpr1_t*
>(&x.
l)));
40 inline texpr1::texpr1(
const builder& x)
42 init_from(ap_texpr1_copy(
const_cast<ap_texpr1_t*
>(x.get_ap_texpr1_t())));
47 init_from(ap_texpr1_copy(
const_cast<ap_texpr1_t*
>(x.
get_ap_texpr1_t())));
54 if (!ll)
throw(std::invalid_argument(
"apron::texpr1::texpr1(const environment&, const var&) variable not in environment"));
79 init_from(ap_texpr1_from_linexpr1(
const_cast<ap_linexpr1_t*
>(l.
get_ap_linexpr1_t())));
85 ap_texpr1_extend_environment(
const_cast<ap_texpr1_t*
>(&x.
l),
88 throw std::invalid_argument(
"apron::texpr1::texpr1(const texpr1&, const environment&) not a super-environment");
95 ap_texpr1_substitute(
const_cast<ap_texpr1_t*
>(&x.
l),
97 const_cast<ap_texpr1_t*
>(&dst.
l));
99 throw std::invalid_argument(
"apron::texpr1::texpr1(const texpr1&, const var&, const texpr1&)");
107 inline texpr1::~texpr1()
109 ap_environment_free(l.env);
110 ap_texpr0_free(l.texpr0);
119 ap_texpr1_t* c = ap_texpr1_copy(
const_cast<ap_texpr1_t*
>(&x.
l));
120 ap_environment_free(l.env);
121 ap_texpr0_free(l.texpr0);
128 ap_texpr1_t* c = ap_texpr1_copy(
const_cast<ap_texpr1_t*
>(x.
get_ap_texpr1_t()));
129 ap_environment_free(l.env);
130 ap_texpr0_free(l.texpr0);
137 ap_texpr1_t* c = ap_texpr1_copy(
const_cast<ap_texpr1_t*
>(x.
get_ap_texpr1_t()));
138 ap_environment_free(l.env);
139 ap_texpr0_free(l.texpr0);
146 ap_environment_free(l.env);
147 ap_texpr0_free(l.texpr0);
148 init_from(ap_texpr1_from_linexpr1(
const_cast<ap_linexpr1_t*
>(x.
get_ap_linexpr1_t())));
159 inline std::ostream&
operator<< (std::ostream& os,
const texpr1& s)
161 return os << s.root();
164 inline void texpr1::print(FILE* stream)
const
166 root().print(stream);
177 ap_texpr1_extend_environment_with(&l,
180 throw std::invalid_argument(
"apron::texpr1::extend_environment(const environment&) not a super-environment");
189 return root().get_environment();
194 return root().get_texpr0();
199 return root().get_texpr0();
204 return root().equal(x);
207 inline size_t texpr1::depth()
const
209 return root().depth();
212 inline bool texpr1::is_zero()
const
214 return root().is_zero();
217 inline size_t texpr1::size()
const
219 return root().size();
222 inline bool texpr1::has_var(
const var& v)
const
224 return root().has_var(v);
227 inline bool texpr1::is_interval_cst()
const
229 return root().is_interval_cst();
232 inline bool texpr1::is_interval_linear()
const
234 return root().is_interval_linear();
237 inline bool texpr1::is_interval_polynomial()
const
239 return root().is_interval_polynomial();
242 inline bool texpr1::is_interval_polyfrac()
const
244 return root().is_interval_polyfrac();
247 inline bool texpr1::is_scalar()
const
249 return root().is_scalar();
259 ap_texpr1_substitute_with(
const_cast<ap_texpr1_t*
>(&l),
261 const_cast<ap_texpr1_t*
>(&dst.
l));
263 throw std::invalid_argument(
"apron::texpr1::substitute(const var&, const texpr1&)");
271 inline ap_texpr1_t* texpr1::get_ap_texpr1_t()
276 inline const ap_texpr1_t* texpr1::get_ap_texpr1_t()
const
300 inline texpr1::const_iterator::const_iterator(ap_texpr0_t* ll, ap_environment_t* ee)
306 inline texpr1::const_iterator::const_iterator(ap_texpr1_t* l)
324 return ap_environment_copy(
l.env);
334 return l.texpr0->discr;
339 if (
l.texpr0->discr!=AP_TEXPR_CST)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::get_coeff()"));
340 return reinterpret_cast<coeff&
>(
l.texpr0->val.cst);
345 if (
l.texpr0->discr!=AP_TEXPR_DIM)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::get_var()"));
346 return *
reinterpret_cast<var*
>(&
l.env->var_of_dim[
l.texpr0->val.dim]);
351 if (
l.texpr0->discr!=AP_TEXPR_DIM)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::get_dim()"));
352 return l.texpr0->val.dim;
357 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::get_op()"));
358 return l.texpr0->val.node->op;
363 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::get_type()"));
364 return l.texpr0->val.node->type;
369 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::get_dir()"));
370 return l.texpr0->val.node->dir;
385 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::child()"));
386 if (!
l.texpr0->val.node->exprA)
throw(std::out_of_range(
"apron::texpr1::const_iterator::child()"));
392 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::left()"));
393 if (!
l.texpr0->val.node->exprA)
throw(std::out_of_range(
"apron::texpr1::const_iterator::left()"));
399 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::const_iterator::right()"));
400 if (!
l.texpr0->val.node->exprB)
throw(std::out_of_range(
"apron::texpr1::const_iterator::right()"));
410 inline std::ostream&
operator<< (std::ostream& os,
const texpr1::const_iterator& s)
412 ap_texpr1_t* x =
const_cast<ap_texpr1_t*
>(s.get_ap_texpr1_t());
419 ap_texpr1_fprint(stream,
const_cast<ap_texpr1_t*
>(&
l));
428 return ap_texpr1_equal(
const_cast<ap_texpr1_t*
>(&
l),
434 return ap_texpr0_depth(
const_cast<ap_texpr0_t*
>(
l.texpr0));
439 return l.texpr0->discr==AP_TEXPR_CST && ap_coeff_zero(&
const_cast<ap_texpr0_t*
>(
l.texpr0)->val.cst);
444 return ap_texpr0_size(
const_cast<ap_texpr0_t*
>(
l.texpr0));
449 return ap_texpr1_has_var(
const_cast<ap_texpr1_t*
>(&
l),
455 return ap_texpr1_is_interval_cst(
const_cast<ap_texpr1_t*
>(&
l));
460 return ap_texpr1_is_interval_linear(
const_cast<ap_texpr1_t*
>(&
l));
465 return ap_texpr1_is_interval_polynomial(
const_cast<ap_texpr1_t*
>(&
l));
470 return ap_texpr1_is_interval_polyfrac(
const_cast<ap_texpr1_t*
>(&
l));
475 return ap_texpr1_is_scalar(
const_cast<ap_texpr1_t*
>(&
l));
526 ap_texpr0_clear(
l.texpr0);
544 if (
l.texpr0->discr!=AP_TEXPR_CST)
throw(
bad_discriminant(
"apron::texpr1::iterator::get_coeff()"));
545 return reinterpret_cast<coeff&
>(
l.texpr0->val.cst);
550 if (
l.texpr0->discr!=AP_TEXPR_DIM)
throw(
bad_discriminant(
"apron::texpr1::iterator::set_var(const var&)"));
551 ap_dim_t d = ap_environment_dim_of_var(
l.env, v.
get_ap_var_t());
552 if (d==AP_DIM_MAX)
throw(std::invalid_argument(
"apron::texpr1::iterator::set_var(const var&) variable not in environment"));
553 l.texpr0->val.dim = d;
558 if (
l.texpr0->discr!=AP_TEXPR_DIM)
throw(
bad_discriminant(
"apron::texpr1::iterator::get_dim()"));
559 return l.texpr0->val.dim;
564 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::iterator::get_op()"));
565 return l.texpr0->val.node->op;
570 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::iterator::get_type()"));
571 return l.texpr0->val.node->type;
576 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::iterator::get_dir()"));
577 return l.texpr0->val.node->dir;
592 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::iterator::child()"));
593 if (!
l.texpr0->val.node->exprA)
throw(std::out_of_range(
"apron::texpr1::iterator::child()"));
594 return iterator(
l.texpr0->val.node->exprA,
l.env);
599 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::iterator::left()"));
600 if (!
l.texpr0->val.node->exprA)
throw(std::out_of_range(
"apron::texpr1::iterator::left()"));
601 return iterator(
l.texpr0->val.node->exprA,
l.env);
606 if (
l.texpr0->discr!=AP_TEXPR_NODE)
throw(
bad_discriminant(
"apron::texpr1::iterator::right()"));
607 if (!
l.texpr0->val.node->exprB)
throw(std::out_of_range(
"apron::texpr1::iterator::right()"));
608 return iterator(
l.texpr0->val.node->exprB,
l.env);
633 switch (x->texpr0->discr) {
634 case AP_TEXPR_DIM:
l.texpr0 = ap_texpr0_dim(x->texpr0->val.dim);
break;
635 case AP_TEXPR_CST:
l.texpr0 = ap_texpr0_cst(
const_cast<ap_coeff_t*
>(&x->texpr0->val.cst));
break;
637 l.texpr0 = ap_texpr0_node(x->texpr0->val.node->op,
638 x->texpr0->val.node->type, x->texpr0->val.node->dir,
639 x->texpr0->val.node->exprA, x->texpr0->val.node->exprB);
641 default:
throw std::invalid_argument(
"apron::texpr1::builder::init_from(ap_texpr1_t*) invalid discriminant");
700 l.texpr0 = ap_texpr0_cst_scalar(
const_cast<ap_scalar_t*
>(x.
get_ap_scalar_t()));
706 l.texpr0 = ap_texpr0_cst_scalar_mpq(
const_cast<mpq_class&
>(x).get_mpq_t());
712 l.texpr0 = ap_texpr0_cst_scalar_mpfr(x);
718 l.texpr0 = ap_texpr0_cst_scalar_int(x);
724 l.texpr0 = ap_texpr0_cst_scalar_int(x);
730 l.texpr0 = ap_texpr0_cst_scalar_double(x);
736 l.texpr0 = ap_texpr0_cst_scalar_frac(x.
num, x.
den);
748 l.texpr0 = ap_texpr0_cst_interval_scalar(
const_cast<ap_scalar_t*
>(inf.
get_ap_scalar_t()),
755 l.texpr0 = ap_texpr0_cst_interval_mpq(
const_cast<mpq_class&
>(inf).get_mpq_t(),
756 const_cast<mpq_class&
>(sup).get_mpq_t());
762 l.texpr0 = ap_texpr0_cst_interval_mpfr(inf,sup);
768 l.texpr0 = ap_texpr0_cst_interval_int(inf, sup);
774 l.texpr0 = ap_texpr0_cst_interval_int(inf, sup);
780 l.texpr0 = ap_texpr0_cst_interval_double(inf, sup);
786 l.texpr0 = ap_texpr0_cst_interval_frac(inf.
num, inf.
den, sup.
num, sup.
den);
792 l.texpr0 = ap_texpr0_cst_interval_top();
798 ap_dim_t d = ap_environment_dim_of_var(
l.env, v.
get_ap_var_t());
800 throw std::invalid_argument(
"texpr1::builder::builder(const environment&, const var&) variable not in environment");
801 l.texpr0 = ap_texpr0_dim(d);
806 if (!ap_texpr_is_unop(op))
807 throw std::invalid_argument(
"apron::texpr1::builder::builder(ap_texpr_op_t, const builder&, ap_texpr_rtype_t, ap_texpr_rdir_t) not a unary operator");
809 l.texpr0 = ap_texpr0_unop(op,
810 const_cast<ap_texpr0_t*
>(argA.
l.texpr0),
816 if (!ap_texpr_is_binop(op))
817 throw std::invalid_argument(
"apron::texpr1::builder::builder(ap_texpr_op_t, const builder&, const builder&, ap_texpr_rtype_t, ap_texpr_rdir_t) not a binary operator");
819 l.texpr0 = ap_texpr0_binop(op,
820 const_cast<ap_texpr0_t*
>(argA.
l.texpr0),
821 const_cast<ap_texpr0_t*
>(argB.
l.texpr0),
828 inline texpr1::builder
unary(ap_texpr_op_t op,
const texpr1::builder& a,
829 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
830 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
832 return texpr1::builder(op, a, rtype, rdir);
835 inline texpr1::builder
binary(ap_texpr_op_t op,
const texpr1::builder& a,
const texpr1::builder& b,
836 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
837 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
839 return texpr1::builder(op, a, b, rtype, rdir);
843 inline texpr1::builder
add(
const texpr1::builder& a,
const texpr1::builder& b,
844 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
845 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
847 return texpr1::builder(AP_TEXPR_ADD, a, b, rtype, rdir);
850 inline texpr1::builder
sub(
const texpr1::builder& a,
const texpr1::builder& b,
851 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
852 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
854 return texpr1::builder(AP_TEXPR_SUB, a, b, rtype, rdir);
857 inline texpr1::builder
mul(
const texpr1::builder& a,
const texpr1::builder& b,
858 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
859 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
861 return texpr1::builder(AP_TEXPR_MUL, a, b, rtype, rdir);
864 inline texpr1::builder
div(
const texpr1::builder& a,
const texpr1::builder& b,
865 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
866 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
868 return texpr1::builder(AP_TEXPR_DIV, a, b, rtype, rdir);
871 inline texpr1::builder
mod(
const texpr1::builder& a,
const texpr1::builder& b,
872 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
873 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
875 return texpr1::builder(AP_TEXPR_MOD, a, b, rtype, rdir);
878 inline texpr1::builder
pow(
const texpr1::builder& a,
const texpr1::builder& b,
879 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
880 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
882 return texpr1::builder(AP_TEXPR_POW, a, b, rtype, rdir);
885 inline texpr1::builder
neg(
const texpr1::builder& a,
886 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
887 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
889 return texpr1::builder(AP_TEXPR_NEG, a, rtype, rdir);
892 inline texpr1::builder
cast(
const texpr1::builder& a, ap_texpr_rtype_t rtype,
893 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
895 return texpr1::builder(AP_TEXPR_CAST, a, rtype, rdir);
898 inline texpr1::builder
floor(
const texpr1::builder& a)
900 return texpr1::builder(AP_TEXPR_CAST, a, AP_RTYPE_INT, AP_RDIR_DOWN);
903 inline texpr1::builder
ceil(
const texpr1::builder& a)
905 return texpr1::builder(AP_TEXPR_CAST, a, AP_RTYPE_INT, AP_RDIR_UP);
908 inline texpr1::builder
trunc(
const texpr1::builder& a)
910 return texpr1::builder(AP_TEXPR_CAST, a, AP_RTYPE_INT, AP_RDIR_ZERO);
913 inline texpr1::builder
sqrt(
const texpr1::builder& a,
914 ap_texpr_rtype_t rtype = AP_RTYPE_REAL,
915 ap_texpr_rdir_t rdir = AP_RDIR_NEAREST)
917 return texpr1::builder(AP_TEXPR_SQRT, a, rtype, rdir);
920 inline texpr1::builder
operator+(
const texpr1::builder& a)
925 inline texpr1::builder
operator-(
const texpr1::builder& a)
930 inline texpr1::builder
operator+(
const texpr1::builder& a,
const texpr1::builder& b)
935 inline texpr1::builder
operator-(
const texpr1::builder& a,
const texpr1::builder& b)
940 inline texpr1::builder
operator*(
const texpr1::builder& a,
const texpr1::builder& b)
945 inline texpr1::builder
operator/(
const texpr1::builder& a,
const texpr1::builder& b)
950 inline texpr1::builder
operator%(
const texpr1::builder& a,
const texpr1::builder& b)
955 inline texpr1::builder
operator^(
const texpr1::builder& a,
const texpr1::builder& b)
966 return l.texpr0->discr==AP_TEXPR_CST && ap_coeff_zero(
const_cast<ap_coeff_t*
>(&
l.texpr0->val.cst));
975 switch(
l.texpr0->discr){
976 case AP_TEXPR_CST: ap_coeff_clear(&
l.texpr0->val.cst);
break;
977 case AP_TEXPR_DIM:
break;
978 case AP_TEXPR_NODE: free(
l.texpr0->val.node);
break;
979 default: assert(
false);
abstract0 & substitute(manager &m, abstract0 &dst, const abstract0 &src, ap_dim_t dim, const linexpr0 &l, const abstract0 &inter=abstract0::null)
Definition: apxx_abstract0_inline.hh:859
bool equal(const linexpr0 &x, const linexpr0 &y)
Definition: apxx_linexpr0_inline.hh:293
std::ostream & operator<<(std::ostream &os, const texpr1 &s)
Definition: apxx_texpr1_inline.hh:159
texpr1::builder operator+(const texpr1::builder &a)
Definition: apxx_texpr1_inline.hh:920
texpr1::builder operator^(const texpr1::builder &a, const texpr1::builder &b)
Definition: apxx_texpr1_inline.hh:955
texpr1::builder operator%(const texpr1::builder &a, const texpr1::builder &b)
Definition: apxx_texpr1_inline.hh:950
texpr1::builder trunc(const texpr1::builder &a)
Definition: apxx_texpr1_inline.hh:908
texpr1::builder unary(ap_texpr_op_t op, const texpr1::builder &a, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:828
texpr1::builder cast(const texpr1::builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:892
texpr1::builder div(const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:864
texpr1::builder neg(const texpr1::builder &a, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:885
texpr1::builder operator/(const texpr1::builder &a, const texpr1::builder &b)
Definition: apxx_texpr1_inline.hh:945
texpr1::builder sqrt(const texpr1::builder &a, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:913
texpr1::builder operator-(const texpr1::builder &a)
Definition: apxx_texpr1_inline.hh:925
texpr1::builder add(const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:843
texpr1::builder operator*(const texpr1::builder &a, const texpr1::builder &b)
Definition: apxx_texpr1_inline.hh:940
texpr1::builder mul(const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:857
texpr1::builder ceil(const texpr1::builder &a)
Definition: apxx_texpr1_inline.hh:903
texpr1::builder floor(const texpr1::builder &a)
Definition: apxx_texpr1_inline.hh:898
texpr1::builder mod(const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:871
texpr1::builder binary(ap_texpr_op_t op, const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:835
void apxx_texpr0_env_ostream(std::ostream &os, ap_environment_t *env, ap_texpr0_t *a)
texpr1::builder pow(const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:878
texpr1::builder sub(const texpr1::builder &a, const texpr1::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr1_inline.hh:850
Exception raised when an operation is incompatible with a discriminant.
Definition: apxx_scalar.hh:55
Coefficient (ap_coeff_t wrapper).
Definition: apxx_coeff.hh:36
const ap_coeff_t * get_ap_coeff_t() const
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_coeff_inline.hh:483
Level 1 environment (ap_environment_t wrapper).
Definition: apxx_environment.hh:51
const ap_environment_t * get_ap_environment_t() const
Returns a pointer to the internal APRON object pointed by *this.
Definition: apxx_environment_inline.hh:425
Interval (ap_interval_t wrapper).
Definition: apxx_interval.hh:47
const ap_interval_t * get_ap_interval_t() const
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_interval_inline.hh:336
Level 1 linear expression (ap_linexpr1_t wrapper).
Definition: apxx_linexpr1.hh:39
const ap_linexpr1_t * get_ap_linexpr1_t() const
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_linexpr1_inline.hh:321
Scalar (ap_scalar_t wrapper).
Definition: apxx_scalar.hh:89
const ap_scalar_t * get_ap_scalar_t() const
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_scalar_inline.hh:449
Temporary expression nodes used when constructing a texpr0.
Definition: apxx_texpr0.hh:581
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr0_inline.hh:912
Iterators to traverse a constant expression tree.
Definition: apxx_texpr0.hh:211
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr0_inline.hh:494
Iterators to traverse and mutate an expression tree.
Definition: apxx_texpr0.hh:413
Level 0 arbitrary expression tree (ap_texpr0_t wrapper).
Definition: apxx_texpr0.hh:92
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr0_inline.hh:293
Temporary expression nodes used when constructing a texpr1.
Definition: apxx_texpr1.hh:561
builder(ap_texpr1_t *x)
Internal use only: makes a shallow copy, copying only the root node and referencing the environment.
Definition: apxx_texpr1_inline.hh:653
void init_from(ap_texpr1_t *x)
Internal use only: makes a shallow copy, copying only the root node and referencing the environment.
Definition: apxx_texpr1_inline.hh:630
~builder()
Frees the memory occupied by the node, not its sub-expressions.
Definition: apxx_texpr1_inline.hh:973
ap_texpr1_t l
Definition: apxx_texpr1.hh:567
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition: apxx_texpr1_inline.hh:964
ap_texpr1_t * get_ap_texpr1_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr1_inline.hh:988
Iterators to traverse a constant expression tree.
Definition: apxx_texpr1.hh:183
const coeff & get_coeff() const
Returns a reference to the coefficient of a constant node.
Definition: apxx_texpr1_inline.hh:337
const_iterator right() const
Constructs a const_iterator to the right sub-expression argument of a binary operator node.
Definition: apxx_texpr1_inline.hh:397
ap_texpr_rdir_t get_rdir() const
Returns the rounding direction of an operator node.
Definition: apxx_texpr1_inline.hh:367
ap_texpr_op_t get_op() const
Returns the operator kind of an operator node.
Definition: apxx_texpr1_inline.hh:355
const_iterator left() const
Constructs a const_iterator to the only of left sub-expression of an operator node.
Definition: apxx_texpr1_inline.hh:390
bool is_scalar() const
Whether all occurring constants are scalar.
Definition: apxx_texpr1_inline.hh:473
bool is_interval_linear() const
Whether the expression is linear and there is no rounding.
Definition: apxx_texpr1_inline.hh:458
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition: apxx_texpr1_inline.hh:437
const_iterator(ap_texpr1_t *l)
Internal use only.
Definition: apxx_texpr1_inline.hh:306
bool has_var(const var &v) const
Whether the given variable name occurs in the expression.
Definition: apxx_texpr1_inline.hh:447
bool equal(const texpr1 &x) const
Whether two expressions are syntactically, structurally equal.
Definition: apxx_texpr1_inline.hh:426
const_iterator & operator=(const const_iterator &i)
Resets the const_iterator at position i.
Definition: apxx_texpr1_inline.hh:377
ap_dim_t get_dim() const
Returns the dimension of a dimension node.
Definition: apxx_texpr1_inline.hh:349
ap_texpr1_t * get_ap_texpr1_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr1_inline.hh:482
texpr0::const_iterator get_texpr0() const
Returns a constant iterator at the root of the underlying texpr0.
Definition: apxx_texpr1_inline.hh:327
const var & get_var() const
Returns a (unmodifiable) reference to the variable name of a dimension node.
Definition: apxx_texpr1_inline.hh:343
void print(FILE *stream=stdout) const
Prints to a C stream.
Definition: apxx_texpr1_inline.hh:417
ap_texpr1_t l
Definition: apxx_texpr1.hh:187
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition: apxx_texpr1_inline.hh:453
size_t size() const
Returns the number of operator nodes in the expression tree.
Definition: apxx_texpr1_inline.hh:442
ap_texpr_discr_t get_discr() const
Returns the node kind.
Definition: apxx_texpr1_inline.hh:332
environment get_environment() const
Returns (a copy of) the environment associated with the expression.
Definition: apxx_texpr1_inline.hh:322
bool is_interval_polynomial() const
Whether the expression is polynomial and there is no rounding.
Definition: apxx_texpr1_inline.hh:463
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition: apxx_texpr1_inline.hh:432
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition: apxx_texpr1_inline.hh:468
const_iterator child() const
Constructs a const_iterator to the only or left sub-expression of an operator node.
Definition: apxx_texpr1_inline.hh:383
ap_texpr_rtype_t get_rtype() const
Returns the destination type of an operator node.
Definition: apxx_texpr1_inline.hh:361
Iterators to traverse and mutate an expression tree.
Definition: apxx_texpr1.hh:386
iterator child() const
Constructs an iterator to the only or left sub-expression of an operator node.
Definition: apxx_texpr1_inline.hh:590
iterator right() const
Constructs an iterator to the right sub-expression argument of a binary operator node.
Definition: apxx_texpr1_inline.hh:604
texpr0::iterator get_texpr0() const
Returns an iterator at the root of the underlying texpr0.
Definition: apxx_texpr1_inline.hh:536
iterator(ap_texpr1_t *l)
Internal use only.
Definition: apxx_texpr1_inline.hh:505
iterator left() const
Constructs an iterator to the only of left sub-expression of an operator node.
Definition: apxx_texpr1_inline.hh:597
coeff & get_coeff() const
Returns a (modifiable) reference to the coefficient of a constant node.
Definition: apxx_texpr1_inline.hh:542
ap_dim_t & get_dim() const
Returns a (modifiable) reference to the dimension of a dimension node.
Definition: apxx_texpr1_inline.hh:556
ap_texpr_rtype_t & get_rtype() const
Returns a (modifiable) reference to the destination type of an operator node.
Definition: apxx_texpr1_inline.hh:568
iterator & operator=(const builder &x)
Replace the sub-expression at the iterator position with a (deep) copy of c.
ap_texpr1_t * get_ap_texpr1_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr1_inline.hh:615
ap_texpr_op_t & get_op() const
Returns a (modifiable) reference to the operator kind of an operator node.
Definition: apxx_texpr1_inline.hh:562
void set_var(const var &v) const
Sets the variable name of a dimension node.
Definition: apxx_texpr1_inline.hh:548
ap_texpr_rdir_t & get_rdir() const
Returns a (modifiable) reference to the rounding direction of an operator node.
Definition: apxx_texpr1_inline.hh:574
Level 1 arbitrary expression tree (ap_texpr1_t wrapper).
Definition: apxx_texpr1.hh:42
friend std::ostream & operator<<(std::ostream &os, const texpr1 &s)
Printing.
const_iterator root() const
Returns a new iterator at the root of a constant expression tree.
Definition: apxx_texpr1_inline.hh:295
void init_from(ap_environment_t *e, ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition: apxx_texpr1_inline.hh:18
ap_texpr1_t l
Structure managed by APRON.
Definition: apxx_texpr1.hh:46
ap_texpr1_t * get_ap_texpr1_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr1_inline.hh:271
Variable name (ap_var_t wrapper).
Definition: apxx_var.hh:39
const ap_var_t & get_ap_var_t() const
Returns a reference to the APRON object wrapped (no copy).
Definition: apxx_var_inline.hh:156
A fraction with native int coefficients, to simplify initialisations and assignments.
Definition: apxx_scalar.hh:41
unsigned long den
Denominator.
Definition: apxx_scalar.hh:44
long num
Numerator.
Definition: apxx_scalar.hh:43
Full interval (]-oo,+oo[) or domain, to simplify initialisations and assignments.
Definition: apxx_interval.hh:27