<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Instrs (infer.IR.Instrs)</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">infer</a> » <a href="../index.html">IR</a> » Instrs</nav><h1>Module <code>IR.Instrs</code></h1></header><aside><p>Manipulate possibly-reversed lists of instructions efficiently</p></aside><dl><dt class="spec type" id="type-reversed"><a href="#type-reversed" class="anchor"></a><code><span class="keyword">type</span> reversed</code></dt><dt class="spec type" id="type-not_reversed"><a href="#type-not_reversed" class="anchor"></a><code><span class="keyword">type</span> not_reversed</code></dt><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> <span>_ t</span></code></dt><dt class="spec type" id="type-not_reversed_t"><a href="#type-not_reversed_t" class="anchor"></a><code><span class="keyword">type</span> not_reversed_t</code><code> = <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dd><p>defined for convenience: we can write <code>Instrs.not_reversed_t</code> in other modules instead of <code>Instrs.not_reversed Instrs.t</code></p></dd></dl><dl><dt class="spec value" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span class="keyword">val</span> empty : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-singleton"><a href="#val-singleton" class="anchor"></a><code><span class="keyword">val</span> singleton : <a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-append_list"><a href="#val-append_list" class="anchor"></a><code><span class="keyword">val</span> append_list : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> list</span> <span>-></span> <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-of_list"><a href="#val-of_list" class="anchor"></a><code><span class="keyword">val</span> of_list : <span><a href="../Sil/index.html#type-instr">Sil.instr</a> list</span> <span>-></span> <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-filter_map"><a href="#val-filter_map" class="anchor"></a><code><span class="keyword">val</span> filter_map : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> option</span>)</span></span> <span>-></span> <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-map"><a href="#val-map" class="anchor"></a><code><span class="keyword">val</span> map : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> <a href="../Sil/index.html#type-instr">Sil.instr</a>)</span></span> <span>-></span> <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dd><p>replace every instruction <code>instr</code> with <code>f instr</code>. Preserve physical equality. *</p></dd></dl><dl><dt class="spec value" id="val-map_and_fold"><a href="#val-map_and_fold" class="anchor"></a><code><span class="keyword">val</span> map_and_fold : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<span class="type-var">'a</span> <span>-></span> <a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> <span class="type-var">'a</span> * <a href="../Sil/index.html#type-instr">Sil.instr</a>)</span></span> <span>-></span> <span>init:<span class="type-var">'a</span></span> <span>-></span> <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dd><p>replace every instruction <code>instr</code> with <code>snd (f context instr)</code>. The context is computed by folding <code>f</code> on <code>init</code> and previous instructions (before <code>instr</code>) in the collection. Preserve physical equality. *</p></dd></dl><dl><dt class="spec value" id="val-concat_map"><a href="#val-concat_map" class="anchor"></a><code><span class="keyword">val</span> concat_map : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> array</span>)</span></span> <span>-></span> <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dd><p>replace every instruction <code>instr</code> with the list <code>f instr</code>. Preserve physical equality. *</p></dd></dl><dl><dt class="spec value" id="val-reverse_order"><a href="#val-reverse_order" class="anchor"></a><code><span class="keyword">val</span> reverse_order : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span><a href="index.html#type-reversed">reversed</a> <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-is_empty"><a href="#val-is_empty" class="anchor"></a><code><span class="keyword">val</span> is_empty : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> bool</code></dt><dt class="spec value" id="val-count"><a href="#val-count" class="anchor"></a><code><span class="keyword">val</span> count : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> int</code></dt><dt class="spec value" id="val-exists"><a href="#val-exists" class="anchor"></a><code><span class="keyword">val</span> exists : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> bool)</span></span> <span>-></span> bool</code></dt><dt class="spec value" id="val-for_all"><a href="#val-for_all" class="anchor"></a><code><span class="keyword">val</span> for_all : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> bool)</span></span> <span>-></span> bool</code></dt><dt class="spec value" id="val-nth_exists"><a href="#val-nth_exists" class="anchor"></a><code><span class="keyword">val</span> nth_exists : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> int <span>-></span> bool</code></dt><dt class="spec value" id="val-nth_exn"><a href="#val-nth_exn" class="anchor"></a><code><span class="keyword">val</span> nth_exn : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> int <span>-></span> <a href="../Sil/index.html#type-instr">Sil.instr</a></code></dt><dt class="spec value" id="val-last"><a href="#val-last" class="anchor"></a><code><span class="keyword">val</span> last : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> option</span></code></dt><dt class="spec value" id="val-find_map"><a href="#val-find_map" class="anchor"></a><code><span class="keyword">val</span> find_map : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>-></span> <span><span class="type-var">'a</span> option</span>)</span></span> <span>-></span> <span><span class="type-var">'a</span> option</span></code></dt><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : <a href="../../IStdlib/Pp/index.html#type-env">IStdlib.Pp.env</a> <span>-></span> Stdlib.Format.formatter <span>-></span> <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>-></span> unit</code></dt><dt class="spec value" id="val-fold"><a href="#val-fold" class="anchor"></a><code><span class="keyword">val</span> fold : <span><span>(<span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span>, <a href="../Sil/index.html#type-instr">Sil.instr</a>, <span class="type-var">'a</span>)</span> <a href="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Container.fold</span></code></dt><dt class="spec value" id="val-iter"><a href="#val-iter" class="anchor"></a><code><span class="keyword">val</span> iter : <span><span>(<span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span>, <a href="../Sil/index.html#type-instr">Sil.instr</a>)</span> <a href="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Container.iter</span></code></dt><dt class="spec value" id="val-get_underlying_not_reversed"><a href="#val-get_underlying_not_reversed" class="anchor"></a><code><span class="keyword">val</span> get_underlying_not_reversed : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>-></span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> array</span></code></dt></dl></div></body></html>