public class Texpr1Intern
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
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.
Modifier and Type | Field and Description |
---|---|
protected Environment |
env
Environment.
|
protected Texpr0Intern |
expr
Level 0 expression.
|
Constructor and Description |
---|
Texpr1Intern(Environment e,
Texpr0Intern x)
Creates a new Texpr1Intern from a Texpr0Intern.
|
Texpr1Intern(Environment e,
Texpr1Node t)
Converts a Java concrete tree to an opaque Apron tree (deep copy).
|
Texpr1Intern(Linexpr1 e)
Converts a linear expression to a comb-like expression tree.
|
Texpr1Intern(Texpr1Intern c)
Deep copy.
|
Modifier and Type | Method and Description |
---|---|
Texpr1Intern |
clone()
Returns a deep copy of this.
|
boolean |
equals(java.lang.Object x)
Whether x is a Texpr1Intern tree and structurally equal to this.
|
void |
extendEnvironment(Environment e)
Expands the expression to fit the given environment.
|
Texpr1Intern |
extendEnvironmentCopy(Environment e)
Returns an expression expanded to fit the given environment.
|
int |
getDepth()
Returns the depth of the expression tree.
|
Environment |
getEnvironment()
Returns the environment of the expression.
|
int |
getSize()
Returns the number of internal nodes in the tree.
|
Texpr0Intern |
getTexpr0Intern()
Returns a copy of the Texpr0Intern underlying this expression.
|
Texpr0Intern |
getTexpr0InternRef()
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 |
hasVar(java.lang.String var) |
boolean |
hasVar(Var var)
Whether the variable var is present.
|
boolean |
isEqual(Texpr1Intern t)
Structural (recursive) equality.
|
boolean |
isIntervalCst()
Whether the expression is constant.
|
boolean |
isIntervalLinear()
Whether the expression is linear with interval or scalar coefficients,
and there is no rounding.
|
boolean |
isIntervalPolyfrac()
Whether the expression is a polynomial fraction, with interval or
scalar coefficients, and there is no rounding.
|
boolean |
isIntervalPolynomial()
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(java.lang.String var,
Texpr1Intern t) |
void |
substitute(Var var,
Texpr1Intern t)
Substitutes all occurrences of the variable var with
the expression tree t.
|
Texpr0Intern |
substituteCopy(java.lang.String var,
Texpr1Intern t) |
Texpr0Intern |
substituteCopy(Var var,
Texpr1Intern t)
Returns a copy of this where all occurrences of the variable var
are substituted with the expression tree t.
|
java.lang.String |
toString()
Converts the expression tree to a String.
|
Texpr1Node |
toTexpr1Node()
Converts an opaque Apron tree to a concrete Java tree.
|
protected Texpr0Intern expr
protected Environment env
public Texpr1Intern(Environment e, Texpr1Node t)
As concrete Texpr1Node trees do not specify an environment, it must be passed as argument to the conversion method.
public Texpr1Intern(Linexpr1 e)
public Texpr1Intern(Texpr1Intern c)
public Texpr1Intern(Environment e, Texpr0Intern x)
All coefficients are copied.
The environment must be large enough for all variables in x.
public static Texpr1Intern make(Environment v, Texpr0Intern x)
The level 0 expression should no longer be used afterwards.
public Texpr1Node toTexpr1Node()
public Environment getEnvironment()
public Texpr0Intern getTexpr0Intern()
public Texpr0Intern getTexpr0InternRef()
Warning: it is dangerous to add, remove, or permute dimensions as it may desynchrnonize the Texpr0Intern dimensions form the environment.
public int getDepth()
public int getSize()
public boolean hasVar(Var var)
public boolean hasVar(java.lang.String var)
public Var[] getVars()
The ordering is that of dimensions.
public boolean isIntervalCst()
public boolean isIntervalLinear()
public boolean isIntervalPolynomial()
public boolean isIntervalPolyfrac()
public boolean isScalar()
public int hashCode()
hashCode
in class java.lang.Object
public boolean isEqual(Texpr1Intern t)
public java.lang.String toString()
toString
in class java.lang.Object
public void substitute(java.lang.String var, Texpr1Intern t)
public void substitute(Var var, Texpr1Intern t)
this and t must be defined on the same environment.
public Texpr0Intern substituteCopy(java.lang.String var, Texpr1Intern t)
public Texpr0Intern substituteCopy(Var var, Texpr1Intern t)
this and t must be defined on the same environment.
this is not modified.
public void extendEnvironment(Environment e)
e must be a super-environment of that of this.
public Texpr1Intern extendEnvironmentCopy(Environment e)
e must be a super-environment of that of this.
this is not modified.
public Texpr1Intern clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object x)
equals
in class java.lang.Object