sidekick/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Term/index.html
2021-12-07 15:22:59 +00:00

8 lines
No EOL
7.1 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>Term (sidekick-bin.Sidekick_smtlib.Process.Solver.T.Term)</title><link rel="stylesheet" href="../../../../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.0.2"/><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-bin</a> &#x00BB; <a href="../../../../index.html">Sidekick_smtlib</a> &#x00BB; <a href="../../../index.html">Process</a> &#x00BB; <a href="../../index.html">Solver</a> &#x00BB; <a href="../index.html">T</a> &#x00BB; Term</nav><header class="odoc-preamble"><h1>Module <code><span>T.Term</span></code></h1><p>Term structure.</p><p>Terms should be <b>hashconsed</b>, with perfect sharing. This allows, for example, <a href="Tbl/index.html"><code>Term.Tbl</code></a> and <a href="#val-iter_dag"><code>Term.iter_dag</code></a> to be efficient.</p></header><div class="odoc-content"><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><span> = <a href="../../../../../../sidekick-base/Sidekick_base/Base_types/Term/index.html#type-t">Sidekick_base.Term.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-equal" class="anchored"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-compare" class="anchored"><a href="#val-compare" class="anchor"></a><code><span><span class="keyword">val</span> compare : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <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-hash" class="anchored"><a href="#val-hash" class="anchor"></a><code><span><span class="keyword">val</span> hash : <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-pp" class="anchored"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><a href="#type-t">t</a> <a href="../../../../../../sidekick/Sidekick_core/index.html">Sidekick_core</a>.Fmt.printer</span></span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-store" class="anchored"><a href="#type-store" class="anchor"></a><code><span><span class="keyword">type</span> store</span><span> = <a href="../../../../../../sidekick-base/Sidekick_base/Base_types/Term/index.html#type-store">Sidekick_base.Term.store</a></span></code></div><div class="spec-doc"><p>A store used to create new terms. It is where the hashconsing table should live, along with other all-terms related store.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-ty" class="anchored"><a href="#val-ty" class="anchor"></a><code><span><span class="keyword">val</span> ty : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../Ty/index.html#type-t">Ty.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-bool" class="anchored"><a href="#val-bool" class="anchor"></a><code><span><span class="keyword">val</span> bool : <span><a href="#type-store">store</a> <span class="arrow">&#45;&gt;</span></span> <span>bool <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>build true/false</p></div></div><div class="odoc-spec"><div class="spec value" id="val-as_bool" class="anchored"><a href="#val-as_bool" class="anchor"></a><code><span><span class="keyword">val</span> as_bool : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>bool option</span></span></code></div><div class="spec-doc"><p><code>as_bool t</code> is <code>Some true</code> if <code>t</code> is the term <code>true</code>, and similarly for <code>false</code>. For other terms it is <code>None</code>.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-abs" class="anchored"><a href="#val-abs" class="anchor"></a><code><span><span class="keyword">val</span> abs : <span><a href="#type-store">store</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a> * bool</span></code></div><div class="spec-doc"><p><code>abs t</code> returns an &quot;absolute value&quot; for the term, along with the sign of <code>t</code>.</p><p>The idea is that we want to turn <code>not a</code> into <code>(a, false)</code>, or <code>(a != b)</code> into <code>(a=b, false)</code>. For terms without a negation this should return <code>(t, true)</code>.</p><p>The store is passed in case a new term needs to be created.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-map_shallow" class="anchored"><a href="#val-map_shallow" class="anchor"></a><code><span><span class="keyword">val</span> map_shallow : <span><a href="#type-store">store</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a>)</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-t">t</a></span></code></div><div class="spec-doc"><p>Map function on immediate subterms. This should not be recursive.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-iter_dag" class="anchored"><a href="#val-iter_dag" class="anchor"></a><code><span><span class="keyword">val</span> iter_dag : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>iter_dag t f</code> calls <code>f</code> once on each subterm of <code>t</code>, <code>t</code> included. It must <b>not</b> traverse <code>t</code> as a tree, but rather as a perfectly shared DAG.</p><p>For example, in:</p><pre><code>let x = 2 in
let y = f x x in
let z = g y x in
z = z</code></pre><p>the DAG has the following nodes:</p><pre><code>n1: 2
n2: f n1 n1
n3: g n2 n1
n4: = n3 n3</code></pre></div></div><div class="odoc-spec"><div class="spec module" id="module-Tbl" class="anchored"><a href="#module-Tbl" class="anchor"></a><code><span><span class="keyword">module</span> </span><span>Tbl</span><span> : <span class="xref-unresolved">CCHashtbl</span>.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">key</span> = <span class="xref-unresolved">t</span></span></span></code></div></div></div></body></html>