Class Tcons0
- All Implemented Interfaces:
Serializable
,Cloneable
A Tcons0 represents a constraint over variables denoted
by dimension (i.e., integer starting from 0).
It has a left member (which is a Texpr0Intern
level 0
opaque expression), a constraint operator (=, >=, >, <>, or = modulo),
a right member which is always 0, and an optional constant modulo
factor (for = modulo constraints only).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Disquality constraint: expr <> 0.static final int
Equality constraint: expr = 0.static final int
Congruence equality constraint modulo a constant: expr = 0 mod scalar.Left member of the constraint.int
Optional modulo factor.static final int
Strict inequality constraint: expr > 0.static final int
Inequality constraint: expr >= 0. -
Constructor Summary
ConstructorsConstructorDescriptionTcons0
(int k, Texpr0Intern e) Constructs a constraint with given kind and e as left member.Tcons0
(int k, Texpr0Intern e, Scalar s) Constructs a constraint with given kind, e as left member, and s as modulo factor.Tcons0
(int k, Texpr0Node e) Constructs a constraint with given kind and e as left member.Tcons0
(int k, Texpr0Node e, Scalar s) Constructs a constraint with given kind, e as left member, and s as modulo factor.Converts a linear constraint to a comb-line tree expression constraint.Constructs a copy of c. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds some dimensions and shifts coefficients accordingly .Returns a copy of the constraint with some dimensions added.clone()
Returns a copy of this.boolean
Whether x is a Tcons0 tree and structurally equal to this.int
getDepth()
Returns the depth of the expression tree.int[]
getDims()
Returns an ordered list of all occurring dimensions.Returns the left expression.int
getKind()
Returns the constraint kind.Returns the optional modulo factor (may be null).int
getSize()
Returns the number of internal nodes in the tree.boolean
hasDim
(int dim) Whether the dimension dim is present.int
hashCode()
Returns a hash of the constraint.boolean
Whether x and this are structurally equal.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).int
maxDim()
Maximum occurring dimension + 1.void
Permutes some dimensions in the constraint.Returns a copy of the constraint with some dimensions permuted.void
Removes some dimensions and shifts coefficients accordingly .Returns a copy of the constraint with some dimensions removed.void
Sets the left expression.void
setKind
(int k) Sets the constraint kind.void
Sets the optional modulo factor (may be null).void
substitute
(int dim, Texpr0Intern t) Substitutes all occurrences of the dimension dim with the tree t.substituteCopy
(int dim, Texpr0Intern t) Returns a copy of this where all occurrences of the dimension dim are substituted with the expression tree t.toString()
Returns a string representation of the constraint.Returns a string representation of the constraint.Converts the expression tree to a concrete Java tree.
-
Field Details
-
expr
Left member of the constraint. -
kind
public int kind -
scalar
Optional modulo factor.null, except for
EQMOD
. -
EQ
public static final int EQEquality constraint: expr = 0.- See Also:
-
SUPEQ
public static final int SUPEQInequality constraint: expr >= 0.- See Also:
-
SUP
public static final int SUPStrict inequality constraint: expr > 0.- See Also:
-
EQMOD
public static final int EQMODCongruence equality constraint modulo a constant: expr = 0 mod scalar.- See Also:
-
DISEQ
public static final int DISEQDisquality constraint: expr <> 0.- See Also:
-
-
Constructor Details
-
Tcons0
Constructs a constraint with given kind and e as left member.e is referenced, not copied.
-
Tcons0
Constructs a constraint with given kind, e as left member, and s as modulo factor.e and s are referenced, not copied.
-
Tcons0
Constructs a constraint with given kind and e as left member.e is converted to an opaque
Texpr0Intern
Apron expression tree. -
Tcons0
Constructs a constraint with given kind, e as left member, and s as modulo factor.e is converted to an opaque
Texpr0Intern
Apron expression tree. -
Tcons0
Constructs a copy of c.The left member expression and the optional scalar are copied.
-
Tcons0
Converts a linear constraint to a comb-line tree expression constraint.
-
-
Method Details
-
toString
Returns a string representation of the constraint.Dimension i is denoted as xi.
-
toString
Returns a string representation of the constraint.Dimension i is denoted by names[i].
-
toString
-
hashCode
public int hashCode()Returns a hash of the constraint. -
substitute
Substitutes all occurrences of the dimension dim with the tree t. -
substituteCopy
Returns a copy of this where all occurrences of the dimension dim are substituted with the expression tree t. -
addDimensions
Adds some dimensions and shifts coefficients accordingly . -
removeDimensions
Removes some dimensions and shifts coefficients accordingly . -
permuteDimensions
Permutes some dimensions in the constraint. -
addDimensionsCopy
Returns a copy of the constraint with some dimensions added.this is not changed.
-
removeDimensionsCopy
Returns a copy of the constraint with some dimensions removed.this is not changed.
-
permuteDimensionsCopy
Returns a copy of the constraint with some dimensions permuted.this is not changed.
-
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). -
toTexpr0Node
Converts the expression tree to a concrete Java tree. -
getDepth
public int getDepth()Returns the depth of the expression tree. -
getSize
public int getSize()Returns the number of internal nodes in the tree. -
maxDim
public int maxDim()Maximum occurring dimension + 1. -
hasDim
public boolean hasDim(int dim) Whether the dimension dim is present. -
getDims
public int[] getDims()Returns an ordered list of all occurring dimensions. -
getExpression
Returns the left expression. -
getKind
public int getKind()Returns the constraint kind. -
getScalar
Returns the optional modulo factor (may be null). -
setExpression
Sets the left expression. -
setKind
public void setKind(int k) Sets the constraint kind. -
setScalar
Sets the optional modulo factor (may be null). -
clone
Returns a copy of this. -
isEqual
Whether x and this are structurally equal. -
equals
Whether x is a Tcons0 tree and structurally equal to this.
-