Class Texpr1Intern
- All Implemented Interfaces:
Serializable
,Cloneable
A Texpr1Intern represents an expression tree, with unary and binary
operator nodes, and Coeff
constant and variables
(represented by names in an environment) leaves.
A Texpr1Intern is implemented as a pair containing an opaque
level 0 tree Texpr0Intern
and an Environment
,
manipulated in conjunction.
Direct access to the fields is prohibited, to avoid desynchronizing them.
A Texpr1Intern encapsulates an Apron ap_texpr0_t
object,
an opaque object that can be passed to and retreived from Apron
abstract domains.
Texpr1Intern objects can be converted from and to Texpr1Node
concrete expression trees for construction and inspection.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Environment
Environment.protected Texpr0Intern
Level 0 expression. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Texpr1Intern from a Texpr0Intern.Converts a Java concrete tree to an opaque Apron tree (deep copy).Converts a linear expression to a comb-like expression tree.Deep copy. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a deep copy of this.boolean
Whether x is a Texpr1Intern tree and structurally equal to this.void
Expands the expression to fit the given environment.Returns an expression expanded to fit the given environment.int
getDepth()
Returns the depth of the expression tree.Returns the environment of the expression.int
getSize()
Returns the number of internal nodes in the tree.Returns a copy of the Texpr0Intern underlying this expression.Returns a (read-only) reference to the Texpr0Intern underlying this expression.Var[]
getVars()
Returns the list of all occurring variables.int
hashCode()
Recursive hashing.boolean
Whether the variable var is present.boolean
boolean
Structural (recursive) equality.boolean
Whether the expression is constant.boolean
Whether the expression is linear with interval or scalar coefficients, and there is no rounding.boolean
Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.boolean
Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.boolean
isScalar()
Whether all coefficients are scalar (non interval).static Texpr1Intern
make
(Environment v, Texpr0Intern x) This function is used internally to construct a new level 1 expression from a level 0 expression.void
substitute
(Var var, Texpr1Intern t) Substitutes all occurrences of the variable var with the expression tree t.void
substitute
(String var, Texpr1Intern t) substituteCopy
(Var var, Texpr1Intern t) Returns a copy of this where all occurrences of the variable var are substituted with the expression tree t.substituteCopy
(String var, Texpr1Intern t) toString()
Converts the expression tree to a String.Converts an opaque Apron tree to a concrete Java tree.
-
Field Details
-
expr
Level 0 expression. -
env
Environment.
-
-
Constructor Details
-
Texpr1Intern
Converts a Java concrete tree to an opaque Apron tree (deep copy).As concrete Texpr1Node trees do not specify an environment, it must be passed as argument to the conversion method.
-
Texpr1Intern
Converts a linear expression to a comb-like expression tree. -
Texpr1Intern
Deep copy. -
Texpr1Intern
Creates a new Texpr1Intern from a Texpr0Intern.All coefficients are copied.
The environment must be large enough for all variables in x.
-
-
Method Details
-
make
This function is used internally to construct a new level 1 expression from a level 0 expression.The level 0 expression should no longer be used afterwards.
-
toTexpr1Node
Converts an opaque Apron tree to a concrete Java tree. -
getEnvironment
Returns the environment of the expression. -
getTexpr0Intern
Returns a copy of the Texpr0Intern underlying this expression. -
getTexpr0InternRef
Returns a (read-only) reference to the Texpr0Intern underlying this expression.Warning: it is dangerous to add, remove, or permute dimensions as it may desynchrnonize the Texpr0Intern dimensions form the environment.
-
getDepth
public int getDepth()Returns the depth of the expression tree. -
getSize
public int getSize()Returns the number of internal nodes in the tree. -
hasVar
Whether the variable var is present. -
hasVar
-
getVars
Returns the list of all occurring variables.The ordering is that of dimensions.
-
isIntervalCst
public boolean isIntervalCst()Whether the expression is constant. -
isIntervalLinear
public boolean isIntervalLinear()Whether the expression is linear with interval or scalar coefficients, and there is no rounding. -
isIntervalPolynomial
public boolean isIntervalPolynomial()Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding. -
isIntervalPolyfrac
public boolean isIntervalPolyfrac()Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding. -
isScalar
public boolean isScalar()Whether all coefficients are scalar (non interval). -
hashCode
public int hashCode()Recursive hashing. -
isEqual
Structural (recursive) equality. -
toString
Converts the expression tree to a String. -
substitute
-
substitute
Substitutes all occurrences of the variable var with the expression tree t.this and t must be defined on the same environment.
-
substituteCopy
-
substituteCopy
Returns a copy of this where all occurrences of the variable var are substituted with the expression tree t.this and t must be defined on the same environment.
this is not modified.
-
extendEnvironment
Expands the expression to fit the given environment.e must be a super-environment of that of this.
-
extendEnvironmentCopy
Returns an expression expanded to fit the given environment.e must be a super-environment of that of this.
this is not modified.
-
clone
Returns a deep copy of this. -
equals
Whether x is a Texpr1Intern tree and structurally equal to this.
-