[PPL-devel] Re: Convex hull

Roberto Bagnara bagnara at cs.unipr.it
Thu Oct 7 12:44:32 CEST 2004


Enrico Oliosi wrote:
> Ho fatto l'analisi del seguente programma
> BEGINPRG
> Read(i);
> j:=0;
> IF (i >= 0) THEN {
>           j:= i+2;
>             [p1]={j=0; i>=0; j-i=2}
>      } ELSE {
>             j:= i;
>             [p2]={j=0; -i>0; j-i=0}
>         }
> FI;
> [1=0]
> ENDPRG
> 
> e quando ho fatto la chiusura convessa utilizzando la chiamata
> 
> [p1].poly_hull_assign_and_minimize([p2]);
> 
> Il risultato e' stato: 1=0. Il poliedro vuoto.

Dear Enrico,

what you obtain is not surprising at all: since both p1 and p2
are empty polyhedra, their poly-hull is the empty polyhedron.

> (se utilizzo la chiamata [p1].poly_hull_assign([p2]) la poly_hull torna
> [p2]);

This is still OK: the method poly_hull_assign() does not minimize
the result and, since p1 is empty it simply gives you back p2.

I think that the problem is elsewhere: the constraint `j=0'
should not, I believe, be in p1 nor in p2.
Please do not hesitate to come back to us if I have not
addressed your questions properly.
Cheers,

       Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list