[PPL-devel] simplifying a constraint system?
Roberto Bagnara
bagnara at cs.unipr.it
Mon Apr 6 18:04:26 CEST 2009
Basile STARYNKEVITCH wrote:
> [Sorry for the very naive & basic question]
Hi Basile,
does this mean you did not read the manual? :-)
> I have constructed some constraint system using the C API. I know I'm
> done constructing it.
A "constraint system" is a PPL syntactic object. As such, it is only
one possible (very limited) representation for a PPL semantic object,
which is what you probably want to work with.
> Is there some function to "simplify" it or represent it more efficiently?
> - perhaps onverting it to NNC_Polyhedron and backwards, using
> ppl_new_NNC_Polyhedron_from_Constraint_System
Why NNC_Polyhedron? Do you have strict constraints? If not you should
use C_Polyhedron.
> & ppl_Polyhedron_get_minimuzed_constraints
> ?
Yes, this sequence will give you a minimized constraint system
(in the precise sense stated in the documentation).
> Is there some function to test that it is empty?
Of course:
int ppl_Polyhedron_is_empty(ppl_const_Polyhedron_t ph)
> - perhaps using [...]
No.
> A concrete case occuring to me is the constraint system of two variables
> n and y with constraints {n = 10, y = 17, -n >= 0} I need to compute
> that it is empty.
See above.
> Is there some function to test that it has integer elements, in the
> sense that there exist an integer setting of the variables such as the
> constraint are satisfied?
int ppl_Polyhedron_contains_integer_point(ppl_const_Polyhedron_t ph)
Beware though that this operation can be very expensive.
> - perhaps using grids?
No.
> Sorry for such basic questions!
It's OK. But if you don't read the library documentation I am afraid
you will not go very far.
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