[PPL-devel] Re: Asking help using PPL's C interface

Roberto Bagnara bagnara at cs.unipr.it
Fri Jan 30 07:53:11 CET 2004


Hosung Song wrote:
> Professor Bagnara,
> 
> Greetings. I've got some help request on PPL usage. I'm sorry if I 
> should have sent this email to someone else, but I didn't think the 
> developer mailing list was appropriate, and there's no contact 
> information in the PPL website (other than mailing lists). I'm currently 
> working on extending a software model checker (Spin) to hybrid settings. 
> This requires extensive polyhedra manipulations and naturally I was led 
> to your PPL package. First of all, I'd like to thank you for your 
> thorough work on the library. Unfortunately, Spin is written in C 
> language and I myself am not a good C++ programmer, so I think I have to 
> use C language interface of PPL. While C++ usage seems quite intuitive 
> (I could see from the examples in the tests directory), there's no 
> example using C interface, and the documentation about it seems quite 
> terse. I'm wondering if you could provide some very simple example of C 
> interface usage (e.g. C interface version of one example in the tests 
> directory). I guess we can manipulate constraints, polyhedra and so on, 
> but I don't know how to deal with variables. Are variables just indexed 
> as integers as ppl_dimension_type? Anyway, a brief example would be 
> greatly helpful. Thanks again for your wonderful package, and I look 
> forward to your little help.
> 
> Best wishes,
> 
> Hosung Song

Dear Hosung,

the developer's mailing list is indeed the appropriate place if you want
to get in touch with the PPL's developers.  On their behalf, let me thank
you for your nice words.

Coming to the C interface, what you write makes me suspect you did not
look into the `interfaces/C/lpenum/' directory.  It contains a toy
LP solver written in C and using the PPL's C interface.  There you can
find examples of how to use several functions provided by that interface.

You guess right: a variable is represented by its index, and such indices
are of type `ppl_dimension_type'.  For example,

    ppl_LinExpression_add_to_coefficient(le, i, k);

adds `k*x' to the linear expression represented by `le', where x is
the variable corresponding to dimension `i'.

Your message indicates a number of things we can do to improve the
PPL's web site and documentation.  Thank you very much for your
feedback and, please, do not hesitate to come back to us.
All the best,

     Roberto

P.S.  A number of quite exciting new features are in preparation for
       the future releases of the PPL.  These include support for more
       precise domains and for restricted classes of polyhedra for which
       very efficient algorithms are available.  If you would like to
       tell us more about the application you are developing and how
       our library could make your life easier, please do so: this may
       help us to better direct our development efforts.

-- 
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