Libabsolute.Csp
This module defines the main types used for the constraint language of AbSolute, along with the type of problems, and instance.
type instance = Q.t Tools.VarMap.t
the instance type
annotations to test the validity of the solver
type t = {
variables : decl list;
constraints : Constraint.t list;
objective : Expr.t option;
solutions : info option;
}
type of constraint satisfaction problems
val dimensions : t -> int
returns the number of variables of a csp
val var_names : t -> string list
returns list of all variable names
val empty : t
empty problem, with no variables and no constraints
adds a real variable in the csp, with float bounds
adds an integer variable in the csp with integer bounds
val add_constr : t -> Constraint.t -> t
adds a constraint to the csp
val sat : t -> Instance.t -> bool
Evaluates the CSP at the given point, i.e true iff all constraints are satisfied
fix_var csp var cst
builds a new csp identical to the csp
where all the occurences of the variable var
are replaced by the constant cst
, and where the variables v
is removed from the csp variables.
val pp_typ : Stdlib.Format.formatter -> typ -> unit
val pp_constraints : Stdlib.Format.formatter -> Constraint.t list -> unit
val print : Stdlib.Format.formatter -> t -> unit
val to_graphviz : t -> string -> unit