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
21 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>PredSymb (infer.IR.PredSymb)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><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; PredSymb</nav><h1>Module <code>IR.PredSymb</code></h1><nav class="toc"><ul><li><a href="#programs-and-types">Programs and Types</a></li></ul></nav></header><aside><p>The Smallfoot Intermediate Language: Predicate Symbols</p></aside><section><header><h3 id="programs-and-types"><a href="#programs-and-types" class="anchor"></a>Programs and Types</h3></header><dl><dt class="spec type" id="type-access"><a href="#type-access" class="anchor"></a><code><span class="keyword">type</span> access</code><code> = </code><table class="variant"><tr id="type-access.Default" class="anchored"><td class="def constructor"><a href="#type-access.Default" class="anchor"></a><code>| </code><code><span class="constructor">Default</span></code></td></tr><tr id="type-access.Public" class="anchored"><td class="def constructor"><a href="#type-access.Public" class="anchor"></a><code>| </code><code><span class="constructor">Public</span></code></td></tr><tr id="type-access.Private" class="anchored"><td class="def constructor"><a href="#type-access.Private" class="anchor"></a><code>| </code><code><span class="constructor">Private</span></code></td></tr><tr id="type-access.Protected" class="anchored"><td class="def constructor"><a href="#type-access.Protected" class="anchor"></a><code>| </code><code><span class="constructor">Protected</span></code></td></tr></table></dt><dd><p>Visibility modifiers.</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_access"><a href="#val-compare_access" class="anchor"></a><code><span class="keyword">val</span> compare_access : <a href="index.html#type-access">access</a> <span>&#45;&gt;</span> <a href="index.html#type-access">access</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-equal_access"><a href="#val-equal_access" class="anchor"></a><code><span class="keyword">val</span> equal_access : <a href="index.html#type-access">access</a> <span>&#45;&gt;</span> <a href="index.html#type-access">access</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-string_of_access"><a href="#val-string_of_access" class="anchor"></a><code><span class="keyword">val</span> string_of_access : <a href="index.html#type-access">access</a> <span>&#45;&gt;</span> string</code></dt></dl><dl><dt class="spec type" id="type-mem_kind"><a href="#type-mem_kind" class="anchor"></a><code><span class="keyword">type</span> mem_kind</code><code> = </code><table class="variant"><tr id="type-mem_kind.Mmalloc" class="anchored"><td class="def constructor"><a href="#type-mem_kind.Mmalloc" class="anchor"></a><code>| </code><code><span class="constructor">Mmalloc</span></code></td><td class="doc"><p>memory allocated with malloc</p></td></tr><tr id="type-mem_kind.Mnew" class="anchored"><td class="def constructor"><a href="#type-mem_kind.Mnew" class="anchor"></a><code>| </code><code><span class="constructor">Mnew</span></code></td><td class="doc"><p>memory allocated with new</p></td></tr><tr id="type-mem_kind.Mnew_array" class="anchored"><td class="def constructor"><a href="#type-mem_kind.Mnew_array" class="anchor"></a><code>| </code><code><span class="constructor">Mnew_array</span></code></td><td class="doc"><p>memory allocated with new<code></code></p></td></tr><tr id="type-mem_kind.Mobjc" class="anchored"><td class="def constructor"><a href="#type-mem_kind.Mobjc" class="anchor"></a><code>| </code><code><span class="constructor">Mobjc</span></code></td><td class="doc"><p>memory allocated with objective-c alloc</p></td></tr></table></dt></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_mem_kind"><a href="#val-compare_mem_kind" class="anchor"></a><code><span class="keyword">val</span> compare_mem_kind : <a href="index.html#type-mem_kind">mem_kind</a> <span>&#45;&gt;</span> <a href="index.html#type-mem_kind">mem_kind</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec type" id="type-resource"><a href="#type-resource" class="anchor"></a><code><span class="keyword">type</span> resource</code><code> = </code><table class="variant"><tr id="type-resource.Rmemory" class="anchored"><td class="def constructor"><a href="#type-resource.Rmemory" class="anchor"></a><code>| </code><code><span class="constructor">Rmemory</span> <span class="keyword">of</span> <a href="index.html#type-mem_kind">mem_kind</a></code></td></tr><tr id="type-resource.Rfile" class="anchored"><td class="def constructor"><a href="#type-resource.Rfile" class="anchor"></a><code>| </code><code><span class="constructor">Rfile</span></code></td></tr><tr id="type-resource.Rignore" class="anchored"><td class="def constructor"><a href="#type-resource.Rignore" class="anchor"></a><code>| </code><code><span class="constructor">Rignore</span></code></td></tr><tr id="type-resource.Rlock" class="anchored"><td class="def constructor"><a href="#type-resource.Rlock" class="anchor"></a><code>| </code><code><span class="constructor">Rlock</span></code></td></tr></table></dt><dd><p>resource that can be allocated</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_resource"><a href="#val-compare_resource" class="anchor"></a><code><span class="keyword">val</span> compare_resource : <a href="index.html#type-resource">resource</a> <span>&#45;&gt;</span> <a href="index.html#type-resource">resource</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec type" id="type-res_act_kind"><a href="#type-res_act_kind" class="anchor"></a><code><span class="keyword">type</span> res_act_kind</code><code> = </code><table class="variant"><tr id="type-res_act_kind.Racquire" class="anchored"><td class="def constructor"><a href="#type-res_act_kind.Racquire" class="anchor"></a><code>| </code><code><span class="constructor">Racquire</span></code></td></tr><tr id="type-res_act_kind.Rrelease" class="anchored"><td class="def constructor"><a href="#type-res_act_kind.Rrelease" class="anchor"></a><code>| </code><code><span class="constructor">Rrelease</span></code></td></tr></table></dt><dd><p>kind of resource action</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_res_act_kind"><a href="#val-compare_res_act_kind" class="anchor"></a><code><span class="keyword">val</span> compare_res_act_kind : <a href="index.html#type-res_act_kind">res_act_kind</a> <span>&#45;&gt;</span> <a href="index.html#type-res_act_kind">res_act_kind</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-equal_res_act_kind"><a href="#val-equal_res_act_kind" class="anchor"></a><code><span class="keyword">val</span> equal_res_act_kind : <a href="index.html#type-res_act_kind">res_act_kind</a> <span>&#45;&gt;</span> <a href="index.html#type-res_act_kind">res_act_kind</a> <span>&#45;&gt;</span> bool</code></dt></dl><dl><dt class="spec type" id="type-dangling_kind"><a href="#type-dangling_kind" class="anchor"></a><code><span class="keyword">type</span> dangling_kind</code><code> = </code><table class="variant"><tr id="type-dangling_kind.DAuninit" class="anchored"><td class="def constructor"><a href="#type-dangling_kind.DAuninit" class="anchor"></a><code>| </code><code><span class="constructor">DAuninit</span></code></td><td class="doc"><p>pointer is dangling because it is uninitialized</p></td></tr><tr id="type-dangling_kind.DAaddr_stack_var" class="anchored"><td class="def constructor"><a href="#type-dangling_kind.DAaddr_stack_var" class="anchor"></a><code>| </code><code><span class="constructor">DAaddr_stack_var</span></code></td><td class="doc"><p>pointer is dangling because it is the address of a stack variable which went out of scope</p></td></tr><tr id="type-dangling_kind.DAminusone" class="anchored"><td class="def constructor"><a href="#type-dangling_kind.DAminusone" class="anchor"></a><code>| </code><code><span class="constructor">DAminusone</span></code></td><td class="doc"><p>pointer is -1</p></td></tr></table></dt><dd><p>kind of dangling pointers</p></dd></dl><dl><dt class="spec type" id="type-path_pos"><a href="#type-path_pos" class="anchor"></a><code><span class="keyword">type</span> path_pos</code><code> = <a href="../Procname/index.html#type-t">Procname.t</a> * int</code></dt><dd><p>position in a path: proc name, node id</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_path_pos"><a href="#val-compare_path_pos" class="anchor"></a><code><span class="keyword">val</span> compare_path_pos : <a href="index.html#type-path_pos">path_pos</a> <span>&#45;&gt;</span> <a href="index.html#type-path_pos">path_pos</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-equal_path_pos"><a href="#val-equal_path_pos" class="anchor"></a><code><span class="keyword">val</span> equal_path_pos : <a href="index.html#type-path_pos">path_pos</a> <span>&#45;&gt;</span> <a href="index.html#type-path_pos">path_pos</a> <span>&#45;&gt;</span> bool</code></dt></dl><dl><dt class="spec type" id="type-res_action"><a href="#type-res_action" class="anchor"></a><code><span class="keyword">type</span> res_action</code><code> = </code><code>{</code><table class="record"><tr id="type-res_action.ra_kind" class="anchored"><td class="def field"><a href="#type-res_action.ra_kind" class="anchor"></a><code>ra_kind : <a href="index.html#type-res_act_kind">res_act_kind</a>;</code></td><td class="doc"><p>kind of action</p></td></tr><tr id="type-res_action.ra_res" class="anchored"><td class="def field"><a href="#type-res_action.ra_res" class="anchor"></a><code>ra_res : <a href="index.html#type-resource">resource</a>;</code></td><td class="doc"><p>kind of resource</p></td></tr><tr id="type-res_action.ra_pname" class="anchored"><td class="def field"><a href="#type-res_action.ra_pname" class="anchor"></a><code>ra_pname : <a href="../Procname/index.html#type-t">Procname.t</a>;</code></td><td class="doc"><p>name of the procedure used to acquire/release the resource</p></td></tr><tr id="type-res_action.ra_loc" class="anchored"><td class="def field"><a href="#type-res_action.ra_loc" class="anchor"></a><code>ra_loc : <a href="../../IBase/Location/index.html#type-t">IBase.Location.t</a>;</code></td><td class="doc"><p>location of the acquire/release</p></td></tr><tr id="type-res_action.ra_vpath" class="anchored"><td class="def field"><a href="#type-res_action.ra_vpath" class="anchor"></a><code>ra_vpath : <a href="../DecompiledExp/index.html#type-vpath">DecompiledExp.vpath</a>;</code></td><td class="doc"><p>vpath of the resource value</p></td></tr></table><code>}</code></dt><dd><p>acquire/release action on a resource</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> = </code><table class="variant"><tr id="type-t.Aresource" class="anchored"><td class="def constructor"><a href="#type-t.Aresource" class="anchor"></a><code>| </code><code><span class="constructor">Aresource</span> <span class="keyword">of</span> <a href="index.html#type-res_action">res_action</a></code></td><td class="doc"><p>resource acquire/release</p></td></tr><tr id="type-t.Aautorelease" class="anchored"><td class="def constructor"><a href="#type-t.Aautorelease" class="anchor"></a><code>| </code><code><span class="constructor">Aautorelease</span></code></td></tr><tr id="type-t.Adangling" class="anchored"><td class="def constructor"><a href="#type-t.Adangling" class="anchor"></a><code>| </code><code><span class="constructor">Adangling</span> <span class="keyword">of</span> <a href="index.html#type-dangling_kind">dangling_kind</a></code></td><td class="doc"><p>dangling pointer</p></td></tr><tr id="type-t.Aundef" class="anchored"><td class="def constructor"><a href="#type-t.Aundef" class="anchor"></a><code>| </code><code><span class="constructor">Aundef</span> <span class="keyword">of</span> <a href="../Procname/index.html#type-t">Procname.t</a> * <a href="../Annot/Item/index.html#type-t">Annot.Item.t</a> * <a href="../../IBase/Location/index.html#type-t">IBase.Location.t</a> * <a href="index.html#type-path_pos">path_pos</a></code></td></tr><tr id="type-t.Alocked" class="anchored"><td class="def constructor"><a href="#type-t.Alocked" class="anchor"></a><code>| </code><code><span class="constructor">Alocked</span></code></td></tr><tr id="type-t.Aunlocked" class="anchored"><td class="def constructor"><a href="#type-t.Aunlocked" class="anchor"></a><code>| </code><code><span class="constructor">Aunlocked</span></code></td></tr><tr id="type-t.Adiv0" class="anchored"><td class="def constructor"><a href="#type-t.Adiv0" class="anchor"></a><code>| </code><code><span class="constructor">Adiv0</span> <span class="keyword">of</span> <a href="index.html#type-path_pos">path_pos</a></code></td><td class="doc"><p>value appeared in second argument of division at given path position</p></td></tr><tr id="type-t.Aobjc_null" class="anchored"><td class="def constructor"><a href="#type-t.Aobjc_null" class="anchor"></a><code>| </code><code><span class="constructor">Aobjc_null</span></code></td><td class="doc"><p>attributed exp is null due to a call to a method with given path as null receiver</p></td></tr><tr id="type-t.Aretval" class="anchored"><td class="def constructor"><a href="#type-t.Aretval" class="anchor"></a><code>| </code><code><span class="constructor">Aretval</span> <span class="keyword">of</span> <a href="../Procname/index.html#type-t">Procname.t</a> * <a href="../Annot/Item/index.html#type-t">Annot.Item.t</a></code></td><td class="doc"><p>value was returned from a call to the given procedure, plus the annots of the return value</p></td></tr><tr id="type-t.Aobserver" class="anchored"><td class="def constructor"><a href="#type-t.Aobserver" class="anchor"></a><code>| </code><code><span class="constructor">Aobserver</span></code></td><td class="doc"><p>denotes an object registered as an observers to a notification center</p></td></tr><tr id="type-t.Aunsubscribed_observer" class="anchored"><td class="def constructor"><a href="#type-t.Aunsubscribed_observer" class="anchor"></a><code>| </code><code><span class="constructor">Aunsubscribed_observer</span></code></td><td class="doc"><p>denotes an object unsubscribed from observers of a notification center</p></td></tr><tr id="type-t.Awont_leak" class="anchored"><td class="def constructor"><a href="#type-t.Awont_leak" class="anchor"></a><code>| </code><code><span class="constructor">Awont_leak</span></code></td><td class="doc"><p>value do not participate in memory leak analysis</p></td></tr></table></dt><dd><p>Attributes are nary function symbols that are applied to expression arguments in Apred and Anpred atomic formulas. Many operations don't make much sense for nullary predicates, and are generally treated as no-ops. The first argument is treated specially, as the &quot;anchor&quot; of the predicate application. For example, adding or removing an attribute uses the anchor to identify the atom to operate on. Also, abstraction and normalization operations treat the anchor specially and maintain more information on it than other arguments. Therefore when attaching an attribute to an expression, that expression should be the first argument, optionally followed by additional related expressions.</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><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><dt class="spec value" id="val-mem_alloc_pname"><a href="#val-mem_alloc_pname" class="anchor"></a><code><span class="keyword">val</span> mem_alloc_pname : <a href="index.html#type-mem_kind">mem_kind</a> <span>&#45;&gt;</span> <a href="../Procname/index.html#type-t">Procname.t</a></code></dt><dd><p>name of the allocation function for the given memory kind</p></dd></dl><dl><dt class="spec value" id="val-mem_dealloc_pname"><a href="#val-mem_dealloc_pname" class="anchor"></a><code><span class="keyword">val</span> mem_dealloc_pname : <a href="index.html#type-mem_kind">mem_kind</a> <span>&#45;&gt;</span> <a href="../Procname/index.html#type-t">Procname.t</a></code></dt><dd><p>name of the deallocation function for the given memory kind</p></dd></dl><dl><dt class="spec type" id="type-category"><a href="#type-category" class="anchor"></a><code><span class="keyword">type</span> category</code><code> = </code><table class="variant"><tr id="type-category.ACresource" class="anchored"><td class="def constructor"><a href="#type-category.ACresource" class="anchor"></a><code>| </code><code><span class="constructor">ACresource</span></code></td></tr><tr id="type-category.ACautorelease" class="anchored"><td class="def constructor"><a href="#type-category.ACautorelease" class="anchor"></a><code>| </code><code><span class="constructor">ACautorelease</span></code></td></tr><tr id="type-category.AClock" class="anchored"><td class="def constructor"><a href="#type-category.AClock" class="anchor"></a><code>| </code><code><span class="constructor">AClock</span></code></td></tr><tr id="type-category.ACdiv0" class="anchored"><td class="def constructor"><a href="#type-category.ACdiv0" class="anchor"></a><code>| </code><code><span class="constructor">ACdiv0</span></code></td></tr><tr id="type-category.ACobjc_null" class="anchored"><td class="def constructor"><a href="#type-category.ACobjc_null" class="anchor"></a><code>| </code><code><span class="constructor">ACobjc_null</span></code></td></tr><tr id="type-category.ACundef" class="anchored"><td class="def constructor"><a href="#type-category.ACundef" class="anchor"></a><code>| </code><code><span class="constructor">ACundef</span></code></td></tr><tr id="type-category.ACretval" class="anchored"><td class="def constructor"><a href="#type-category.ACretval" class="anchor"></a><code>| </code><code><span class="constructor">ACretval</span></code></td></tr><tr id="type-category.ACobserver" class="anchored"><td class="def constructor"><a href="#type-category.ACobserver" class="anchor"></a><code>| </code><code><span class="constructor">ACobserver</span></code></td></tr><tr id="type-category.ACwontleak" class="anchored"><td class="def constructor"><a href="#type-category.ACwontleak" class="anchor"></a><code>| </code><code><span class="constructor">ACwontleak</span></code></td></tr></table></dt><dd><p>Categories of attributes</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_category"><a href="#val-compare_category" class="anchor"></a><code><span class="keyword">val</span> compare_category : <a href="index.html#type-category">category</a> <span>&#45;&gt;</span> <a href="index.html#type-category">category</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-equal_category"><a href="#val-equal_category" class="anchor"></a><code><span class="keyword">val</span> equal_category : <a href="index.html#type-category">category</a> <span>&#45;&gt;</span> <a href="index.html#type-category">category</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-to_category"><a href="#val-to_category" class="anchor"></a><code><span class="keyword">val</span> to_category : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-category">category</a></code></dt><dd><p>Return the category to which the attribute belongs.</p></dd></dl><dl><dt class="spec value" id="val-is_undef"><a href="#val-is_undef" class="anchor"></a><code><span class="keyword">val</span> is_undef : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="../../IStdlib/Pp/index.html#type-env">IStdlib.Pp.env</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> string</code></dt><dd><p>convert the attribute to a string</p></dd></dl><dl><dt class="spec value" id="val-d_attribute"><a href="#val-d_attribute" class="anchor"></a><code><span class="keyword">val</span> d_attribute : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Dump an attribute.</p></dd></dl></section></div></body></html>