Module Polka


module Polka: sig .. end
Convex Polyhedra and Linear Equalities abstract domains

type internal 

Convex Polyhedra and Linear Equalities abstract domains
type loose 
type strict 
Two flavors for convex polyhedra: loose or strict.

Loose polyhedra cannot have strict inequality constraints like x>0. They are algorithmically more efficient (less generators, simpler normalization).

Convex polyhedra are defined by the conjunction of a set of linear constraints of the form a_0*x_0 + ... + a_n*x_n + b >= 0 or a_0*x_0 + ... + a_n*x_n + b > 0 where a_0, ..., a_n, b, c are constants and x_0, ..., x_n variables.

type equalities 
Linear equalities.

Linear equalities are conjunctions of linear equalities of the form a_0*x_0 + ... + a_n*x_n + b = 0.

type 'a t 
Type of convex polyhedra/linear equalities, where 'a is loose, strict or equalities.

Abstract values which are convex polyhedra have the type (loose t) Apron.Abstract0.t or (loose t) Apron.Abstract1.t or (strict t) Apron.Abstract0.t or (strict t) Apron.Abstract1.t.

Abstract values which are conjunction of linear equalities have the type (equalities t) Apron.Abstract0.t or (equalities t) Apron.Abstract1.t.

Managers allocated by NewPolka have the type 'a t Apron.Manager.t.

val manager_alloc_loose : unit -> loose t Apron.Manager.t
Create a NewPolka manager for loose convex polyhedra.
val manager_alloc_strict : unit -> strict t Apron.Manager.t
Create a NewPolka manager for strict convex polyhedra.
val manager_alloc_equalities : unit -> equalities t Apron.Manager.t
Create a NewPolka manager for conjunctions of linear equalities.
val manager_get_internal : 'a t Apron.Manager.t -> internal
Get the internal submanager of a NewPolka manager.

Various options. See the C documentation
val set_max_coeff_size : internal -> int -> unit
val set_approximate_max_coeff_size : internal -> int -> unit
val get_max_coeff_size : internal -> int
val get_approximate_max_coeff_size : internal -> int

Compilation information

Bytecode compilation

To compile to bytecode, you should first generate a custom interpreter with a command which should look like:

ocamlc -I $APRON_PREFIX/lib -make-runtime -o myrun bigarray.cma gmp.cma apron.cma polka.cma -cclib "-lpolkag"

and then you compile and link your example X.ml with

ocamlc -I $APRON_PREFIX/lib -c X.ml and

ocamlc -I $APRON_PREFIX/lib -use-runtime myrun -o X bigarray.cma gmp.cma apron.cma polka.cma X.cmo

Comments: The C libraries related to gmp.cma and apron.cma are automatically looked for (thanks to the auto-linking feature provided by ocamlc). For polka.cma, the library libpolka.a, identic to libpolkaMPQ.a, is selected by default. The -noautolink option should be used to select a differetn version. See the C documentation of Polka library for details.

With the -noautolink option, the generation of the custom runtime executable should be done with

ocamlc -I $APRON_PREFIX/lib -noautolink -make-runtime -o myrun bigarray.cma gmp.cma apron.cma polka.cma -ccopt "-L$GMP_PREFIX/lib ..." -cclib "-lpolka_caml -lpolka -lapron_caml -lapron -lgmp_caml -lmpfr -lgmp -lbigarray -lcamlidl"

Native-code compilation

You compile and link with

ocamlopt -I $APRON_PREFIX/lib -c X.ml and

ocamlopt -I $APRON_PREFIX/lib -o X bigarray.cmxa gmp.cmxa apron.cmxa polka.cmxa -cclib "-lpolkag" X.cmx

Comments: Same as for bytecode compilation. With the -noautolink option, the linking command becomes

ocamlopt -I $APRON_PREFIX/lib -o X bigarray.cmxa gmp.cmxa apron.cmxa polka.cmxa -ccopt "-L$GMP_PREFIX/lib ..." -cclib "-lpolka_caml -lpolkaMPQ -lapron_caml -lapron -lgmp_caml -lmpfr -lgmp -lbigarray -lcamlidl" X.cmx