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.

6 lines
7.0 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>CTL (infer.ASTLanguage.CTL)</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">ASTLanguage</a> &#x00BB; CTL</nav><h1>Module <code>ASTLanguage.CTL</code></h1></header><aside><p>This module defines a language to define checkers. These checkers are interpreted over the AST of the program. A checker is defined by a CTL formula which expresses a condition saying when the checker should report a problem.</p></aside><dl><dt class="spec type" id="type-clause"><a href="#type-clause" class="anchor"></a><code><span class="keyword">type</span> clause</code><code> = </code><table class="variant"><tr id="type-clause.CLet" class="anchored"><td class="def constructor"><a href="#type-clause.CLet" class="anchor"></a><code>| </code><code><span class="constructor">CLet</span> <span class="keyword">of</span> <a href="../ALVar/index.html#type-formula_id">ALVar.formula_id</a> * <span><a href="../ALVar/index.html#type-t">ALVar.t</a> list</span> * <a href="../CTLTypes/index.html#type-t">CTLTypes.t</a></code></td><td class="doc"><p>Let clause: let id = definifion;</p></td></tr><tr id="type-clause.CSet" class="anchored"><td class="def constructor"><a href="#type-clause.CSet" class="anchor"></a><code>| </code><code><span class="constructor">CSet</span> <span class="keyword">of</span> <a href="../ALVar/index.html#type-keyword">ALVar.keyword</a> * <a href="../CTLTypes/index.html#type-t">CTLTypes.t</a></code></td><td class="doc"><p>Set clause: set id = definition</p></td></tr><tr id="type-clause.CDesc" class="anchored"><td class="def constructor"><a href="#type-clause.CDesc" class="anchor"></a><code>| </code><code><span class="constructor">CDesc</span> <span class="keyword">of</span> <a href="../ALVar/index.html#type-keyword">ALVar.keyword</a> * string</code></td><td class="doc"><p>Description clause eg: set message = &quot;...&quot;</p></td></tr><tr id="type-clause.CPath" class="anchored"><td class="def constructor"><a href="#type-clause.CPath" class="anchor"></a><code>| </code><code><span class="constructor">CPath</span> <span class="keyword">of</span> <span>[ `WhitelistPath <span>| `BlacklistPath</span> ]</span> * <span><a href="../ALVar/index.html#type-t">ALVar.t</a> list</span></code></td></tr></table></dt><dd><p>&quot;set&quot; clauses are used for defining mandatory variables that will be used by when reporting issues: eg for defining the condition.</p><p>&quot;desc&quot; clauses are used for defining the error message, the suggestion, the severity.</p><p>&quot;let&quot; clauses are used to define temporary formulas which are then used to abbreviate the another formula. For example</p><pre> let f = a And B
set formula = f OR f
set message = &quot;bla&quot;</pre></dd></dl><dl><dt class="spec type" id="type-ctl_checker"><a href="#type-ctl_checker" class="anchor"></a><code><span class="keyword">type</span> ctl_checker</code><code> = </code><code>{</code><table class="record"><tr id="type-ctl_checker.id" class="anchored"><td class="def field"><a href="#type-ctl_checker.id" class="anchor"></a><code>id : string;</code></td><td class="doc"><p>Checker's id</p></td></tr><tr id="type-ctl_checker.definitions" class="anchored"><td class="def field"><a href="#type-ctl_checker.definitions" class="anchor"></a><code>definitions : <span><a href="index.html#type-clause">clause</a> list</span>;</code></td><td class="doc"><p>A list of let/set definitions</p></td></tr></table><code>}</code></dt><dt class="spec type" id="type-al_file"><a href="#type-al_file" class="anchor"></a><code><span class="keyword">type</span> al_file</code><code> = </code><code>{</code><table class="record"><tr id="type-al_file.import_files" class="anchored"><td class="def field"><a href="#type-al_file.import_files" class="anchor"></a><code>import_files : <span>string list</span>;</code></td></tr><tr id="type-al_file.global_macros" class="anchored"><td class="def field"><a href="#type-al_file.global_macros" class="anchor"></a><code>global_macros : <span><a href="index.html#type-clause">clause</a> list</span>;</code></td></tr><tr id="type-al_file.global_paths" class="anchored"><td class="def field"><a href="#type-al_file.global_paths" class="anchor"></a><code>global_paths : <span><span>(string * <span><a href="../ALVar/index.html#type-alexp">ALVar.alexp</a> list</span>)</span> list</span>;</code></td></tr><tr id="type-al_file.checkers" class="anchored"><td class="def field"><a href="#type-al_file.checkers" class="anchor"></a><code>checkers : <span><a href="index.html#type-ctl_checker">ctl_checker</a> list</span>;</code></td></tr></table><code>}</code></dt></dl><dl><dt class="spec value" id="val-print_checker"><a href="#val-print_checker" class="anchor"></a><code><span class="keyword">val</span> print_checker : <a href="index.html#type-ctl_checker">ctl_checker</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-eval_formula"><a href="#val-eval_formula" class="anchor"></a><code><span class="keyword">val</span> eval_formula : <span>?&#8288;keep_witness:bool</span> <span>&#45;&gt;</span> <a href="../CTLTypes/index.html#type-t">CTLTypes.t</a> <span>&#45;&gt;</span> <a href="../Ctl_parser_types/index.html#type-ast_node">Ctl_parser_types.ast_node</a> <span>&#45;&gt;</span> <a href="../CLintersContext/index.html#type-context">CLintersContext.context</a> <span>&#45;&gt;</span> <span><a href="../Ctl_parser_types/index.html#type-ast_node">Ctl_parser_types.ast_node</a> option</span></code></dt><dd><p>return the evaluation of the formula and a witness</p></dd></dl><dl><dt class="spec value" id="val-save_dotty_when_in_debug_mode"><a href="#val-save_dotty_when_in_debug_mode" class="anchor"></a><code><span class="keyword">val</span> save_dotty_when_in_debug_mode : <a href="../../IBase/SourceFile/index.html#type-t">IBase.SourceFile.t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-next_state_via_transition"><a href="#val-next_state_via_transition" class="anchor"></a><code><span class="keyword">val</span> next_state_via_transition : <a href="../Ctl_parser_types/index.html#type-ast_node">Ctl_parser_types.ast_node</a> <span>&#45;&gt;</span> <a href="../CTLTypes/index.html#type-transitions">CTLTypes.transitions</a> <span>&#45;&gt;</span> <span><a href="../Ctl_parser_types/index.html#type-ast_node">Ctl_parser_types.ast_node</a> list</span></code></dt><dt class="spec value" id="val-create_ctl_evaluation_tracker"><a href="#val-create_ctl_evaluation_tracker" class="anchor"></a><code><span class="keyword">val</span> create_ctl_evaluation_tracker : <a href="../../IBase/SourceFile/index.html#type-t">IBase.SourceFile.t</a> <span>&#45;&gt;</span> unit</code></dt></dl></div></body></html>