public abstract class Texpr0Node
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
A Texpr0Node represents an expression tree, which can be
constructed and inspected in Java.
Each node is actually a binary operator (Texpr0BinNode
),
a unary operator (Texpr0UnNode
), a variable represented
by dimension (Texpr0DimNode
), or a constant
(Texpr0CstNode
).
An expression tree must be converted to and from a
Texpr0Intern
to be used in abstract domain transfer
functions.
Modifier and Type | Field and Description |
---|---|
static int |
RDIR_DOWN
Rounds towards -oo.
|
static int |
RDIR_NEAREST
Rounds to nearest.
|
static int |
RDIR_RND
Non-deterministic rounding (all four modes considered).
|
static int |
RDIR_UP
Rounds towards +oo.
|
static int |
RDIR_ZERO
Rounds towards 0 (truncation).
|
static int |
RTYPE_DOUBLE
Double-precision rounding: 64-bit IEEE 754 (double).
|
static int |
RTYPE_EXTENDED
Extended-precision rounding: 80-bit (Intel's long double).
|
static int |
RTYPE_INT
Integer rounding.
|
static int |
RTYPE_QUAD
Quad-precision rounding: 128-bit (Motorola's long double).
|
static int |
RTYPE_REAL
Real (no rounding).
|
static int |
RTYPE_SINGLE
Single-precision rounding: 32-bit IEEE 754 (float).
|
Modifier | Constructor and Description |
---|---|
protected |
Texpr0Node()
No constructor: use constructors from a sub-class.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addDimensions(Dimchange c)
Adds some dimensions and shifts coefficients accordingly .
|
Texpr0Node |
addDimensionsCopy(Dimchange c)
Returns a copy of this with some dimensions added.
|
Texpr0Node |
clone()
Returns a deep copy of this.
|
abstract Texpr0Node |
deepCopy()
Deep copy.
|
abstract boolean |
equals(java.lang.Object x)
Whether x is a Texpr0 tree and structurally equal to this.
|
protected abstract void |
fillDims(boolean[] ar)
Used internally by getDims.
|
static Texpr0Node |
fromLinexpr0(Linexpr0 c)
Constructs an expression tree from a linear expression.
|
abstract int |
getDepth()
Returns the depth of the expression tree.
|
int[] |
getDims()
Returns an ordered list of all occurring dimensions.
|
abstract int |
getPrecedence()
Precedence of the node, used when printing.
|
abstract int |
getSize()
Returns the number of internal nodes in the tree.
|
abstract boolean |
hasDim(int dim)
Whether the dimension dim is present.
|
abstract int |
hashCode()
Recursive hashing.
|
abstract boolean |
isEqual(Texpr0Node t)
Structural (recursive) equality.
|
abstract boolean |
isIntervalCst()
Whether the expression is constant.
|
abstract boolean |
isIntervalLinear()
Whether the expression is linear with interval or scalar coefficients,
and there is no rounding.
|
abstract boolean |
isIntervalPolyfrac()
Whether the expression is a polynomial fraction, with interval or
scalar coefficients, and there is no rounding.
|
abstract boolean |
isIntervalPolynomial()
Whether the expression is polynomial, with interval or scalar
coefficients, and there is no rounding.
|
abstract boolean |
isScalar()
Whether all coefficients are scalar (non interval).
|
abstract int |
maxDim()
Maximum occurring dimension + 1.
|
abstract void |
permuteDimensions(Dimperm p)
Permutes some dimensions in the expression.
|
Texpr0Node |
permuteDimensionsCopy(Dimperm p)
Returns a copy of this with some dimensions permuted.
|
abstract Texpr0Node |
removeDimensions(Dimchange c)
Removes some dimensions and shifts coefficients accordingly
this is modified in-place.
|
Texpr0Node |
removeDimensionsCopy(Dimchange c)
Returns a copy of this with some dimensions removed.
|
abstract Texpr0Node |
shallowCopy()
Shallow copy.
|
abstract Texpr0Node |
substitute(int dim,
Texpr0Node t)
Substitutes all occurrences of the dimension dim with
the expression tree t.
|
Texpr0Node |
substituteCopy(int dim,
Texpr0Node t)
Returns a copy of this where all occurrences of the dimension dim
are substituted with the expression tree t.
|
static java.lang.String |
suffixRDir(int rdir)
Suffix String representation of a rounding direction.
|
static java.lang.String |
suffixRType(int rtype)
Suffix String representation of a rounding type.
|
java.lang.String |
toString()
Converts the expression tree to a String.
|
java.lang.String |
toString(java.lang.String[] names) |
abstract java.lang.String |
toString(Var[] names)
Converts the expression tree to a String.
|
abstract Texpr1Node |
toTexpr1Node(Environment e)
Converts the level 0 tree to a level 1 tree in
environment e.
|
public static final int RTYPE_REAL
public static final int RTYPE_INT
public static final int RTYPE_SINGLE
public static final int RTYPE_DOUBLE
public static final int RTYPE_EXTENDED
public static final int RTYPE_QUAD
public static final int RDIR_NEAREST
public static final int RDIR_ZERO
public static final int RDIR_UP
public static final int RDIR_DOWN
public static final int RDIR_RND
protected Texpr0Node()
public abstract Texpr0Node shallowCopy()
public abstract Texpr0Node deepCopy()
public static Texpr0Node fromLinexpr0(Linexpr0 c)
All coefficients are copied.
public abstract Texpr1Node toTexpr1Node(Environment e)
All dimension leaves are replaced with variable leaves.
public java.lang.String toString()
Dimension i is denoted as xi.
toString
in class java.lang.Object
public abstract java.lang.String toString(Var[] names)
Dimension i is denoted by names[i].
public java.lang.String toString(java.lang.String[] names)
public abstract int getDepth()
public abstract int getSize()
public abstract int maxDim()
public abstract boolean hasDim(int dim)
protected abstract void fillDims(boolean[] ar)
public int[] getDims()
public abstract boolean isIntervalCst()
public abstract boolean isIntervalLinear()
public abstract boolean isIntervalPolynomial()
public abstract boolean isIntervalPolyfrac()
public abstract boolean isScalar()
public abstract Texpr0Node substitute(int dim, Texpr0Node t)
this is modified in-place.
As some nodes can change their kind (a node for a dimension dim becomes the root of the tree t), a new root node is returned.
public Texpr0Node substituteCopy(int dim, Texpr0Node t)
public abstract void addDimensions(Dimchange c)
public Texpr0Node addDimensionsCopy(Dimchange c)
public abstract Texpr0Node removeDimensions(Dimchange c)
this is modified in-place.
As some nodes can change their kind (removed dimensions become [-oo,+oo] constants), a new root node is returned.
public Texpr0Node removeDimensionsCopy(Dimchange c)
public abstract void permuteDimensions(Dimperm p)
public Texpr0Node permuteDimensionsCopy(Dimperm p)
public abstract int hashCode()
hashCode
in class java.lang.Object
public abstract boolean isEqual(Texpr0Node t)
public abstract int getPrecedence()
public static java.lang.String suffixRType(int rtype)
public static java.lang.String suffixRDir(int rdir)
public Texpr0Node clone()
clone
in class java.lang.Object
public abstract boolean equals(java.lang.Object x)
equals
in class java.lang.Object