16 #ifndef __APXX_TEXPR0_HH 17 #define __APXX_TEXPR0_HH 21 #include "ap_texpr0.h" 22 #include "ap_linearize.h" 274 ap_texpr_op_t
get_op()
const;
340 size_t depth()
const;
349 bool has_dim(ap_dim_t d)
const;
354 std::vector<ap_dim_t>
dimlist()
const;
387 void print(
char** name_of_dim = NULL, FILE* stream=stdout)
const;
647 builder(
const mpq_class& inf,
const mpq_class& sup);
650 builder(mpfr_t inf, mpfr_t sup);
659 builder(
double inf,
double sup);
671 builder(ap_texpr_op_t op,
const builder& argA, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
674 builder(ap_texpr_op_t op,
const builder& argA,
const builder& argB, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
728 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
746 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
750 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
754 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
758 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
762 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
766 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
770 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
774 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
790 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
839 void print(
char** name_of_dim = NULL, FILE* stream=stdout)
const;
858 size_t depth()
const;
867 bool has_dim(ap_dim_t d)
const;
872 std::vector<ap_dim_t>
dimlist()
const;
908 bool* pexact=NULL)
const;
911 bool quasilinearize=
false,
bool* pexact=NULL)
const;
void remove_dimensions(const dimchange &d)
Removes some dimensions, shifting dimension if needed.
Definition: apxx_texpr0.hh:279
const_iterator & operator=(const const_iterator &i)
Resets the const_iterator at position i.
Definition: apxx_texpr0.hh:375
ap_texpr_op_t get_op() const
Returns the operator kind of an operator node.
Definition: apxx_texpr0.hh:353
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition: apxx_texpr0.hh:435
ap_texpr0_t l
Structure managed by APRON.
Definition: apxx_texpr0.hh:96
void permute_dimensions(const dimperm &d)
Permutes dimensions.
Definition: apxx_texpr0.hh:284
Iterators to traverse and mutate an expression tree.
Definition: apxx_texpr0.hh:413
bool is_binop(ap_texpr_op_t op)
Whether the operator is binary.
Definition: apxx_texpr0.hh:38
Dimension permutation object (ap_dimperm_t wrapper).
Definition: apxx_dimension.hh:292
Dimension change object (ap_dimchange_t wrapper).
Definition: apxx_dimension.hh:102
Definition: apxx_abstract0.hh:27
iterator left() const
Constructs an iterator to the only of left sub-expression of an operator node.
Definition: apxx_texpr0.hh:592
bool has_dim(ap_dim_t d) const
Whether the given dimension occurs in the expression.
Definition: apxx_texpr0.hh:450
bool is_interval_linear() const
Whether the expression is linear and there is no rounding.
Definition: apxx_texpr0.hh:207
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition: apxx_texpr0.hh:177
ap_dim_t get_dim() const
Returns the dimension of a dimension node.
Definition: apxx_texpr0.hh:347
ap_texpr0_t * l
Definition: apxx_texpr0.hh:215
~builder()
Frees the memory occupied by the node, not its sub-expressions.
Definition: apxx_texpr0.hh:893
iterator child() const
Constructs an iterator to the only or left sub-expression of an operator node.
Definition: apxx_texpr0.hh:585
Variable name (ap_var_t wrapper).
Definition: apxx_var.hh:39
bool has_dim(ap_dim_t d) const
Whether the given dimension occurs in the expression.
Definition: apxx_texpr0.hh:192
std::vector< ap_dim_t > dimlist() const
Returns a list of all dimensions occurring in the expression (in strict increasing order)
Definition: apxx_texpr0.hh:197
ap_texpr_rdir_t & get_rdir() const
Returns a (modifiable) reference to the rounding direction of an operator node.
Definition: apxx_texpr0.hh:569
void init_from(ap_texpr0_t *x)
Internal use only: makes a shallow copy, copying only the root node.
Definition: apxx_texpr0.hh:627
friend builder operator *(const builder &a, const builder &b)
Makes a AP_TEXPR_MUL expression node using AP_RTYPE_REAL type (no rounding).
Definition: apxx_texpr0.hh:869
friend builder div(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_DIV expression node.
Definition: apxx_texpr0.hh:793
ap_texpr_rtype_t get_rtype() const
Returns the destination type of an operator node.
Definition: apxx_texpr0.hh:359
const_iterator right() const
Constructs a const_iterator to the right sub-expression argument of a binary operator node.
Definition: apxx_texpr0.hh:395
coeff & get_coeff() const
Returns a (modifiable) reference to the coefficient of a constant node.
Definition: apxx_texpr0.hh:545
ap_dim_t max_dim() const
Returns the maximal dimension occurring in the expression (or 0 if there is no variable).
Definition: apxx_texpr0.hh:187
texpr0::builder add(const texpr0::builder &a, const texpr0::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr0.hh:772
friend builder mod(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_MOD expression node.
Definition: apxx_texpr0.hh:800
friend builder operator-(const builder &a)
Makes a AP_TEXPR_NEG expression node using AP_RTYPE_REAL type (no rounding).
Definition: apxx_texpr0.hh:854
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition: apxx_texpr0.hh:424
friend builder operator^(const builder &a, const builder &b)
Makes a AP_TEXPR_POW expression node using AP_RTYPE_REAL type (no rounding).
Definition: apxx_texpr0.hh:884
Level 0 abstract value (ap_abstract0_t* wrapper).
Definition: apxx_abstract0.hh:78
const_iterator left() const
Constructs a const_iterator to the only of left sub-expression of an operator node.
Definition: apxx_texpr0.hh:388
ap_texpr_rdir_t get_rdir() const
Returns the rounding direction of an operator node.
Definition: apxx_texpr0.hh:365
ap_texpr_rtype_t & get_rtype() const
Returns a (modifiable) reference to the destination type of an operator node.
Definition: apxx_texpr0.hh:563
friend builder pow(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_POW expression node.
Definition: apxx_texpr0.hh:807
~texpr0()
Frees the memory occupied by the expression (and, recursively, all sub-expressions).
Definition: apxx_texpr0.hh:103
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition: apxx_texpr0.hh:158
friend builder mul(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_MUL expression node.
Definition: apxx_texpr0.hh:786
friend std::ostream & operator<<(std::ostream &os, const texpr0 &s)
Printing.
Definition: apxx_texpr0.hh:153
dim(ap_dim_t d)
Standard constructor.
Definition: apxx_texpr0.hh:20
bool is_unop(ap_texpr_op_t op)
Whether the operator is unary.
Definition: apxx_texpr0.hh:33
void init_from(ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition: apxx_texpr0.hh:48
Library manager (ap_manager_t wrapper).
Definition: apxx_manager.hh:137
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr0.hh:495
friend builder operator+(const builder &a)
Makes a copy of the node.
Definition: apxx_texpr0.hh:849
friend builder binary(ap_texpr_op_t op, const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes a binary expression node.
Definition: apxx_texpr0.hh:764
friend builder neg(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_NEG expression node.
Definition: apxx_texpr0.hh:814
friend builder add(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_ADD expression node.
Definition: apxx_texpr0.hh:772
friend builder trunc(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_ZERO.
Definition: apxx_texpr0.hh:837
builder & operator=(const builder &x)
Not to be used. (Temporaries are not to be re-assigned).
Definition: apxx_texpr0.hh:591
iterator right() const
Constructs an iterator to the right sub-expression argument of a binary operator node.
Definition: apxx_texpr0.hh:599
bool is_interval_linear() const
Whether the expression is linear and there is no rounding.
Definition: apxx_texpr0.hh:471
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.hh:610
Level 1 environment (ap_environment_t wrapper).
Definition: apxx_environment.hh:51
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition: apxx_texpr0.hh:167
ap_texpr0_t * l
Definition: apxx_texpr0.hh:587
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition: apxx_texpr0.hh:217
ap_dim_t d
Dimension index.
Definition: apxx_texpr0.hh:37
const_iterator child() const
Constructs a const_iterator to the only or left sub-expression of an operator node.
Definition: apxx_texpr0.hh:381
ap_texpr_op_t & get_op() const
Returns a (modifiable) reference to the operator kind of an operator node.
Definition: apxx_texpr0.hh:557
const_iterator(ap_texpr0_t *l)
Internal use only.
Definition: apxx_texpr0.hh:321
iterator & operator=(const builder &c)
Replace the sub-expression at the iterator position with a (deep) copy of c.
Definition: apxx_texpr0.hh:532
bool equal(const texpr0 &x) const
Whether two expressions are syntactically, structurally equal.
Definition: apxx_texpr0.hh:172
builder(ap_texpr0_t *x)
Internal use only: makes a shallow copy, copying only the root node.
Definition: apxx_texpr0.hh:641
long hash() const
Returns a hash code.
Definition: apxx_texpr0.hh:262
texpr0(ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition: apxx_texpr0.hh:54
friend builder operator%(const builder &a, const builder &b)
Makes a AP_TEXPR_MOD expression node using AP_RTYPE_REAL type (no rounding).
Definition: apxx_texpr0.hh:879
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition: apxx_texpr0.hh:481
friend builder unary(ap_texpr_op_t op, const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes a unary expression node.
Definition: apxx_texpr0.hh:757
Level 0 arbitrary expression tree (ap_texpr0_t wrapper).
Definition: apxx_texpr0.hh:92
Coefficient (ap_coeff_t wrapper).
Definition: apxx_coeff.hh:36
void substitute(ap_dim_t dim, const texpr0 &dst)
Substitutes each occurrence of dim with (a fresh copy of) dst.
Definition: apxx_texpr0.hh:231
Full interval (]-oo,+oo[) or domain, to simplify initialisations and assignments.
Definition: apxx_interval.hh:27
friend builder floor(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_DOWN.
Definition: apxx_texpr0.hh:827
Level 0 arbitrary constraint (ap_tcons0_t wrapper).
Definition: apxx_tcons0.hh:47
const coeff & get_coeff() const
Returns a reference to the coefficient of a constant node.
Definition: apxx_texpr0.hh:341
friend builder operator/(const builder &a, const builder &b)
Makes a AP_TEXPR_DIV expression node using AP_RTYPE_REAL type (no rounding).
Definition: apxx_texpr0.hh:874
Interval (ap_interval_t wrapper).
Definition: apxx_interval.hh:47
Inherited by most wrappers to map new and delete to malloc and free.
Definition: apxx_scalar.hh:69
friend builder sub(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_SUB expression node.
Definition: apxx_texpr0.hh:779
friend builder sqrt(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_SQRT expression node.
Definition: apxx_texpr0.hh:842
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr0.hh:294
iterator(ap_texpr0_t *l)
Internal use only.
Definition: apxx_texpr0.hh:514
A fraction with native int coefficients, to simplify initialisations and assignments.
Definition: apxx_scalar.hh:41
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition: apxx_texpr0.hh:466
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_texpr0.hh:913
ap_texpr_discr_t get_discr() const
Returns the node kind.
Definition: apxx_texpr0.hh:336
friend builder cast(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_CAST expression node.
Definition: apxx_texpr0.hh:821
friend builder ceil(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_UP.
Definition: apxx_texpr0.hh:832
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition: apxx_texpr0.hh:202
ap_dim_t max_dim() const
Returns the maximal dimension occurring in the expression (or 0 if there is no variable).
Definition: apxx_texpr0.hh:445
bool is_interval_polynomial() const
Whether the expression is polynomial and there is no rounding.
Definition: apxx_texpr0.hh:476
size_t size() const
Returns the number of operator nodes in the expression tree.
Definition: apxx_texpr0.hh:440
size_t size() const
Returns the number of operator nodes in the expression tree.
Definition: apxx_texpr0.hh:182
bool is_scalar() const
Whether all occurring constants are scalar.
Definition: apxx_texpr0.hh:222
ap_dim_t & get_dim() const
Returns a (modifiable) reference to the dimension of a dimension node.
Definition: apxx_texpr0.hh:551
texpr0 & operator=(const texpr0 &x)
Makes a (deep) copy of the expression.
Definition: apxx_texpr0.hh:124
friend std::ostream & operator<<(std::ostream &os, const const_iterator &s)
Printing.
Definition: apxx_texpr0.hh:409
bool is_scalar() const
Whether all occurring constants are scalar.
Definition: apxx_texpr0.hh:486
Level 1 arbitrary expression tree (ap_texpr1_t wrapper).
Definition: apxx_texpr1.hh:42
const_iterator root() const
Returns a new iterator at the root of a constant expression tree.
Definition: apxx_texpr0.hh:316
Level 1 arbitrary constraint (ap_tcons1_t wrapper).
Definition: apxx_tcons1.hh:39
void add_dimensions(const dimchange &d)
Adds some dimensions, shifting dimension if needed.
Definition: apxx_texpr0.hh:273
Represents a dimension (i.e., variable by index) in an expression tree.
Definition: apxx_texpr0.hh:33
bool equal(const texpr0 &x) const
Whether two expressions are syntactically, structurally equal.
Definition: apxx_texpr0.hh:429
std::vector< ap_dim_t > dimlist() const
Returns a list of all dimensions occurring in the expression (in strict increasing order)
Definition: apxx_texpr0.hh:455
Temporary expression nodes used when constructing a texpr0.
Definition: apxx_texpr0.hh:581
bool is_interval_polynomial() const
Whether the expression is polynomial and there is no rounding.
Definition: apxx_texpr0.hh:212
Level 0 linear expression (ap_linexpr0_t wrapper).
Definition: apxx_linexpr0.hh:44
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition: apxx_texpr0.hh:904
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition: apxx_texpr0.hh:415
Scalar (ap_scalar_t wrapper).
Definition: apxx_scalar.hh:89