14 Matrix *a=NULL, *b=NULL, *c=NULL, *d=NULL, *e=NULL, *f=NULL, *g;
16 Polyhedron *A=NULL, *B=NULL, *C=NULL, *D = NULL;
17 LBL *ZA=NULL, *ZB=NULL, *ZC=NULL, *ZD=NULL;
18 int nbPol, nbMat, func;
52 ((sscanf(
s,
"D %d", &nbPol)<1) && (sscanf(
s,
"M %d", &nbMat)<1)));
75 ((sscanf(
s,
"D %d", &nbPol)<1) && (sscanf(
s,
"M %d", &nbMat)<1)) )
110 fgets(
s, 128, stdin);
112 while((*
s==
'#') || (sscanf(
s,
"F %d", &func)<1));
125 printf(
"input matrix is normal\n");
127 printf(
"input matrix is not normal\n");
150 printf(
"L1 - L2:\n");
152 printf(
"L2 - L1:\n");
186 printf(
"\n\nB - A = ");
207 printf(
"PreIm(A) = ");
209 printf(
"Im(PreIm(A)) = ");
212 printf(
"The image of the preimage is included in the original LBL ");
213 printf(
"(should always be true)? %d\n",
LBLIncluded(ZD, ZA));
215 printf(
"The image of the preimage is exactly the original LBL? %d\n",
224 printf(
"LBLSimplifyEmpty(A) = ");
236 printf(
"A in B :%d\nB in A :%d\n",
248 printf(
"\nComplement(A) = ");
250 printf(
"\nComplement(Complement(A)) = ");
252 printf(
"\nIs the the complement of the complement the original?\n");
253 printf(
" A is included in C(C(A)): %d\n",
LBLIncluded(ZA, ZC));
254 printf(
" C(C(A)) is included in A: %d\n",
LBLIncluded(ZC, ZA));
262 printf(
"LBL2ZDomain(A) = ");
268 printf(
"A - ZD(A) = ");
272 printf(
"ZD(A) - A = ");
282 printf(
"LBLSimplifyEmpty(LBL2ZDomain(A)) = ");
292 printf(
"\nComplement(A) = ");
297 printf(
"\nA inter Complement(A) (should be empty) = ");
306 printf(
"\nUniverse - (A union Complement(A)) (should be empty) = ");
314 printf(
"\nC = B - A = ");
317 printf(
"\nLBLDisjointUnion(B - A) = ");
325 printf(
"Computing C = B - A...\n");
329 printf(
"Computing D = LBLDisjointUnion(C)...\n");
332 printf(
"Computing C - D...\n");
335 printf(
"Checking that C - D is empty: %d\n",
isEmptyLBL(ZA));
337 printf(
"Computing D - C...\n");
340 printf(
"Checking that D - C is empty: %d\n",
isEmptyLBL(ZA));
349 printf(
"? unknown function\n");
LatticeUnion * LatticeDifference(Matrix *A, Matrix *B)
Matrix * LatticeIntersection(Matrix *A, Matrix *B)
void AffineHermite(Matrix *A, Matrix **H, Matrix **U)
Bool isNormalLattice(Matrix *A)
void LatticeUnion_Free(LatticeUnion *Head)
Bool LatticeIncluded(Matrix *A, Matrix *B)
void PrintLatticeUnion(FILE *fp, char *format, LatticeUnion *Head)
void LBLSimplifyEmpty(LBL *A)
LBL * LBLImage(LBL *A, Matrix *Func)
LBL * LBLPreimage(LBL *A, Matrix *Func)
LBL * LBL2ZDomain(LBL *A)
LBL * LBLUnion(LBL *A, LBL *B)
LBL * LBLDisjointUnion(LBL *A)
LBL * LBLComplement(LBL *A)
LBL * UniverseLBL(int dimension)
void LBLPrint(FILE *fp, const char *format, LBL *A)
LBL * LBLDifference(LBL *A, LBL *B)
Bool LBLIncluded(LBL *A, LBL *B)
LBL * EmptyLBL(int dimension)
LBL * LBLIntersection(LBL *A, LBL *B)
LBL * LBLAlloc(Matrix *Lat, Polyhedron *Domain)
Matrix * Matrix_Read(void)
void Matrix_Print(FILE *Dst, const char *Format, Matrix *Mat)
void Matrix_Free(Matrix *Mat)
Polyhedron * DomainConvex(Polyhedron *Pol, unsigned NbMaxConstrs)
Polyhedron * DomainUnion(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
void polylib_close()
Free all cache allocated memory: call this function before exiting in a memory checker environment li...
Matrix * Polyhedron2Constraints(Polyhedron *Pol)
Polyhedron * Constraints2Polyhedron(Matrix *Constraints, unsigned NbMaxRays)
Given a matrix of constraints ('Constraints'), construct and return a polyhedron.
void Domain_Free(Polyhedron *Pol)