package apronext
Module Apronext.LinconsextSource
This file is an extension for the Lincons1 module from the apron Library
Note : It only adds function, nothing is removed. Extensions are at the end of the module
val make : Apron.Linexpr1.t -> Apron.Lincons1.typ -> tMake a linear constraint. Modifying later the linear expression (not advisable) modifies correspondingly the linear constraint and conversely, except for changes of environements
val print : Format.formatter -> t -> unitPrint the linear constraint
val get_typ : t -> Apron.Lincons1.typGet the constraint type
val iter : (Apron.Coeff.t -> Apron.Var.t -> unit) -> t -> unitIter the function on the pair coefficient/variable of the underlying linear expression
val get_cst : t -> Apron.Coeff.tGet the constant of the underlying linear expression
val set_typ : t -> Apron.Lincons1.typ -> unitSet the constraint type
val set_list :
t ->
(Apron.Coeff.t * Apron.Var.t) list ->
Apron.Coeff.t option ->
unitSet simultaneously a number of coefficients.
set_list expr [(c1,"x"); (c2,"y")] (Some cst) assigns coefficients c1 to variable "x", coefficient c2 to variable "y", and coefficient cst to the constant. If (Some cst) is replaced by None, the constant coefficient is not assigned.
val set_array :
t ->
(Apron.Coeff.t * Apron.Var.t) array ->
Apron.Coeff.t option ->
unitSet simultaneously a number of coefficients, as set_list.
val set_cst : t -> Apron.Coeff.t -> unitSet the constant of the underlying linear expression
val get_coeff : t -> Apron.Var.t -> Apron.Coeff.tGet the coefficient of the variable in the underlying linear expression
val set_coeff : t -> Apron.Var.t -> Apron.Coeff.t -> unitSet the coefficient of the variable in the underlying linear expression
val make_unsat : Apron.Environment.t -> tBuild the unsatisfiable constraint -1>=0
val is_unsat : t -> boolIs the constraint not satisfiable ?
Change the environement of the constraint for a super-environement. Raise Failure if it is not the case
val extend_environment_with : t -> Apron.Environment.t -> unitSide-effect version of the previous function
val get_env : t -> Apron.Environment.tGet the environement of the linear constraint
val get_linexpr1 : t -> Apron.Linexpr1.tGet the underlying linear expression. Modifying the linear expression (not advisable) modifies correspondingly the linear constraint and conversely, except for changes of environements
val get_lincons0 : t -> Apron.Lincons0.tGet the underlying linear constraint of level 0. Modifying the constraint of level 0 (not advisable) modifies correspondingly the linear constraint and conversely, except for changes of environements
Type array
Make an array of linear constraints with the given size and defined on the given environement. The elements are initialized with the constraint 0=0.
val array_print :
?first:(unit, Format.formatter, unit) format ->
?sep:(unit, Format.formatter, unit) format ->
?last:(unit, Format.formatter, unit) format ->
Format.formatter ->
Apron.Lincons1.earray ->
unitPrint an array of constraints
val array_get : Apron.Lincons1.earray -> int -> tGet the element of the given index (which is not a copy)
val array_set : Apron.Lincons1.earray -> int -> t -> unitSet the element of the given index (without any copy). The array and the constraint should be defined on the same environement; otherwise a Failure exception is raised.
val array_extend_environment :
Apron.Lincons1.earray ->
Apron.Environment.t ->
Apron.Lincons1.earrayChange the environement of the array of constraints for a super-environement. Raise Failure if it is not the case
Side-effect version of the previous function
Extensions
type of constraint negation
constraints negation : constructs a new constraint in opposite direction. e.g : a >= b -> a < b
Equality splitting : split a = b into a >= b and a <= b. Raises Invalid_argument if the constraint is not an equality
Disequality splitting split a <> b into a > b or a < b, Raises Invalid_argument if the constraint is not a disequality
Human readable pretty-printing
Higher-order functions utilities
fold f g l folds over the different monom of the linear expression l, with as an initial accumulato the value (g (get_cst l)).
fold function over generator.earay
iter function over generator.earay
forall function over generator.earay
exists function over generator.earay