<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Csp (libabsolute.Libabsolute__.Csp)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> â€“ <a href="../../index.html">libabsolute</a> &#x00BB; <a href="../index.html">Libabsolute__</a> &#x00BB; Csp</nav><h1>Module <code>Libabsolute__.Csp</code></h1><nav class="toc"><ul><li><a href="#types">Types</a></li><li><a href="#accessors">Accessors</a></li><li><a href="#constructors">Constructors</a></li><li><a href="#operations">Operations</a></li><li><a href="#printing">Printing</a></li></ul></nav></header><aside><p>This module defines the main types used for the constraint language of AbSolute, along with the type of problems, and instance.</p></aside><section><header><h2 id="types"><a href="#types" class="anchor"></a>Types</h2></header><dl><dt class="spec type" id="type-typ"><a href="#type-typ" class="anchor"></a><code><span class="keyword">type</span> typ</code><code> = </code><table class="variant"><tr id="type-typ.Int" class="anchored"><td class="def constructor"><a href="#type-typ.Int" class="anchor"></a><code>| </code><code><span class="constructor">Int</span></code></td></tr><tr id="type-typ.Real" class="anchored"><td class="def constructor"><a href="#type-typ.Real" class="anchor"></a><code>| </code><code><span class="constructor">Real</span></code></td></tr></table></dt><dd><p>Types of variables</p></dd></dl><dl><dt class="spec type" id="type-decl"><a href="#type-decl" class="anchor"></a><code><span class="keyword">type</span> decl</code><code> = <a href="index.html#type-typ">typ</a> * string * <a href="../../Libabsolute/Dom/index.html#type-t">Libabsolute.Dom.t</a></code></dt><dd><p>declaration</p></dd></dl><dl><dt class="spec type" id="type-instance"><a href="#type-instance" class="anchor"></a><code><span class="keyword">type</span> instance</code><code> = <span><a href="../../Libabsolute/Q/index.html#type-t">Libabsolute.Q.t</a> <a href="../../Libabsolute/Tools/VarMap/index.html#type-t">Libabsolute.Tools.VarMap.t</a></span></code></dt><dd><p>the instance type</p></dd></dl><dl><dt class="spec type" id="type-info"><a href="#type-info" class="anchor"></a><code><span class="keyword">type</span> info</code><code> = </code><table class="variant"><tr id="type-info.Exact" class="anchored"><td class="def constructor"><a href="#type-info.Exact" class="anchor"></a><code>| </code><code><span class="constructor">Exact</span> <span class="keyword">of</span> <span><a href="../../Libabsolute/Instance/index.html#type-t">Libabsolute.Instance.t</a> list</span></code></td></tr><tr id="type-info.Unfeasible" class="anchored"><td class="def constructor"><a href="#type-info.Unfeasible" class="anchor"></a><code>| </code><code><span class="constructor">Unfeasible</span></code></td></tr><tr id="type-info.Known" class="anchored"><td class="def constructor"><a href="#type-info.Known" class="anchor"></a><code>| </code><code><span class="constructor">Known</span> <span class="keyword">of</span> <span><span>(<a href="../../Libabsolute/Instance/index.html#type-t">Libabsolute.Instance.t</a> * bool)</span> list</span></code></td></tr></table></dt><dd><p>annotations to test the validity of the solver</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = </code><code>{</code><table class="record"><tr id="type-t.variables" class="anchored"><td class="def field"><a href="#type-t.variables" class="anchor"></a><code>variables : <span><a href="index.html#type-decl">decl</a> list</span>;</code></td></tr><tr id="type-t.constraints" class="anchored"><td class="def field"><a href="#type-t.constraints" class="anchor"></a><code>constraints : <span><a href="../../Libabsolute/Constraint/index.html#type-t">Libabsolute.Constraint.t</a> list</span>;</code></td></tr><tr id="type-t.objective" class="anchored"><td class="def field"><a href="#type-t.objective" class="anchor"></a><code>objective : <span><a href="../../Libabsolute/Expr/index.html#type-t">Libabsolute.Expr.t</a> option</span>;</code></td></tr><tr id="type-t.solutions" class="anchored"><td class="def field"><a href="#type-t.solutions" class="anchor"></a><code>solutions : <span><a href="index.html#type-info">info</a> option</span>;</code></td></tr></table><code>}</code></dt><dd><p>type of constraint satisfaction problems</p></dd></dl></section><section><header><h2 id="accessors"><a href="#accessors" class="anchor"></a>Accessors</h2></header><dl><dt class="spec value" id="val-get_var_names"><a href="#val-get_var_names" class="anchor"></a><code><span class="keyword">val</span> get_var_names : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span>string list</span></code></dt><dd><p>returns list of all variable names</p></dd></dl></section><section><header><h2 id="constructors"><a href="#constructors" class="anchor"></a>Constructors</h2></header><dl><dt class="spec value" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span class="keyword">val</span> empty : <a href="index.html#type-t">t</a></code></dt><dd><p>empty problem, with no variables and no constraints</p></dd></dl><dl><dt class="spec value" id="val-initialize"><a href="#val-initialize" class="anchor"></a><code><span class="keyword">val</span> initialize : <span><span>(<a href="index.html#type-typ">typ</a> * string * <a href="../../Libabsolute/Dom/index.html#type-t">Libabsolute.Dom.t</a>)</span> list</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>initalizes and unconstrained CSP</p></dd></dl><dl><dt class="spec value" id="val-add_real_var"><a href="#val-add_real_var" class="anchor"></a><code><span class="keyword">val</span> add_real_var : string <span>&#45;&gt;</span> <a href="../../Libabsolute/Q/index.html#type-t">Libabsolute.Q.t</a> <span>&#45;&gt;</span> <a href="../../Libabsolute/Q/index.html#type-t">Libabsolute.Q.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>adds a real variable in the csp</p></dd></dl><dl><dt class="spec value" id="val-add_real_var_f"><a href="#val-add_real_var_f" class="anchor"></a><code><span class="keyword">val</span> add_real_var_f : string <span>&#45;&gt;</span> float <span>&#45;&gt;</span> float <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>adds a real variable in the csp, with float bounds</p></dd></dl><dl><dt class="spec value" id="val-add_int_var"><a href="#val-add_int_var" class="anchor"></a><code><span class="keyword">val</span> add_int_var : string <span>&#45;&gt;</span> <a href="../../Libabsolute/Q/index.html#type-t">Libabsolute.Q.t</a> <span>&#45;&gt;</span> <a href="../../Libabsolute/Q/index.html#type-t">Libabsolute.Q.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>adds an integer variable in the csp</p></dd></dl><dl><dt class="spec value" id="val-add_int_var_i"><a href="#val-add_int_var_i" class="anchor"></a><code><span class="keyword">val</span> add_int_var_i : string <span>&#45;&gt;</span> int <span>&#45;&gt;</span> int <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>adds an integer variable in the csp with integer bounds</p></dd></dl><dl><dt class="spec value" id="val-add_constr"><a href="#val-add_constr" class="anchor"></a><code><span class="keyword">val</span> add_constr : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../../Libabsolute/Constraint/index.html#type-t">Libabsolute.Constraint.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>adds a constraint to the csp</p></dd></dl></section><section><header><h2 id="operations"><a href="#operations" class="anchor"></a>Operations</h2></header><dl><dt class="spec value" id="val-fix_var"><a href="#val-fix_var" class="anchor"></a><code><span class="keyword">val</span> fix_var : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> <a href="../../Libabsolute/Q/index.html#type-t">Libabsolute.Q.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>fix_var csp var cst</code> builds a new csp identical to the <code>csp</code> where all the occurences of the variable <code>var</code> are replaced by the constant <code>cst</code>, and where the variables <code>v</code> is removed from the csp variables.</p></dd></dl></section><section><header><h2 id="printing"><a href="#printing" class="anchor"></a>Printing</h2></header><dl><dt class="spec value" id="val-pp_typ"><a href="#val-pp_typ" class="anchor"></a><code><span class="keyword">val</span> pp_typ : Stdlib.Format.formatter <span>&#45;&gt;</span> <a href="index.html#type-typ">typ</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-pp_declarations"><a href="#val-pp_declarations" class="anchor"></a><code><span class="keyword">val</span> pp_declarations : Stdlib.Format.formatter <span>&#45;&gt;</span> <span><span>(<a href="index.html#type-typ">typ</a> * string * <a href="../../Libabsolute/Dom/index.html#type-t">Libabsolute.Dom.t</a>)</span> list</span> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-pp_constraints"><a href="#val-pp_constraints" class="anchor"></a><code><span class="keyword">val</span> pp_constraints : Stdlib.Format.formatter <span>&#45;&gt;</span> <span><a href="../../Libabsolute/Constraint/index.html#type-t">Libabsolute.Constraint.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-print"><a href="#val-print" class="anchor"></a><code><span class="keyword">val</span> print : Stdlib.Format.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt></dl></section></div></body></html>