mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
88 lines
No EOL
5.9 KiB
HTML
88 lines
No EOL
5.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
|
|
<link rel="Start" href="index.html">
|
|
<link rel="Up" href="Smt.html">
|
|
<link title="Index of types" rel=Appendix href="index_types.html">
|
|
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
|
|
<link title="Index of values" rel=Appendix href="index_values.html">
|
|
<link title="Index of modules" rel=Appendix href="index_modules.html">
|
|
<link title="Index of module types" rel=Appendix href="index_module_types.html">
|
|
<link title="Smt" rel="Chapter" href="Smt.html">
|
|
<link title="Hstring" rel="Chapter" href="Hstring.html"><link title="Profiling functions" rel="Section" href="#2_Profilingfunctions">
|
|
<link title="Main API of the solver" rel="Section" href="#2_MainAPIofthesolver">
|
|
<title>Smt.Solver</title>
|
|
</head>
|
|
<body>
|
|
<div class="navbar"> <a href="Smt.html">Up</a>
|
|
</div>
|
|
<center><h1>Module type <a href="type_Smt.Solver.html">Smt.Solver</a></h1></center>
|
|
<br>
|
|
<pre><span class="keyword">module type</span> Solver = <code class="code">sig</code> <a href="Smt.Solver.html">..</a> <code class="code">end</code></pre><hr width="100%">
|
|
<br>
|
|
This SMT solver is imperative in the sense that it maintains a global
|
|
context. To create different instances of Alt-Ergo Zero use the
|
|
functor <a href="Smt.Make.html"><code class="code">Smt.Make</code></a>.
|
|
<p>
|
|
|
|
A typical use of this solver is to do the following :<pre><code class="code"> clear ();
|
|
assume f_1;
|
|
...
|
|
assume f_n;
|
|
check ();</code></pre><br>
|
|
<pre><span id="TYPEstate"><span class="keyword">type</span> <code class="type"></code>state</span> </pre>
|
|
<div class="info">
|
|
The type of the internal state of the solver (see <a href="Smt.Solver.html#VALsave_state"><code class="code">Smt.Solver.save_state</code></a> and
|
|
<a href="Smt.Solver.html#VALrestore_state"><code class="code">Smt.Solver.restore_state</code></a>).<br>
|
|
</div>
|
|
|
|
<br>
|
|
<span id="2_Profilingfunctions"><h2>Profiling functions</h2></span><br>
|
|
<pre><span id="VALget_time"><span class="keyword">val</span> get_time</span> : <code class="type">unit -> float</code></pre><div class="info">
|
|
<code class="code">get_time ()</code> returns the cumulated time spent in the solver in seconds.<br>
|
|
</div>
|
|
<pre><span id="VALget_calls"><span class="keyword">val</span> get_calls</span> : <code class="type">unit -> int</code></pre><div class="info">
|
|
<code class="code">get_calls ()</code> returns the cumulated number of calls to <a href="Smt.Solver.html#VALcheck"><code class="code">Smt.Solver.check</code></a>.<br>
|
|
</div>
|
|
<br>
|
|
<span id="2_MainAPIofthesolver"><h2>Main API of the solver</h2></span><br>
|
|
<pre><span id="VALclear"><span class="keyword">val</span> clear</span> : <code class="type">unit -> unit</code></pre><div class="info">
|
|
<code class="code">clear ()</code> clears the context of the solver. Use this after <a href="Smt.Solver.html#VALcheck"><code class="code">Smt.Solver.check</code></a>
|
|
raised <a href="Smt.html#EXCEPTIONUnsat"><code class="code">Smt.Unsat</code></a> or if you want to restart the solver.<br>
|
|
</div>
|
|
<pre><span id="VALassume"><span class="keyword">val</span> assume</span> : <code class="type">?profiling:bool -> id:int -> <a href="Smt.Formula.html#TYPEt">Smt.Formula.t</a> -> unit</code></pre><div class="info">
|
|
<code class="code">assume ~profiling:b f id</code> adds the formula <code class="code">f</code> to the context of the
|
|
solver with idetifier <code class="code">id</code>.
|
|
This function only performs unit propagation.<br>
|
|
</div>
|
|
<div class="param_info"><code class="code">profiling</code> : if set to <code class="code">true</code> then profiling information (time) will
|
|
be computed (expensive because of system calls).
|
|
<p>
|
|
|
|
<b>Raises</b> <a href="Smt.html#EXCEPTIONUnsat"><code class="code">Smt.Unsat</code></a> if the context becomes inconsistent after unit
|
|
propagation.</div>
|
|
<pre><span id="VALcheck"><span class="keyword">val</span> check</span> : <code class="type">?profiling:bool -> unit -> unit</code></pre><div class="info">
|
|
<code class="code">check ()</code> runs Alt-Ergo Zero on its context. If <code class="code">()</code> is
|
|
returned then the context is satifiable.<br>
|
|
</div>
|
|
<div class="param_info"><code class="code">profiling</code> : if set to <code class="code">true</code> then profiling information (time) will
|
|
be computed (expensive because of system calls).
|
|
<p>
|
|
|
|
<b>Raises</b> <a href="Smt.html#EXCEPTIONUnsat"><code class="code">Smt.Unsat</code></a> <code class="code">[id_1; ...; id_n]</code> if the context is unsatisfiable.
|
|
<code class="code">id_1, ..., id_n</code> is the unsat core (returned as the identifiers of the
|
|
formulas given to the solver).</div>
|
|
<pre><span id="VALsave_state"><span class="keyword">val</span> save_state</span> : <code class="type">unit -> <a href="Smt.Solver.html#TYPEstate">state</a></code></pre><div class="info">
|
|
<code class="code">save_state ()</code> returns a <b>copy</b> of the current state of the solver.<br>
|
|
</div>
|
|
<pre><span id="VALrestore_state"><span class="keyword">val</span> restore_state</span> : <code class="type"><a href="Smt.Solver.html#TYPEstate">state</a> -> unit</code></pre><div class="info">
|
|
<code class="code">restore_state s</code> restores a previously saved state <code class="code">s</code>.<br>
|
|
</div>
|
|
<pre><span id="VALentails"><span class="keyword">val</span> entails</span> : <code class="type">?profiling:bool -> id:int -> <a href="Smt.Formula.html#TYPEt">Smt.Formula.t</a> -> bool</code></pre><div class="info">
|
|
<code class="code">entails ~id f</code> returns <code class="code">true</code> if the context of the solver entails
|
|
the formula <code class="code">f</code>. It doesn't modify the context of the solver (the state
|
|
is saved when this function is called and restored on exit).<br>
|
|
</div>
|
|
</body></html> |