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.

2 lines
12 KiB

This file contains invisible Unicode characters!

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>
<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.2"/><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> &#x00BB; <a href="../index.html">IR</a> &#x00BB; 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>&#45;&gt;</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>&#45;&gt;</span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> list</span> <span>&#45;&gt;</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>&#45;&gt;</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>&#45;&gt;</span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> option</span>)</span></span> <span>&#45;&gt;</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>&#45;&gt;</span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <a href="../Sil/index.html#type-instr">Sil.instr</a>)</span></span> <span>&#45;&gt;</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>&#45;&gt;</span> <span>f:<span>(<span class="type-var">'a</span> <span>&#45;&gt;</span> <a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> * <a href="../Sil/index.html#type-instr">Sil.instr</a>)</span></span> <span>&#45;&gt;</span> <span>init:<span class="type-var">'a</span></span> <span>&#45;&gt;</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_and_fold"><a href="#val-concat_map_and_fold" class="anchor"></a><code><span class="keyword">val</span> concat_map_and_fold : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span>f:<span>(<span class="type-var">'a</span> <span>&#45;&gt;</span> <a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> * <span><a href="../Sil/index.html#type-instr">Sil.instr</a> array</span>)</span></span> <span>&#45;&gt;</span> <span>init:<span class="type-var">'a</span></span> <span>&#45;&gt;</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>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><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>&#45;&gt;</span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> array</span>)</span></span> <span>&#45;&gt;</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>&#45;&gt;</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>&#45;&gt;</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>&#45;&gt;</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>&#45;&gt;</span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> bool)</span></span> <span>&#45;&gt;</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>&#45;&gt;</span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> bool)</span></span> <span>&#45;&gt;</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>&#45;&gt;</span> int <span>&#45;&gt;</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>&#45;&gt;</span> int <span>&#45;&gt;</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>&#45;&gt;</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>&#45;&gt;</span> <span>f:<span>(<a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span>)</span></span> <span>&#45;&gt;</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>&#45;&gt;</span> Stdlib.Format.formatter <span>&#45;&gt;</span> <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>&#45;&gt;</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-foldi"><a href="#val-foldi" class="anchor"></a><code><span class="keyword">val</span> foldi : <span><span class="type-var">_</span> <a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span>init:<span class="type-var">'a</span></span> <span>&#45;&gt;</span> <span>f:<span>(int <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <a href="../Sil/index.html#type-instr">Sil.instr</a> <span>&#45;&gt;</span> <span class="type-var">'a</span>)</span></span> <span>&#45;&gt;</span> <span class="type-var">'a</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>&#45;&gt;</span> <span><a href="../Sil/index.html#type-instr">Sil.instr</a> array</span></code></dt><dt class="spec value" id="val-instrs_get_normal_vars"><a href="#val-instrs_get_normal_vars" class="anchor"></a><code><span class="keyword">val</span> instrs_get_normal_vars : <span><a href="index.html#type-not_reversed">not_reversed</a> <a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span><a href="../Ident/index.html#type-t">Ident.t</a> list</span></code></dt></dl></div></body></html>