You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 lines
9.2 KiB

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferBase__SymOp (InferBase.InferBase__SymOp)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> &mdash; <span class="package">package <a href="../index.html">InferBase</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferBase__SymOp</span></h1></header><p>Symbolic Operations and Failures: the units in which analysis work is measured</p><div class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>t</code><code></code><code></code></div><div class="doc"><p>Internal state of the module</p></div></div><div class="spec val" id="val-check_wallclock_alarm"><a href="#val-check_wallclock_alarm" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>check_wallclock_alarm : unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>if the wallclock alarm has expired, raise a timeout exception</p></div></div><div class="spec val" id="val-get_remaining_wallclock_time"><a href="#val-get_remaining_wallclock_time" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_remaining_wallclock_time : unit <span class="keyword">&#8209;&gt;</span> float</code></div><div class="doc"><p>Return the time remaining before the wallclock alarm expires</p></div></div><div class="spec val" id="val-get_timeout_seconds"><a href="#val-get_timeout_seconds" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_timeout_seconds : unit <span class="keyword">&#8209;&gt;</span> float option</code></div><div class="doc"><p>Timeout in seconds for each function</p></div></div><div class="spec val" id="val-get_total"><a href="#val-get_total" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_total : unit <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"><p>Return the total number of symop's since the beginning</p></div></div><div class="spec val" id="val-pay"><a href="#val-pay" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pay : unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Count one symop</p></div></div><div class="spec val" id="val-reset_total"><a href="#val-reset_total" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>reset_total : unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Reset the total number of symop's</p></div></div><div class="spec val" id="val-restore_state"><a href="#val-restore_state" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>restore_state : <a href="index.html#type-t">t</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Restore the old state.</p></div></div><div class="spec val" id="val-save_state"><a href="#val-save_state" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>save_state : keep_symop_total:bool <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-t">t</a></code></div><div class="doc"><p>Return the old state, and revert the current state to the initial one.
If keep_symop_total is true, share the total counter.</p></div></div><div class="spec val" id="val-set_alarm"><a href="#val-set_alarm" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_alarm : unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Reset the counter and activate the alarm</p></div></div><div class="spec val" id="val-set_wallclock_alarm"><a href="#val-set_wallclock_alarm" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_wallclock_alarm : float <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Set the wallclock alarm checked at every pay()</p></div></div><div class="spec val" id="val-set_wallclock_timeout_handler"><a href="#val-set_wallclock_timeout_handler" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_wallclock_timeout_handler : (unit <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>set the handler for the wallclock timeout</p></div></div><div class="spec val" id="val-unset_alarm"><a href="#val-unset_alarm" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>unset_alarm : unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>De-activate the alarm</p></div></div><div class="spec val" id="val-unset_wallclock_alarm"><a href="#val-unset_wallclock_alarm" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>unset_wallclock_alarm : unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Unset the wallclock alarm checked at every pay()</p></div></div><div class="spec type" id="type-failure_kind"><a href="#type-failure_kind" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>failure_kind</code><code></code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-failure_kind.FKtimeout" class="anchored"><td class="def constructor"><a href="#type-failure_kind.FKtimeout" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">FKtimeout</span></code></td><td class="doc"><p>(** max time exceeded *)</p></td></tr><tr id="type-failure_kind.FKsymops_timeout" class="anchored"><td class="def constructor"><a href="#type-failure_kind.FKsymops_timeout" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">FKsymops_timeout</span><span class="keyword"> of </span>int</code></td><td class="doc"><p>(** max symop's exceeded *)</p></td></tr><tr id="type-failure_kind.FKrecursion_timeout" class="anchored"><td class="def constructor"><a href="#type-failure_kind.FKrecursion_timeout" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">FKrecursion_timeout</span><span class="keyword"> of </span>int</code></td><td class="doc"><p>(** max recursion level exceeded *)</p></td></tr><tr id="type-failure_kind.FKcrash" class="anchored"><td class="def constructor"><a href="#type-failure_kind.FKcrash" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">FKcrash</span><span class="keyword"> of </span>string</code></td><td class="doc"><p>(** uncaught exception or failed assertion *)</p></td></tr></table><code></code></div><div class="doc"></div></div><div class="spec exception" id="exception-Analysis_failure_exe"><a href="#exception-Analysis_failure_exe" class="anchor"></a><div class="def exception"><code><span class="keyword">exception </span></code><code><span class="exception">Analysis_failure_exe</span><span class="keyword"> of </span><a href="index.html#type-failure_kind">failure_kind</a></code></div><div class="doc"><p>Timeout exception</p></div></div><div class="spec val" id="val-exn_not_failure"><a href="#val-exn_not_failure" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>exn_not_failure : exn <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p>check that the exception is not a timeout exception</p></div></div><div class="spec val" id="val-try_finally"><a href="#val-try_finally" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>try_finally : f:(unit <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>) <span class="keyword">&#8209;&gt;</span> finally:(unit <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span></code></div><div class="doc"><p><code class="code">try_finally ~f ~finally</code> executes <code class="code">f</code> and then <code class="code">finally</code> even if <code class="code">f</code> raises an exception.
Assuming that <code class="code">finally ()</code> terminates quickly <code class="code">Analysis_failure_exe</code> exceptions are handled correctly.
In particular, an exception raised by <code class="code">f ()</code> is delayed until <code class="code">finally ()</code> finishes, so <code class="code">finally ()</code> should
return reasonably quickly.</p></div></div><div class="spec val" id="val-pp_failure_kind"><a href="#val-pp_failure_kind" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pp_failure_kind : Format.formatter <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-failure_kind">failure_kind</a> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-failure_kind_to_string"><a href="#val-failure_kind_to_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>failure_kind_to_string : <a href="index.html#type-failure_kind">failure_kind</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"></div></div></body></html>