Class Abstract0
- All Implemented Interfaces:
Cloneable
A level 0 numerical abstract value object represents a set of points in Z^n * R^m, for some n and m.
All abstract element methods are applied within a given
Manager
that indicates which numerical abstract domain instance is used.
Most often, which Manager is used is specified as an argument.
It must be a Manager compatible (i.e., from the same factory, and
constructed using the same parameters) with the one the Abstract0 arguments
were created with.
A few functions (such as finalize, toString) cannot take a Manager argument.
They are applied implicitly with the Manager used when creating the
object.
An Abstract0 object encapsulates an ap_abstract0_t
Apron object
allocated in the C heap.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new universal abstract element.Creates a new universal or empty abstract element.Creates a new abstract element from a box.Creates a new abstract element from a set of constraints.Creates a new abstract element from a set of constraints.Creates a copy of the abstract element a. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDimensions
(Manager man, Dimchange d, boolean project) Adds some dimensions to this.addDimensionsCopy
(Manager man, Dimchange d, boolean project) Returns a new element containing this after adding some dimensions.void
addRay
(Manager man, Generator0 r) Replaces this with (an over-approximation of) this with one ray added.void
addRay
(Manager man, Generator0[] ar) Replaces this with (an over-approximation of) this with some rays added.addRayCopy
(Manager man, Generator0 r) Returns a new abstract element that contains (an over-approximation of) this with one ray added.addRayCopy
(Manager man, Generator0[] ar) Returns a new abstract element that contains (an over-approximation of) this with some rays added.void
approximate
(Manager man, int algorithm) Tries to simplify the representation of the element, maybe at the expense of precision.void
Replaces this with (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.void
assign
(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) Replaces this with (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.void
Replaces this with (an over-approximation of) this after assigning expr to dim.void
assign
(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) Replaces this with (an over-approximation of) this after assigning expr to dim.assignCopy
(Manager man, int[] dim, Linexpr0[] ar, Abstract0 dest) Returns a new element containing (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.assignCopy
(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) Returns a new element containing (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.assignCopy
(Manager man, int dim, Linexpr0 expr, Abstract0 dest) Returns a new element containing (an over-approximation of) this after assigning expr to dim.assignCopy
(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) Returns a new element containing (an over-approximation of) this after assigning expr to dim.void
canonicalize
(Manager man) Tries to put the element in canonical form.void
Replaces this with (an over-approximation of) its topological closure.closureCopy
(Manager man) Returns a new element which is (an over-approximation of) the topological closure of this.static Abstract0
deserialize
(Manager man, byte[] buf) Restores an abstract element from a byte array.void
Duplicates n times the variable dim in this.expandCopy
(Manager man, int dim, int n) Returns a new element where variable dim is duplicated n times.void
Folds all dimensions from dim[] into dimension dim[0].Returns a new element where all dimensions from dim[] are folded into dimension dim[0].void
Replaces this with (an over-approximation of) this after forgetting the value of the variables in dim.void
Replaces this with (an over-approximation of) this after forgetting the value of the variable dim.forgetCopy
(Manager man, int[] dim, boolean project) Returns a new element containing (an over-approximation of) this after forgetting the value of the variables in dim.forgetCopy
(Manager man, int dim, boolean project) Returns a new element containing (an over-approximation of) this after forgetting the value of the variable dim.Returns (an over-approximation of) the set of values the variable dim can take on this.Returns (an over-approximation of) the set of values e can take on this.getBound
(Manager man, Texpr0Intern e) Returns (an over-approximation of) the set of values e can take on this.Returns the Manager which was used to create the the abstract element.getDimension
(Manager man) Returns the number of integer-valued and real-valued dimensions in the element.int
Returns the size in memory of the abstract element.int
Returns a hash of the element value.boolean
Whether the element is definitely empty (true) or maybe not empty (false).boolean
isDimensionUnconstrained
(Manager man, int dim) Whether the dimension dim is definitely unbounded in this (true) or may be bounded (false).boolean
Whether this is definitely equal to x (true) or maybe not equal (false).boolean
isIncluded
(Manager man, Abstract0 x) Whether this is definitely included in x (true) or maybe not included (false).boolean
Whether the element is definitely universal (true) or maybe not universal (false).void
Replaces this with (an over-approximation of) the set-union of this and op.static Abstract0
Returns a new abstract element that contains (an over-approximation of) the set-union of the elements in ar.Returns a new abstract element that contains (an over-approximation of) the set-union of this and op.void
Replaces this with (an over-approximation of) the set-intersection of this and op.static Abstract0
Returns a new abstract element that contains (an over-approximation of) the set-intersection of the elements in ar.void
Replaces this with (an over-approximation of) the set-intersection of this with the constraint c.void
Replaces this with (an over-approximation of) the set-intersection of this with the constraints in ar.void
Replaces this with (an over-approximation of) the set-intersection of this with the constraint c.void
Replaces this with (an over-approximation of) the set-intersection of this with the constraints in ar.Returns a new abstract element that contains (an over-approximation of) the set-intersection of this and op.Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraint cr.Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraints in ar.Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraint in c.Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraints in ar.void
Tries to minimize the memory representation of the element.void
permuteDimensions
(Manager man, Dimperm p) Permutes some dimensions to this.permuteDimensionsCopy
(Manager man, Dimperm p) Returns a new element containing this after permuting some dimensions.void
removeDimensions
(Manager man, Dimchange d) Removes some dimensions from this.removeDimensionsCopy
(Manager man, Dimchange d) Returns a new element containing this after removing some dimensions.boolean
Whether the projection of this on dimension dim is definitely included in the interval i (true) or maybe is not included (false).boolean
Whether this definitely satisfies the constraint c (true) or maybe does not satisfy it (false).boolean
Whether this definitely satisfies the constraint c (true) or maybe does not satisfy it (false).byte[]
Converts the abstract element to a byte array.void
substitute
(Manager man, int[] dim, Linexpr0[] ar, Abstract0 dest) Replaces this with (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.void
substitute
(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) Replaces this with (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.void
substitute
(Manager man, int dim, Linexpr0 expr, Abstract0 dest) Replaces this with (an over-approximation of) this after substituting dim with expr.void
substitute
(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) Replaces this with (an over-approximation of) this after substituting dim with expr.substituteCopy
(Manager man, int[] dim, Linexpr0[] ar, Abstract0 dest) Returns a new element containing (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.substituteCopy
(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) Returns a new element containing (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.substituteCopy
(Manager man, int dim, Linexpr0 expr, Abstract0 dest) Returns a new element containing (an over-approximation of) this after substituting dim with expr.substituteCopy
(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) Returns a new element containing (an over-approximation of) this after substituting dim with expr.Interval[]
Returns a box describing (an over-approximation of) this.toGenerator
(Manager man) Returns a set of generators describing (an over-approximation of) this.Lincons0[]
Returns a set of linear constraints describing (an over-approximation of) this.toString()
Returns a String representation of the element as a list of constraints.Returns a String representation of the element as a list of constraints.Returns a String representation of the element as a list of constraints.Tcons0[]
Returns a set of constraints describing (an over-approximation of) this.Returns a new element equal to this widened with op.wideningThreshold
(Manager man, Abstract0 op, Lincons0[] c) Returns a new element equal to this widened with op, with thresholds constraints set c.
-
Constructor Details
-
Abstract0
Creates a copy of the abstract element a.- Throws:
ApronException
-
Abstract0
Creates a new universal abstract element.The element has intdim integer-valued dimensions, followed by realdim real-valued dimensions.
It is initialized to the full space: Z^intdim * R^realdim.
- Throws:
ApronException
-
Abstract0
Creates a new universal or empty abstract element.The element has intdim integer-valued dimensions, followed by realdim real-valued dimensions.
It is initialized to the full space if empty is false, and to the empty space if empty is true.
- Throws:
ApronException
-
Abstract0
Creates a new abstract element from a box.The element has intdim integer-valued dimensions, followed by realdim real-valued dimensions.
box must contain intdim+realdim intervals.
The constructed element is the Cartesian product of the intervals.
- Throws:
ApronException
-
Abstract0
Creates a new abstract element from a set of constraints.
The element has intdim integer-valued dimensions, followed by realdim real-valued dimensions.
The constructed element is (an over-approximation of) the set of points satisfying all constraints.
- Throws:
ApronException
-
Abstract0
Creates a new abstract element from a set of constraints.The element has intdim integer-valued dimensions, followed by realdim real-valued dimensions.
The constructed element is (an over-approximation of) the set of points satisfying all constraints.
- Throws:
ApronException
-
-
Method Details
-
getSize
Returns the size in memory of the abstract element.The memory unit is domain-specific.
- Throws:
ApronException
-
hashCode
Returns a hash of the element value.- Throws:
ApronException
-
getDimension
Returns the number of integer-valued and real-valued dimensions in the element.- Throws:
ApronException
-
getCreationManager
Returns the Manager which was used to create the the abstract element. -
toString
Returns a String representation of the element as a list of constraints.This method uses the Manager that was used to create this.
-
toString
Returns a String representation of the element as a list of constraints.Dimension i is denoted as xi.
-
toString
-
toString
Returns a String representation of the element as a list of constraints.Dimension i as denoted by names[i].
-
getBound
Returns (an over-approximation of) the set of values e can take on this.- Throws:
ApronException
-
getBound
Returns (an over-approximation of) the set of values e can take on this.- Throws:
ApronException
-
getBound
Returns (an over-approximation of) the set of values the variable dim can take on this.- Throws:
ApronException
-
toLincons
Returns a set of linear constraints describing (an over-approximation of) this.- Throws:
ApronException
-
toTcons
Returns a set of constraints describing (an over-approximation of) this.- Throws:
ApronException
-
toBox
Returns a box describing (an over-approximation of) this.- Throws:
ApronException
-
toGenerator
Returns a set of generators describing (an over-approximation of) this.- Throws:
ApronException
-
isBottom
Whether the element is definitely empty (true) or maybe not empty (false).If
Manager.wasExact()
returns true, then false indicates that the element is definitely not empty.- Throws:
ApronException
-
isTop
Whether the element is definitely universal (true) or maybe not universal (false).If
Manager.wasExact()
returns true, then false indicates that the element is definitely not universal.- Throws:
ApronException
-
isIncluded
Whether this is definitely included in x (true) or maybe not included (false).If
Manager.wasExact()
returns true, then false indicates that this is definitely not included in x.- Throws:
ApronException
-
isEqual
Whether this is definitely equal to x (true) or maybe not equal (false).If
Manager.wasExact()
returns true, then false indicates that this is definitely not equal to x.- Throws:
ApronException
-
satisfy
Whether this definitely satisfies the constraint c (true) or maybe does not satisfy it (false).If
Manager.wasExact()
returns true, then false indicates that this definitely does not satisfy c.- Throws:
ApronException
-
satisfy
Whether this definitely satisfies the constraint c (true) or maybe does not satisfy it (false).If
Manager.wasExact()
returns true, then false indicates that this definitely does not satisfy c.- Throws:
ApronException
-
satisfy
Whether the projection of this on dimension dim is definitely included in the interval i (true) or maybe is not included (false).If
Manager.wasExact()
returns true, then false indicates that it is definitely not included.- Throws:
ApronException
-
isDimensionUnconstrained
Whether the dimension dim is definitely unbounded in this (true) or may be bounded (false).If
Manager.wasExact()
returns true, then false indicates that the dimension is definitely bounded.- Throws:
ApronException
-
minimize
Tries to minimize the memory representation of the element.Use this to gain memory space. However, this may cause subsequent operations to be less efficients as cached information may be discarded.
- Throws:
ApronException
-
canonicalize
Tries to put the element in canonical form.The notion of canonical form is not fully defined yet.
- Throws:
ApronException
-
approximate
Tries to simplify the representation of the element, maybe at the expense of precision.The algorithm argument indicates how aggressive the simplification should be. Its interpretation is domain-dependant.
- Throws:
ApronException
-
meetCopy
Returns a new abstract element that contains (an over-approximation of) the set-intersection of this and op.this and op are not modified.
- Throws:
ApronException
-
meet
Returns a new abstract element that contains (an over-approximation of) the set-intersection of the elements in ar.The elements of ar are not modified.
- Throws:
ApronException
-
meet
Replaces this with (an over-approximation of) the set-intersection of this and op.op is not modified.
- Throws:
ApronException
-
joinCopy
Returns a new abstract element that contains (an over-approximation of) the set-union of this and op.this and op are not modified.
- Throws:
ApronException
-
join
Returns a new abstract element that contains (an over-approximation of) the set-union of the elements in ar. The elements of ar are not modified.- Throws:
ApronException
-
join
Replaces this with (an over-approximation of) the set-union of this and op.op is not modified.
- Throws:
ApronException
-
meetCopy
Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraints in ar.this is not changed.
- Throws:
ApronException
-
meetCopy
Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraints in ar.this is not changed.
- Throws:
ApronException
-
meet
Replaces this with (an over-approximation of) the set-intersection of this with the constraints in ar.- Throws:
ApronException
-
meet
Replaces this with (an over-approximation of) the set-intersection of this with the constraints in ar.- Throws:
ApronException
-
meetCopy
Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraint cr.this is not changed.
- Throws:
ApronException
-
meetCopy
Returns a new abstract element that contains (an over-approximation of) the set-intersection of this with the constraint in c.this is not changed.
- Throws:
ApronException
-
meet
Replaces this with (an over-approximation of) the set-intersection of this with the constraint c.- Throws:
ApronException
-
meet
Replaces this with (an over-approximation of) the set-intersection of this with the constraint c.- Throws:
ApronException
-
addRayCopy
Returns a new abstract element that contains (an over-approximation of) this with some rays added.this is not changed.
ar can only contain ray and lines, not vertices.
- Throws:
ApronException
-
addRay
Replaces this with (an over-approximation of) this with some rays added.ar can only contain ray and lines, not vertices.
- Throws:
ApronException
-
addRayCopy
Returns a new abstract element that contains (an over-approximation of) this with one ray added.this is not changed.
- Throws:
ApronException
-
addRay
Replaces this with (an over-approximation of) this with one ray added.- Throws:
ApronException
-
assign
Replaces this with (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
assignCopy
public Abstract0 assignCopy(Manager man, int[] dim, Linexpr0[] ar, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
assign
Replaces this with (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
assignCopy
public Abstract0 assignCopy(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after assigning ar[i] to dim[i], in parallel.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substitute
Replaces this with (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substituteCopy
public Abstract0 substituteCopy(Manager man, int[] dim, Linexpr0[] ar, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substitute
public void substitute(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) throws ApronException Replaces this with (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substituteCopy
public Abstract0 substituteCopy(Manager man, int[] dim, Texpr0Intern[] ar, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after substituting dim[i] with ar[i], in parallel.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
assign
Replaces this with (an over-approximation of) this after assigning expr to dim. The result is intersected with dest, if dest is not null.- Throws:
ApronException
-
assignCopy
public Abstract0 assignCopy(Manager man, int dim, Linexpr0 expr, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after assigning expr to dim.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
assign
Replaces this with (an over-approximation of) this after assigning expr to dim.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
assignCopy
public Abstract0 assignCopy(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after assigning expr to dim.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substitute
Replaces this with (an over-approximation of) this after substituting dim with expr.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substituteCopy
public Abstract0 substituteCopy(Manager man, int dim, Linexpr0 expr, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after substituting dim with expr.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substitute
public void substitute(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) throws ApronException Replaces this with (an over-approximation of) this after substituting dim with expr.The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
substituteCopy
public Abstract0 substituteCopy(Manager man, int dim, Texpr0Intern expr, Abstract0 dest) throws ApronException Returns a new element containing (an over-approximation of) this after substituting dim with expr.this is not modified.
The result is intersected with dest, if dest is not null.
- Throws:
ApronException
-
forgetCopy
Returns a new element containing (an over-approximation of) this after forgetting the value of the variables in dim.this is not modified.
If project is true, the variables are set to 0. Otherwise, they are set to [-oo,+oo].
- Throws:
ApronException
-
forget
Replaces this with (an over-approximation of) this after forgetting the value of the variables in dim.If project is true, the variables are set to 0. Otherwise, they are set to [-oo,+oo].
- Throws:
ApronException
-
forgetCopy
Returns a new element containing (an over-approximation of) this after forgetting the value of the variable dim.this is not modified.
- Throws:
ApronException
-
forget
Replaces this with (an over-approximation of) this after forgetting the value of the variable dim.- Throws:
ApronException
-
addDimensionsCopy
Returns a new element containing this after adding some dimensions.this is not modified.
If project is true, the added variables are set to 0. Otherwise, they are set to set to [-oo,+oo].
- Throws:
ApronException
-
addDimensions
Adds some dimensions to this.If project is true, the added variables are set to 0. Otherwise, they are set to set to [-oo,+oo].
- Throws:
ApronException
-
removeDimensionsCopy
Returns a new element containing this after removing some dimensions.this is not modified.
- Throws:
ApronException
-
removeDimensions
Removes some dimensions from this.- Throws:
ApronException
-
permuteDimensionsCopy
Returns a new element containing this after permuting some dimensions.this is not modified.
- Throws:
ApronException
-
permuteDimensions
Permutes some dimensions to this.- Throws:
ApronException
-
expandCopy
Returns a new element where variable dim is duplicated n times.If the duplicated dimension is integer (resp. float), copies are appended after all integer (resp. float) variables.
this is not modified.
- Throws:
ApronException
-
expand
Duplicates n times the variable dim in this.If the duplicated dimension is integer (resp. float), copies are appended after all integer (resp. float) variables.
- Throws:
ApronException
-
foldCopy
Returns a new element where all dimensions from dim[] are folded into dimension dim[0].The array must be sorted and contain either only integer-valued or real-valued variables.
this is not modified.
- Throws:
ApronException
-
fold
Folds all dimensions from dim[] into dimension dim[0].The array must be sorted and contain either only integer-valued or real-valued variables.
The array must be sorted.
- Throws:
ApronException
-
widening
Returns a new element equal to this widened with op.this and op are not modified.
- Throws:
ApronException
-
wideningThreshold
Returns a new element equal to this widened with op, with thresholds constraints set c.this and op are not modified.
- Throws:
ApronException
-
closureCopy
Returns a new element which is (an over-approximation of) the topological closure of this.this is not modified.
- Throws:
ApronException
-
closure
Replaces this with (an over-approximation of) its topological closure.- Throws:
ApronException
-
serialize
Converts the abstract element to a byte array.The byte array can be stored to and retrieved from disk, or sent through a network. However, the sending and receiving parties must use compatible managers.
- Throws:
ApronException
-
deserialize
Restores an abstract element from a byte array.The specified manager must be compatible with that used during the
serialize(apron.Manager)
call.- Throws:
ApronException
-