package codex

  1. Overview
  2. Docs
The Codex library for building static analysers based on abstract interpretation

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.0-rc4.tar.gz
md5=bc7266a140c6886add673ede90e335d3
sha512=8da42c0ff2c1098c5f9cb2b5b43b306faf7ac93b8f5ae00c176918cee761f249ff45b29309f31a05bbcf6312304f86a0d5a000eb3f1094d3d3c2b9b4c7f5c386

doc/src/codex.operator/operator.ml.html

Source file operator.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(**************************************************************************)
(*  This file is part of the Codex semantics library.                     *)
(*                                                                        *)
(*  Copyright (C) 2013-2025                                               *)
(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
(*         alternatives)                                                  *)
(*                                                                        *)
(*  you can redistribute it and/or modify it under the terms of the GNU   *)
(*  Lesser General Public License as published by the Free Software       *)
(*  Foundation, version 2.1.                                              *)
(*                                                                        *)
(*  It is distributed in the hope that it will be useful,                 *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
(*  GNU Lesser General Public License for more details.                   *)
(*                                                                        *)
(*  See the GNU Lesser General Public License version 2.1                 *)
(*  for more details (enclosed in the file LICENSE).                      *)
(*                                                                        *)
(**************************************************************************)

(** [Operator] defines the syntax and semantics of the
    expressions of the internal languages used by the Codex
    analyzers. It defines operations such as addition (on bitvectors
    or integers), logical/bitwise and (on booleans, integers and bitvectors), etc. In
    addition, it contains several utility modules (such as
    pretty-printers) for code dealing with these operators.

    Most of our passes do not use a term representation of an AST, but
    instead calls "constructor functions" manipulating expressions,
    similarly to the {{: https://dx.doi.org/10.1017/s0956796809007205}{e Tagless-final} of Carette, Kiselyov and Shan (2009)}.
    Thus, syntax means here that we define signatures (see {!syntax}) .

    We do also provide a tag that can be used in an AST representation of
    the language (module {!Function_symbol}).

    We define a concrete semantics of these operators in
    module {!Concrete}, which can be used to interpret constant terms.

    Finally, {!Conversions} contain helpers when doing domain
    transformations. *)

(** {1 Unique identifiers } *)

include Operator_ids

(** {1 Alarms } *)

(** In the concrete, an alarm would correspond to an exception/panic
    due to a partial operator.

    In the abstract, it corresponds to a (possible) error reported to the user. *)
module Alarm = Operator_alarm


module Flags = Flags

(** {1:syntax Syntax: signature of operators } *)

module Sig = Operator_sig
include Sig

(** {1 Concrete (reference) implementation giving a meaning to operators } *)

module Concrete = Operator_concrete

(** {1 Function symbols}  *)

module Function_symbol = Function_symbol

(** {1 Conversions}  *)

module Conversions = Operator_conversions

(** {1 Automatic logging}  *)

(** Similar to conversion, converts transfer functions to the same
    thing but that logs its call. *)

module Autolog = Operator_autolog