Overview of the ZPolyhedralSets Subpackage
Calling Sequence
Description
Examples
References
Compatibility
ZPolyhedralSets:-command(arguments)
command(arguments)
The ZPolyhedralSets subpackage of the PolyhedralSets package is a collection of commands for computing with Z-polyhedral sets.
A Z-polyhedral set is the intersection of a polyhedral set with an integer lattice. (A Z-polytope is the intersection of a polytope with an integer lattice; a polytope is a bounded polyhedral set.)
The functionalities of this package offer tools to construct, visualize and study Z-polyhedral sets.
The commands Lattice and ZPolyhedralSet build integer lattices and Z-polyhedral sets.
The command IsContained is an inclusion-test for sets of Z-polyhedral sets.
The command IsEmpty checks whether a Z-Polyhedral set is empty.
The command IsIntegerPointOf checks whether a given integer point belongs to a given a Z-Polyhedral set.
The command SamplePoint returns one point of a non-empty Z-Polyhedral set.
The command EnumerateIntegerPoints enumerates the points of a bounded Z-Polyhedral set.
The command PlotIntegerPoints3d plots the points of a bounded three-dimensional Z-Polyhedral set.
The command IntegerPointDecomposition is at the core of this package: it decomposes a given Z-polyhedral set into Z-polyhedral sets with additional properties (such as consistency and good specialization).
The examples below are advanced problems taken from the literature (see the fourth reference below). They illustrate the kind of applications that this package can support.
with⁡PolyhedralSets:
with⁡ZPolyhedralSets:
Dependence analysis in Cholesky's LU algorithm from William Pugh's paper on Presburger arithmetic. We consider below one of the three cases that the Author distinguishes. The other two cases are treated similarly.
vars ≔ i,j,k,i1,j1,n
vars≔i,j,k,i1,j1,n
ineqs ≔ j=j1,k=i1,0≤i,i≤n,i+1≤j,j≤n,1≤k,k≤i−1,0≤i1,i1≤n,i1+1≤j1,j1≤n,i≤i1−1
ineqs≔j=j1,k=i1,0≤i,i≤n,i+1≤j,j≤n,1≤k,k≤i−1,0≤i1,i1≤n,i1+1≤j1,j1≤n,i≤i1−1
zp ≔ ZPolyhedralSet⁡ineqs,vars
We apply IntegerPointDecomposition and deduce that there are no dependencies.
IntegerPointDecomposition⁡zp
Example from Section 5.1 of William Pugh's paper on Presburger arithmetic.
ineqs ≔ x=i+di,y=j+dj,2≤i,i≤N−1,2≤j,j≤N−1,−1≤di+dj,di−dj≤1,di+dj≤1,−1≤di−dj
ineqs≔x=i+di,y=j+dj,2≤i,i≤N−1,2≤j,j≤N−1,−1≤di+dj,di−dj≤1,di+dj≤1,−1≤di−dj
vars ≔ di,dj,i,j,x,y,N
vars≔di,dj,i,j,x,y,N
Apply IntegerPointDecomposition and deduce the implied relations.
Relations:di=x−idj=y−j−N≤−3−i≤−2−j≤−2−x≤−1−y≤−1i−N≤−1j−N≤−1−x−y≤−3x−N≤0−y+j≤1y−N≤0y−j≤1−x−y+j≤−1−x+y−N≤−2−x+y−j≤−1x−y−N≤−2x+y−2⁢N≤−1−x+i−y+j≤1−x+i+y−j≤1x−i−y+j≤1x−i+y−j≤1x−y+j−N≤0x+y−j−N≤0Variables:di,dj,i,j,x,y,NParameters:ParameterConstraints:Lattice:ZSpan−101000−10101000001000001000001000001,,,0000000
Calculation of cache access from William Pugh's paper on Presburger arithmetic.
ineqs ≔ y=j+dj,0≤i+di−116−x,i+di−116−x≤0,2≤i,j≤N−1,i≤N−1,2≤j,−1≤di+dj,di+dj≤1,−1≤di−dj,di−dj≤1
ineqs≔y=j+dj,0≤i16+di16−116−x,i16+di16−x≤116,2≤i,j≤N−1,i≤N−1,2≤j,−1≤di+dj,di+dj≤1,−1≤di−dj,di−dj≤1
vars ≔ di,dj,i,j,y,x,N
vars≔di,dj,i,j,y,x,N
Apply IntegerPointDecomposition and deduce the cache access patterns.
Relations:di=1−i+16⁢xdj=y−j−N≤−3−i≤−2−j≤−2−x≤0−y≤−1i−N≤−1j−N≤−1−16⁢x−y≤−216⁢x−N≤−1−y+j≤1y−N≤0y−j≤1−16⁢x−y+j≤0−16⁢x+y−N≤−1−16⁢x+y−j≤016⁢x−y−N≤−316⁢x+y−2⁢N≤−2−i+16⁢x−y+j≤0−i+16⁢x+y−j≤0i−16⁢x−y+j≤2i−16⁢x+y−j≤216⁢x−y+j−N≤−116⁢x+y−j−N≤−1Variables:di,dj,i,j,y,x,NParameters:ParameterConstraints:Lattice:ZSpan−1001600−11001000001000001000001000001,,,1000000
Rui-Juan Jing and Marc Moreno Maza. "Computing the Integer Points of a Polyhedron, I: Algorithm." Proceedings of CASC 2017: 225-241, Springer.
Rui-Juan Jing and Marc Moreno Maza. "Computing the Integer Points of a Polyhedron, II: Complexity Estimates." Proceedings of CASC 2017: 242-256, Springer.
Rachid Seghir, Vincent Loechner, and Benoı̂t Meister. "Integer affine transformations of parametric Z-polytopes and applications to loop nest optimization." Proceedings of TACO, Vol. 9(2):8:1–8:27, 2012.
William Pugh. "The omega test: a fast and practical integer programming algorithm for dependence analysis." Proceedings Supercomputing ’91, pp 4–13. ACM, 1991.
William Pugh. "Counting solutions to presburger formulas: How and why." Proceedings of PLDI, pp 121–134. ACM, 1994.
The PolyhedralSets:-ZPolyhedralSets package was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
EnumerateIntegerPoints
IntegerPointDecomposition
IsContained
IsEmpty
IsIntegerPointOf
Lattice
PlotIntegerPoints3d
SamplePoint
ZPolyhedralSet
Download Help Document