This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<!DOCTYPE html>
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>Instrs (infer.IR.Instrs)</title><linkrel="stylesheet"href="../../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.1"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../../index.html">infer</a>»<ahref="../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><dtclass="spec type"id="type-reversed"><ahref="#type-reversed"class="anchor"></a><code><spanclass="keyword">type</span> reversed</code></dt><dtclass="spec type"id="type-not_reversed"><ahref="#type-not_reversed"class="anchor"></a><code><spanclass="keyword">type</span> not_reversed</code></dt><dtclass="spec type"id="type-t"><ahref="#type-t"class="anchor"></a><code><spanclass="keyword">type</span><span>_ t</span></code></dt><dtclass="spec type"id="type-not_reversed_t"><ahref="#type-not_reversed_t"class="anchor"></a><code><spanclass="keyword">type</span> not_reversed_t</code><code> = <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="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><dtclass="spec value"id="val-empty"><ahref="#val-empty"class="anchor"></a><code><spanclass="keyword">val</span> empty : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span></code></dt><dtclass="spec value"id="val-singleton"><ahref="#val-singleton"class="anchor"></a><code><spanclass="keyword">val</span> singleton : <ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span></code></dt><dtclass="spec value"id="val-append_list"><ahref="#val-append_list"class="anchor"></a><code><spanclass="keyword">val</span> append_list : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span><ahref="../Sil/index.html#type-instr">Sil.instr</a> list</span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span></code></dt><dtclass="spec value"id="val-of_list"><ahref="#val-of_list"class="anchor"></a><code><spanclass="keyword">val</span> of_list : <span><ahref="../Sil/index.html#type-instr">Sil.instr</a> list</span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span></code></dt><dtclass="spec value"id="val-filter_map"><ahref="#val-filter_map"class="anchor"></a><code><spanclass="keyword">val</span> filter_map : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><span><ahref="../Sil/index.html#type-instr">Sil.instr</a> option</span>)</span></span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span></code></dt><dtclass="spec value"id="val-map"><ahref="#val-map"class="anchor"></a><code><spanclass="keyword">val</span> map : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><ahref="../Sil/index.html#type-instr">Sil.instr</a>)</span></span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="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><dtclass="spec value"id="val-map_and_fold"><ahref="#val-map_and_fold"class="anchor"></a><code><spanclass="keyword">val</span> map_and_fold : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<spanclass="type-var">'a</span><span>-></span><ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><spanclass="type-var">'a</span> * <ahref="../Sil/index.html#type-instr">Sil.instr</a>)</span></span><span>-></span><span>init:<spanclass="type-var">'a</span></span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="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><dtclass="spec value"id="val-concat_map_and_fold"><ahref="#val-concat_map_and_fold"class="anchor"></a><code><spanclass="keyword">val</span> concat_map_and_fold : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<spanclass="type-var">'a</span><span>-></span><ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><spanclass="type-var">'a</span> * <span><ahref="../Sil/index.html#type-instr">Sil.instr</a> array</span>)</span></span><span>-></span><span>init:<spanclass="type-var">'a</span></span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span></code></dt><dd><p>Like <code>map_and_fold</code> but replace every instruction <code>instr</code> with the list <code>snd (f context instr)</code> by threading an accumulator. Preserve physical equality. *</p></dd></dl><dl><dtclass="spec value"id="val-concat_map"><ahref="#val-concat_map"class="anchor"></a><code><spanclass="keyword">val</span> concat_map : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><span><ahref="../Sil/index.html#type-instr">Sil.instr</a> array</span>)</span></span><span>-></span><span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="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><dtclass="spec value"id="val-reverse_order"><ahref="#val-reverse_order"class="anchor"></a><code><spanclass="keyword">val</span> reverse_order : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span><ahref="index.html#type-reversed">reversed</a><ahref="index.html#type-t">t</a></span></code></dt><dtclass="spec value"id="val-is_empty"><ahref="#val-is_empty"class="anchor"></a><code><spanclass="keyword">val</span> is_empty : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span> bool</code></dt><dtclass="spec value"id="val-count"><ahref="#val-count"class="anchor"></a><code><spanclass="keyword">val</span> count : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span> int</code></dt><dtclass="spec value"id="val-exists"><ahref="#val-exists"class="anchor"></a><code><spanclass="keyword">val</span> exists : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span> bool)</span></span><span>-></span> bool</code></dt><dtclass="spec value"id="val-for_all"><ahref="#val-for_all"class="anchor"></a><code><spanclass="keyword">val</span> for_all : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span> bool)</span></span><span>-></span> bool</code></dt><dtclass="spec value"id="val-nth_exists"><ahref="#val-nth_exists"class="anchor"></a><code><spanclass="keyword">val</span> nth_exists : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span> int <span>-></span> bool</code></dt><dtclass="spec value"id="val-nth_exn"><ahref="#val-nth_exn"class="anchor"></a><code><spanclass="keyword">val</span> nth_exn : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span> int <span>-></span><ahref="../Sil/index.html#type-instr">Sil.instr</a></code></dt><dtclass="spec value"id="val-last"><ahref="#val-last"class="anchor"></a><code><spanclass="keyword">val</span> last : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span><span><ahref="../Sil/index.html#type-instr">Sil.instr</a> option</span></code></dt><dtclass="spec value"id="val-find_map"><ahref="#val-find_map"class="anchor"></a><code><spanclass="keyword">val</span> find_map : <span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span><span>f:<span>(<ahref="../Sil/index.html#type-instr">Sil.instr</a><span>-></span><span><spanclass="type-var">'a</span> option</span>)</span></span><span>-></span><span><spanclass="type-var">'a</span> option</span></code></dt><dtclass="spec value"id="val-pp"><ahref="#val-pp"class="anchor"></a><code><spanclass="keyword">val</span> pp : <ahref="../../IStdlib/Pp/index.html#type-env">IStdlib.Pp.env</a><span>-></span> Stdlib.Format.formatter <span>-></span><span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span><span>-></span> unit</code></dt><dtclass="spec value"id="val-fold"><ahref="#val-fold"class="anchor"></a><code><spanclass="keyword">val</span> fold : <span><span>(<span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span>,<ahref="../Sil/index.html#type-instr">Sil.instr</a>,<spanclass="type-var">'a</span>)</span><ahref="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Container.fold</span></code></dt><dtclass="spec value"id="val-iter"><ahref="#val-iter"class="anchor"></a><code><spanclass="keyword">val</span> iter : <span><span>(<span><spanclass="type-var">_</span><ahref="index.html#type-t">t</a></span>,<ahref="../Sil/index.html#type-instr">Sil.instr</a>)</span><ahref="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Container.iter</span></code></dt><dtclass="spec value"id="val-get_underlying_not_reversed"><ahref="#val-get_underlying_not_reversed"class="anchor"></a><code><spanclass="keyword">val</span> get_underlying_not_reversed : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span><ahref="../Sil/index.html#type-instr">Sil.instr</a> array</span></code></dt><dtclass="spec value"id="val-instrs_get_normal_vars"><ahref="#val-instrs_get_normal_vars"class="anchor"></a><code><spanclass="keyword">val</span> instrs_get_normal_vars : <span><ahref="index.html#type-not_reversed">not_reversed</a><ahref="index.html#type-t">t</a></span><span>-></span><span><ahref="../Ident/index.html#type-t">Ident.t</a> list</span></code></dt></dl></div></body></html>