sidekick/dev/sidekick-base/Sidekick_base_solver/Th_lra/SimpSolver/index.html
2022-07-15 01:53:58 +00:00

16 lines
No EOL
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SimpSolver (sidekick-base.Sidekick_base_solver.Th_lra.SimpSolver)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">sidekick-base</a> &#x00BB; <a href="../../index.html">Sidekick_base_solver</a> &#x00BB; <a href="../index.html">Th_lra</a> &#x00BB; SimpSolver</nav><header class="odoc-preamble"><h1>Module <code><span>Th_lra.SimpSolver</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module" id="module-V" class="anchored"><a href="#module-V" class="anchor"></a><code><span><span class="keyword">module</span> <a href="V/index.html">V</a></span><span> : <a href="../../../../sidekick/Sidekick_simplex/Linear_expr_intf/module-type-VAR/index.html">Sidekick_simplex.VAR</a></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-V_map" class="anchored"><a href="#module-V_map" class="anchor"></a><code><span><span class="keyword">module</span> V_map</span><span> : <span class="xref-unresolved">CCMap</span>.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">key</span> = <span class="xref-unresolved">V</span>.t</span></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Z" class="anchored"><a href="#module-Z" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Z/index.html">Z</a></span><span> : <a href="../../../../sidekick/Sidekick_arith/module-type-INT/index.html">Sidekick_simplex.INT</a></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Q" class="anchored"><a href="#module-Q" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Q/index.html">Q</a></span><span> : <a href="../../../../sidekick/Sidekick_arith/module-type-RATIONAL/index.html">Sidekick_simplex.RATIONAL</a> <span class="keyword">with</span> <span><span class="keyword">type</span> <a href="../../../../sidekick/Sidekick_arith/module-type-RATIONAL/index.html#type-bigint">bigint</a> = <a href="Z/index.html#type-t">Z.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-num" class="anchored"><a href="#type-num" class="anchor"></a><code><span><span class="keyword">type</span> num</span><span> = <a href="Q/index.html#type-t">Q.t</a></span></code></div><div class="spec-doc"><p>Numbers</p></div></div><div class="odoc-spec"><div class="spec module" id="module-Constraint" class="anchored"><a href="#module-Constraint" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Constraint/index.html">Constraint</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Subst" class="anchored"><a href="#module-Subst" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Subst/index.html">Subst</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-create" class="anchored"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>?stat:<a href="../../../../sidekick/Sidekick_util/Stat/index.html#type-t">Sidekick_util.Stat.t</a> <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Create a new simplex.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-push_level" class="anchored"><a href="#val-push_level" class="anchor"></a><code><span><span class="keyword">val</span> push_level : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-pop_levels" class="anchored"><a href="#val-pop_levels" class="anchor"></a><code><span><span class="keyword">val</span> pop_levels : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-define" class="anchored"><a href="#val-define" class="anchor"></a><code><span><span class="keyword">val</span> define : <span>?is_int:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="V/index.html#type-t">V.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span>(<a href="#type-num">num</a> * <a href="V/index.html#type-t">V.t</a>)</span> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Define a basic variable in terms of other variables. This is useful to &quot;name&quot; a linear expression and get back a variable that can be used in a <a href="Constraint/index.html#type-t"><code>Constraint.t</code></a></p></div></div><div class="odoc-spec"><div class="spec type" id="type-unsat_cert" class="anchored"><a href="#type-unsat_cert" class="anchor"></a><code><span><span class="keyword">type</span> unsat_cert</span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Unsat_cert" class="anchored"><a href="#module-Unsat_cert" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Unsat_cert/index.html">Unsat_cert</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec exception" id="exception-E_unsat" class="anchored"><a href="#exception-E_unsat" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">E_unsat</span> <span class="keyword">of</span> <a href="Unsat_cert/index.html#type-t">Unsat_cert.t</a></span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-ev_on_propagate" class="anchored"><a href="#type-ev_on_propagate" class="anchor"></a><code><span><span class="keyword">type</span> ev_on_propagate</span><span> = <span><a href="V/index.html#type-lit">V.lit</a> <span class="arrow">&#45;&gt;</span></span> <span>reason:<span><a href="V/index.html#type-lit">V.lit</a> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-add_var" class="anchored"><a href="#val-add_var" class="anchor"></a><code><span><span class="keyword">val</span> add_var : <span>?is_int:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="V/index.html#type-t">V.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Make sure the variable exists in the simplex.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-add_constraint" class="anchored"><a href="#val-add_constraint" class="anchor"></a><code><span><span class="keyword">val</span> add_constraint :
<span>?keep_on_backtracking:bool <span class="arrow">&#45;&gt;</span></span>
<span>?is_int:bool <span class="arrow">&#45;&gt;</span></span>
<span>on_propagate:<a href="#type-ev_on_propagate">ev_on_propagate</a> <span class="arrow">&#45;&gt;</span></span>
<span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span>
<span><a href="Constraint/index.html#type-t">Constraint.t</a> <span class="arrow">&#45;&gt;</span></span>
<span><a href="V/index.html#type-lit">V.lit</a> <span class="arrow">&#45;&gt;</span></span>
unit</span></code></div><div class="spec-doc"><p>Add a constraint to the simplex.</p><p>This is removed upon backtracking by default.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">is_int</span> <p>declares whether the constraint's variable is an integer</p></li></ul><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <span class="value">Unsat</span> <p>if it's immediately obvious that this is not satisfiable.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">keep_on_backtracking</span> <p>if true (default false), the bound is not backtrackable</p></li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-declare_bound" class="anchored"><a href="#val-declare_bound" class="anchor"></a><code><span><span class="keyword">val</span> declare_bound : <span>?is_int:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Constraint/index.html#type-t">Constraint.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="V/index.html#type-lit">V.lit</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Declare that this constraint exists and map it to a literal, so we can possibly propagate it later. Unlike <a href="#val-add_constraint"><code>add_constraint</code></a> this does <b>NOT</b> assert that the constraint is true</p></div></div><div class="odoc-spec"><div class="spec value" id="val-check_exn" class="anchored"><a href="#val-check_exn" class="anchor"></a><code><span><span class="keyword">val</span> check_exn :
<span>on_propagate:<span>( <span><a href="V/index.html#type-lit">V.lit</a> <span class="arrow">&#45;&gt;</span></span> <span>reason:<span><a href="V/index.html#type-lit">V.lit</a> list</span> <span class="arrow">&#45;&gt;</span></span> unit )</span> <span class="arrow">&#45;&gt;</span></span>
<span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span>
unit</span></code></div><div class="spec-doc"><p>Check the whole simplex for satisfiability.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">on_propagate</span> <p>is called with arguments <code>lit, reason</code> whenever <code>reason =&gt; lit</code> is found to be true by the simplex.</p></li></ul><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <span class="value">Unsat</span> <p>if the constraints are not satisfiable.</p></li></ul></div></div><div class="odoc-spec"><div class="spec type" id="type-result" class="anchored"><a href="#type-result" class="anchor"></a><code><span><span class="keyword">type</span> result</span><span> = </span></code><table><tr id="type-result.Sat" class="anchored"><td class="def variant constructor"><a href="#type-result.Sat" class="anchor"></a><code><span>| </span><span><span class="constructor">Sat</span> <span class="keyword">of</span> <a href="Subst/index.html#type-t">Subst.t</a></span></code></td></tr><tr id="type-result.Unsat" class="anchored"><td class="def variant constructor"><a href="#type-result.Unsat" class="anchor"></a><code><span>| </span><span><span class="constructor">Unsat</span> <span class="keyword">of</span> <a href="Unsat_cert/index.html#type-t">Unsat_cert.t</a></span></code></td></tr></table></div></div><div class="odoc-spec"><div class="spec value" id="val-check" class="anchored"><a href="#val-check" class="anchor"></a><code><span><span class="keyword">val</span> check : <span>on_propagate:<span>( <span><a href="V/index.html#type-lit">V.lit</a> <span class="arrow">&#45;&gt;</span></span> <span>reason:<span><a href="V/index.html#type-lit">V.lit</a> list</span> <span class="arrow">&#45;&gt;</span></span> unit )</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-result">result</a></span></code></div><div class="spec-doc"><p>Call <a href="#val-check_exn"><code>check_exn</code></a> and return a model or a proof of unsat. This does <b>NOT</b> enforce that integer variables map to integer values.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-check_branch_and_bound" class="anchored"><a href="#val-check_branch_and_bound" class="anchor"></a><code><span><span class="keyword">val</span> check_branch_and_bound :
<span>on_propagate:<span>( <span><a href="V/index.html#type-lit">V.lit</a> <span class="arrow">&#45;&gt;</span></span> <span>reason:<span><a href="V/index.html#type-lit">V.lit</a> list</span> <span class="arrow">&#45;&gt;</span></span> unit )</span> <span class="arrow">&#45;&gt;</span></span>
<span>max_tree_nodes:int <span class="arrow">&#45;&gt;</span></span>
<span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span>
<span><a href="#type-result">result</a> option</span></span></code></div><div class="spec-doc"><p>Try to solve and respect the integer constraints.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-n_vars" class="anchored"><a href="#val-n_vars" class="anchor"></a><code><span><span class="keyword">val</span> n_vars : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-n_rows" class="anchored"><a href="#val-n_rows" class="anchor"></a><code><span><span class="keyword">val</span> n_rows : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div></div></body></html>