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
16 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>Pulselib__PulsePathCondition (infer.Pulselib__PulsePathCondition)</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> &#x00BB; Pulselib__PulsePathCondition</nav><h1>Module <code>Pulselib__PulsePathCondition</code></h1><nav class="toc"><ul><li><a href="#building-arithmetic-constraints">Building arithmetic constraints</a></li><li><a href="#operations">Operations</a></li><li><a href="#queries">Queries</a></li></ul></nav></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-AbstractValue"><a href="#module-AbstractValue" class="anchor"></a><code><span class="keyword">module</span> AbstractValue = <a href="../Pulselib/index.html#module-PulseAbstractValue">Pulselib.PulseAbstractValue</a></code></div><div class="spec module" id="module-SatUnsat"><a href="#module-SatUnsat" class="anchor"></a><code><span class="keyword">module</span> SatUnsat = <a href="../Pulselib/index.html#module-PulseSatUnsat">Pulselib.PulseSatUnsat</a></code></div><div class="spec module" id="module-ValueHistory"><a href="#module-ValueHistory" class="anchor"></a><code><span class="keyword">module</span> ValueHistory = <a href="../Pulselib/index.html#module-PulseValueHistory">Pulselib.PulseValueHistory</a></code></div><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt></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><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-yojson_of_t"><a href="#val-yojson_of_t" class="anchor"></a><code><span class="keyword">val</span> yojson_of_t : <a href="index.html#type-t">t</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-true_"><a href="#val-true_" class="anchor"></a><code><span class="keyword">val</span> true_ : <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-false_"><a href="#val-false_" class="anchor"></a><code><span class="keyword">val</span> false_ : <a href="index.html#type-t">t</a></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="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt></dl><dl><dt class="spec type" id="type-new_eqs"><a href="#type-new_eqs" class="anchor"></a><code><span class="keyword">type</span> new_eqs</code><code> = <a href="../Pulselib/PulseFormula/index.html#type-new_eqs">Pulselib.PulseFormula.new_eqs</a></code></dt></dl><section><header><h3 id="building-arithmetic-constraints"><a href="#building-arithmetic-constraints" class="anchor"></a>Building arithmetic constraints</h3></header><dl><dt class="spec value" id="val-and_nonnegative"><a href="#val-and_nonnegative" class="anchor"></a><code><span class="keyword">val</span> and_nonnegative : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dd><p><code>and_nonnegative v phi</code> is <code>phi ∧ v≥0</code></p></dd></dl><dl><dt class="spec value" id="val-and_positive"><a href="#val-and_positive" class="anchor"></a><code><span class="keyword">val</span> and_positive : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dd><p><code>and_positive v phi</code> is <code>phi ∧ v&gt;0</code></p></dd></dl><dl><dt class="spec value" id="val-and_eq_int"><a href="#val-and_eq_int" class="anchor"></a><code><span class="keyword">val</span> and_eq_int : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../IR/IntLit/index.html#type-t">IR.IntLit.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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dd><p><code>and_eq_int v i phi</code> is <code>phi ∧ v=i</code></p></dd></dl><dl><dt class="spec value" id="val-and_eq_vars"><a href="#val-and_eq_vars" class="anchor"></a><code><span class="keyword">val</span> and_eq_vars : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dt class="spec value" id="val-simplify"><a href="#val-simplify" class="anchor"></a><code><span class="keyword">val</span> simplify : <a href="../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <span>keep:<a href="../Pulselib__PulseAbstractValue/index.html#module-Set">AbstractValue.Set</a>.t</span> <span>&#45;&gt;</span> <span>get_dynamic_type:<span>(<a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <span><a href="../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span>)</span></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><span>(<a href="index.html#type-t">t</a> * <a href="index.html#type-new_eqs">new_eqs</a>)</span> <a href="../Pulselib/PulseSatUnsat/index.html#type-t">SatUnsat.t</a></span></code></dt><dd><p><code>simplify ~keep phi</code> attempts to get rid of as many variables in <code>fv phi</code> but not in <code>keep</code> as possible</p></dd></dl><dl><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> <span>get_dynamic_type:<span>(<a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <span><a href="../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span>)</span></span> <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-and_callee"><a href="#val-and_callee" class="anchor"></a><code><span class="keyword">val</span> and_callee : <span><span>(<a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> * <a href="../Pulselib/PulseValueHistory/index.html#type-t">ValueHistory.t</a>)</span> <a href="../Pulselib__PulseAbstractValue/index.html#module-Map">AbstractValue.Map</a>.t</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span>callee:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span><span>(<a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> * <a href="../Pulselib/PulseValueHistory/index.html#type-t">ValueHistory.t</a>)</span> <a href="../Pulselib__PulseAbstractValue/index.html#module-Map">AbstractValue.Map</a>.t</span> * <a href="index.html#type-t">t</a> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt></dl></section><section><header><h3 id="operations"><a href="#operations" class="anchor"></a>Operations</h3></header><dl><dt class="spec type" id="type-operand"><a href="#type-operand" class="anchor"></a><code><span class="keyword">type</span> operand</code><code> = </code><table class="variant"><tr id="type-operand.LiteralOperand" class="anchored"><td class="def constructor"><a href="#type-operand.LiteralOperand" class="anchor"></a><code>| </code><code><span class="constructor">LiteralOperand</span> <span class="keyword">of</span> <a href="../IR/IntLit/index.html#type-t">IR.IntLit.t</a></code></td></tr><tr id="type-operand.AbstractValueOperand" class="anchored"><td class="def constructor"><a href="#type-operand.AbstractValueOperand" class="anchor"></a><code>| </code><code><span class="constructor">AbstractValueOperand</span> <span class="keyword">of</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a></code></td></tr></table></dt></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_operand"><a href="#val-compare_operand" class="anchor"></a><code><span class="keyword">val</span> compare_operand : <a href="index.html#type-operand">operand</a> <span>&#45;&gt;</span> <a href="index.html#type-operand">operand</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-pp_operand"><a href="#val-pp_operand" class="anchor"></a><code><span class="keyword">val</span> pp_operand : <a href="../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Formatter.t <span>&#45;&gt;</span> <a href="index.html#type-operand">operand</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-eval_binop"><a href="#val-eval_binop" class="anchor"></a><code><span class="keyword">val</span> eval_binop : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../IR/Binop/index.html#type-t">IR.Binop.t</a> <span>&#45;&gt;</span> <a href="index.html#type-operand">operand</a> <span>&#45;&gt;</span> <a href="index.html#type-operand">operand</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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dt class="spec value" id="val-eval_unop"><a href="#val-eval_unop" class="anchor"></a><code><span class="keyword">val</span> eval_unop : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../IR/Unop/index.html#type-t">IR.Unop.t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dt class="spec value" id="val-prune_binop"><a href="#val-prune_binop" class="anchor"></a><code><span class="keyword">val</span> prune_binop : <span>negated:bool</span> <span>&#45;&gt;</span> <a href="../IR/Binop/index.html#type-t">IR.Binop.t</a> <span>&#45;&gt;</span> <a href="index.html#type-operand">operand</a> <span>&#45;&gt;</span> <a href="index.html#type-operand">operand</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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dt class="spec value" id="val-and_eq_instanceof"><a href="#val-and_eq_instanceof" class="anchor"></a><code><span class="keyword">val</span> and_eq_instanceof : <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../IR/Typ/index.html#type-t">IR.Typ.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> * <a href="index.html#type-new_eqs">new_eqs</a></code></dt></dl></section><section><header><h3 id="queries"><a href="#queries" class="anchor"></a>Queries</h3></header><dl><dt class="spec value" id="val-is_known_zero"><a href="#val-is_known_zero" class="anchor"></a><code><span class="keyword">val</span> is_known_zero : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p><code>is_known_zero phi t</code> returns <code>true</code> if <code>phi |- t = 0</code>, <code>false</code> if we don't know for sure</p></dd></dl><dl><dt class="spec value" id="val-is_known_not_equal_zero"><a href="#val-is_known_not_equal_zero" class="anchor"></a><code><span class="keyword">val</span> is_known_not_equal_zero : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p><code>is_known_not_equal_zero phi t</code> returns <code>true</code> if <code>phi |- t != 0</code>, <code>false</code> if we don't know for sure</p></dd></dl><dl><dt class="spec value" id="val-is_unsat_cheap"><a href="#val-is_unsat_cheap" class="anchor"></a><code><span class="keyword">val</span> is_unsat_cheap : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>whether the state contains a contradiction, call this as often as you want</p></dd></dl><dl><dt class="spec value" id="val-is_unsat_expensive"><a href="#val-is_unsat_expensive" class="anchor"></a><code><span class="keyword">val</span> is_unsat_expensive : <a href="../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <span>get_dynamic_type:<span>(<a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <span><a href="../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span>)</span></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> * bool * <a href="index.html#type-new_eqs">new_eqs</a></code></dt><dd><p>whether the state contains a contradiction, only call this when you absolutely have to</p></dd></dl><dl><dt class="spec value" id="val-as_int"><a href="#val-as_int" class="anchor"></a><code><span class="keyword">val</span> as_int : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <span>int option</span></code></dt><dd><p><code>as_int phi t</code> returns an integer x such that <code>phi |- t = x</code>, if known for sure; see also <code>is_known_zero</code></p></dd></dl><dl><dt class="spec value" id="val-has_no_assumptions"><a href="#val-has_no_assumptions" class="anchor"></a><code><span class="keyword">val</span> has_no_assumptions : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>whether the current path is independent of any calling context</p></dd></dl><dl><dt class="spec value" id="val-get_var_repr"><a href="#val-get_var_repr" class="anchor"></a><code><span class="keyword">val</span> get_var_repr : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a> <span>&#45;&gt;</span> <a href="../Pulselib/PulseAbstractValue/index.html#type-t">AbstractValue.t</a></code></dt><dd><p>get the canonical representative for the variable according to the equality relation</p></dd></dl></section></div></body></html>