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
17 KiB

This file contains ambiguous Unicode 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>PulseAbductiveDomain (infer.Pulselib.PulseAbductiveDomain)</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">Pulselib</a> &#x00BB; PulseAbductiveDomain</nav><h1>Module <code>Pulselib.PulseAbductiveDomain</code></h1></header><div class="spec module" id="module-F"><a href="#module-F" class="anchor"></a><code><span class="keyword">module</span> F = Stdlib.Format</code></div><div class="spec module" id="module-BaseAddressAttributes"><a href="#module-BaseAddressAttributes" class="anchor"></a><code><span class="keyword">module</span> BaseAddressAttributes = <a href="../index.html#module-PulseBaseAddressAttributes">PulseBaseAddressAttributes</a></code></div><div class="spec module" id="module-BaseDomain"><a href="#module-BaseDomain" class="anchor"></a><code><span class="keyword">module</span> BaseDomain = <a href="../index.html#module-PulseBaseDomain">PulseBaseDomain</a></code></div><div class="spec module" id="module-BaseMemory"><a href="#module-BaseMemory" class="anchor"></a><code><span class="keyword">module</span> BaseMemory = <a href="../index.html#module-PulseBaseMemory">PulseBaseMemory</a></code></div><div class="spec module" id="module-BaseStack"><a href="#module-BaseStack" class="anchor"></a><code><span class="keyword">module</span> BaseStack = <a href="../index.html#module-PulseBaseStack">PulseBaseStack</a></code></div><aside><p>Layer on top of <a href="BaseDomain/index.html"><code>BaseDomain</code></a> to propagate operations on the current state to the pre-condition when necessary</p><p>The abstract type <code>t</code> is a pre/post pair in the style of biabduction.</p></aside><dl><dt class="spec module-type" id="module-type-BaseDomainSig"><a href="#module-type-BaseDomainSig" class="anchor"></a><code><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-BaseDomainSig/index.html">BaseDomainSig</a> = <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>signature common to the &quot;normal&quot; <code>Domain</code>, representing the post at the current program point, and the inverted <code>PreDomain</code>, representing the inferred pre-condition</p></dd></dl><dl><dt class="spec module" id="module-PostDomain"><a href="#module-PostDomain" class="anchor"></a><code><span class="keyword">module</span> <a href="PostDomain/index.html">PostDomain</a> : <a href="index.html#module-type-BaseDomainSig">BaseDomainSig</a></code></dt><dd><p>The post abstract state at each program point, or current state.</p></dd></dl><dl><dt class="spec module" id="module-PreDomain"><a href="#module-PreDomain" class="anchor"></a><code><span class="keyword">module</span> <a href="PreDomain/index.html">PreDomain</a> : <a href="index.html#module-type-BaseDomainSig">BaseDomainSig</a></code></dt><dd><p>The inferred pre-condition at each program point, biabduction style.</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <span class="keyword">private</span> </code><code>{</code><table class="record"><tr id="type-t.post" class="anchored"><td class="def field"><a href="#type-t.post" class="anchor"></a><code>post : <a href="PostDomain/index.html#type-t">PostDomain.t</a>;</code></td><td class="doc"><p>state at the current program point</p></td></tr><tr id="type-t.pre" class="anchored"><td class="def field"><a href="#type-t.pre" class="anchor"></a><code>pre : <a href="PreDomain/index.html#type-t">PreDomain.t</a>;</code></td><td class="doc"><p>inferred procedure pre-condition leading to the current program point</p></td></tr><tr id="type-t.path_condition" class="anchored"><td class="def field"><a href="#type-t.path_condition" class="anchor"></a><code>path_condition : <a href="../PulsePathCondition/index.html#type-t">PulseBasicInterface.PathCondition.t</a>;</code></td><td class="doc"><p>arithmetic facts true along the path (holding for both <code>pre</code> and <code>post</code> since abstract values are immutable)</p></td></tr><tr id="type-t.topl" class="anchored"><td class="def field"><a href="#type-t.topl" class="anchor"></a><code>topl : <a href="../PulseTopl/index.html#type-state">PulseTopl.state</a>;</code></td><td class="doc"><p>state at of the Topl monitor at the current program point, when Topl is enabled</p></td></tr><tr id="type-t.skipped_calls" class="anchored"><td class="def field"><a href="#type-t.skipped_calls" class="anchor"></a><code>skipped_calls : <a href="../PulseSkippedCalls/index.html#type-t">PulseBasicInterface.SkippedCalls.t</a>;</code></td><td class="doc"><p>metadata: procedure calls for which no summary was found</p></td></tr></table><code>}</code></dt><dd><p>pre/post on a single program path</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span class="keyword">val</span> equal : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-leq"><a href="#val-leq" class="anchor"></a><code><span class="keyword">val</span> leq : <span>lhs:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span>rhs:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-mk_initial"><a href="#val-mk_initial" class="anchor"></a><code><span class="keyword">val</span> mk_initial : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-get_pre"><a href="#val-get_pre" class="anchor"></a><code><span class="keyword">val</span> get_pre : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../PulseBaseDomain/index.html#type-t">BaseDomain.t</a></code></dt><dt class="spec value" id="val-get_post"><a href="#val-get_post" class="anchor"></a><code><span class="keyword">val</span> get_post : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../PulseBaseDomain/index.html#type-t">BaseDomain.t</a></code></dt><dt class="spec value" id="val-simplify_instanceof"><a href="#val-simplify_instanceof" class="anchor"></a><code><span class="keyword">val</span> simplify_instanceof : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec module" id="module-Stack"><a href="#module-Stack" class="anchor"></a><code><span class="keyword">module</span> <a href="Stack/index.html">Stack</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>stack operations like <a href="BaseStack/index.html"><code>BaseStack</code></a> but that also take care of propagating facts to the precondition</p></dd></dl><dl><dt class="spec module" id="module-Memory"><a href="#module-Memory" class="anchor"></a><code><span class="keyword">module</span> <a href="Memory/index.html">Memory</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>memory operations like <a href="BaseMemory/index.html"><code>BaseMemory</code></a> but that also take care of propagating facts to the precondition</p></dd></dl><dl><dt class="spec module" id="module-AddressAttributes"><a href="#module-AddressAttributes" class="anchor"></a><code><span class="keyword">module</span> <a href="AddressAttributes/index.html">AddressAttributes</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>attribute operations like <a href="BaseAddressAttributes/index.html"><code>BaseAddressAttributes</code></a> but that also take care of propagating facts to the precondition</p></dd></dl><dl><dt class="spec value" id="val-is_local"><a href="#val-is_local" class="anchor"></a><code><span class="keyword">val</span> is_local : <a href="../../IR/Var/index.html#type-t">IR.Var.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-find_post_cell_opt"><a href="#val-find_post_cell_opt" class="anchor"></a><code><span class="keyword">val</span> find_post_cell_opt : <a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="../PulseBaseDomain/index.html#type-cell">BaseDomain.cell</a> option</span></code></dt><dt class="spec value" id="val-discard_unreachable"><a href="#val-discard_unreachable" class="anchor"></a><code><span class="keyword">val</span> discard_unreachable : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> * <a href="../../Pulselib__PulseAbstractValue/index.html#module-Set">Pulselib.PulseBasicInterface.AbstractValue.Set</a>.t * <span><a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a> list</span></code></dt><dd><p>garbage collect unreachable addresses in the state to make it smaller and return the new state, the live addresses, and the discarded addresses that used to have attributes attached</p></dd></dl><dl><dt class="spec value" id="val-add_skipped_call"><a href="#val-add_skipped_call" class="anchor"></a><code><span class="keyword">val</span> add_skipped_call : <a href="../../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <a href="../PulseTrace/index.html#type-t">PulseBasicInterface.Trace.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-add_skipped_calls"><a href="#val-add_skipped_calls" class="anchor"></a><code><span class="keyword">val</span> add_skipped_calls : <a href="../PulseSkippedCalls/index.html#type-t">PulseBasicInterface.SkippedCalls.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-set_path_condition"><a href="#val-set_path_condition" class="anchor"></a><code><span class="keyword">val</span> set_path_condition : <a href="../PulsePathCondition/index.html#type-t">PulseBasicInterface.PathCondition.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-summary"><a href="#type-summary" class="anchor"></a><code><span class="keyword">type</span> summary</code><code> = <span class="keyword">private</span> <a href="index.html#type-t">t</a></code></dt><dd><p>private type to make sure <a href="index.html#val-summary_of_post"><code>summary_of_post</code></a> is always called when creating summaries</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_summary"><a href="#val-compare_summary" class="anchor"></a><code><span class="keyword">val</span> compare_summary : <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> int</code></dt><dt class="spec value" id="val-equal_summary"><a href="#val-equal_summary" class="anchor"></a><code><span class="keyword">val</span> equal_summary : <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-yojson_of_summary"><a href="#val-yojson_of_summary" class="anchor"></a><code><span class="keyword">val</span> yojson_of_summary : <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> Ppx_yojson_conv_lib.Yojson.Safe.t</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-summary_of_post"><a href="#val-summary_of_post" class="anchor"></a><code><span class="keyword">val</span> summary_of_post : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="index.html#type-summary">summary</a> <a href="../PulseSatUnsat/index.html#type-t">PulseBasicInterface.SatUnsat.t</a></span></code></dt><dd><p>trim the state down to just the procedure's interface (formals and globals), and simplify and normalize the state</p></dd></dl><dl><dt class="spec value" id="val-set_post_edges"><a href="#val-set_post_edges" class="anchor"></a><code><span class="keyword">val</span> set_post_edges : <a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../../Pulselib__PulseBaseMemory/Edges/index.html#type-t">BaseMemory.Edges.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>directly set the edges for the given address, bypassing abduction altogether</p></dd></dl><dl><dt class="spec value" id="val-set_post_cell"><a href="#val-set_post_cell" class="anchor"></a><code><span class="keyword">val</span> set_post_cell : <span>(<a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a> * <a href="../PulseValueHistory/index.html#type-t">PulseBasicInterface.ValueHistory.t</a>)</span> <span>&#45;&gt;</span> <a href="../PulseBaseDomain/index.html#type-cell">BaseDomain.cell</a> <span>&#45;&gt;</span> <a href="../../IBase/Location/index.html#type-t">IBase.Location.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>directly set the edges and attributes for the given address, bypassing abduction altogether</p></dd></dl><dl><dt class="spec value" id="val-incorporate_new_eqs"><a href="#val-incorporate_new_eqs" class="anchor"></a><code><span class="keyword">val</span> incorporate_new_eqs : <a href="../PulsePathCondition/index.html#type-new_eqs">PulseBasicInterface.PathCondition.new_eqs</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Check that the new equalities discovered are compatible with the current pre and post heaps, e.g. <code>x = 0</code> is not compatible with <code>x</code> being allocated, and <code>x = y</code> is not compatible with <code>x</code> and <code>y</code> being allocated separately. In those cases, the resulting path condition is <span class="xref-unresolved" title="unresolved reference to &quot;PathCondition.false_&quot;"><code>PathCondition</code>.false_</span>.</p></dd></dl><dl><dt class="spec value" id="val-initialize"><a href="#val-initialize" class="anchor"></a><code><span class="keyword">val</span> initialize : <a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Remove &quot;Uninitialized&quot; attribute of the given address</p></dd></dl><dl><dt class="spec value" id="val-set_uninitialized"><a href="#val-set_uninitialized" class="anchor"></a><code><span class="keyword">val</span> set_uninitialized : <a href="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <span>[ <span>`LocalDecl of <a href="../../IR/Pvar/index.html#type-t">IR.Pvar.t</a> * <span><a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a> option</span></span> <span><span>| `Malloc</span> of <a href="../PulseAbstractValue/index.html#type-t">PulseBasicInterface.AbstractValue.t</a></span> ]</span> <span>&#45;&gt;</span> <a href="../../IR/Typ/index.html#type-t">IR.Typ.t</a> <span>&#45;&gt;</span> <a href="../../IBase/Location/index.html#type-t">IBase.Location.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Add &quot;Uninitialized&quot; attributes when a variable is declared or a memory is allocated by malloc.</p></dd></dl><div class="spec module" id="module-Topl"><a href="#module-Topl" class="anchor"></a><code><span class="keyword">module</span> <a href="Topl/index.html">Topl</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div></div></body></html>