Gil_syntax.Expr
GIL Expressions
type t =
| Lit of Gillian.Gil_syntax.Literal.t
GIL literals
*)| PVar of string
GIL program variables
*)| LVar of string
GIL logical variables (interpreted symbols)
*)| ALoc of string
GIL abstract locations (uninterpreted symbols)
*)| UnOp of Gillian.Gil_syntax.UnOp.t * t
| BinOp of t * Gillian.Gil_syntax.BinOp.t * t
| LstSub of t * t * t
Sublist
*)| NOp of Gillian.Gil_syntax.NOp.t * t list
| EList of t list
Lists of expressions
*)| ESet of t list
Sets of expressions
*)| Exists of (string * Gillian.Gil_syntax.Type.t option) list * t
Existential quantification. This is now a circus because the separation between Formula and Expr doesn't make sense anymore.
*)| EForall of (string * Gillian.Gil_syntax.Type.t option) list * t
val to_yojson : t -> Yojson.Safe.t
val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or
Operations will be optimised away if possible, e.g. type_ (EList x)
will give Lit (Type ListType)
directly instead of using UnOp.t.TypeOf
val lit : Gillian.Gil_syntax.Literal.t -> t
val num : float -> t
val num_int : int -> t
val int : int -> t
val int_z : Z.t -> t
val string : string -> t
val bool : bool -> t
val to_literal : t -> Gillian.Gil_syntax.Literal.t option
val zero_i : t
Lit (Int Z.zero)
val one_i : t
Lit (Int Z.one)
val type_ : Gillian.Gil_syntax.Type.t -> t
val type_eq : t -> Gillian.Gil_syntax.Type.t -> t
val is_concrete_zero_i : t -> bool
module Infix : sig ... end
Floating point math
module Map : Utils.Prelude.Map.S with type key := t
Maps with expressions as keys
val pp : t Fmt.t
Pretty-printer
val full_pp : t Fmt.t
Pretty-printer with constructors (will not parse)
If the expression is a list (either an EList _
of Lit (LList _)), returns the list of expressions.
val lvars : t -> Utils.Prelude.SS.t
lvars e
returns all logical variables in e
val pvars : t -> Utils.Prelude.SS.t
pvars e
returns all program variables in e
val alocs : t -> Utils.Prelude.SS.t
alocs e
returns all abstract locations in e
val clocs : t -> Utils.Prelude.SS.t
clocs e
returns all concrete locations in e
val locs : t -> Utils.Prelude.SS.t
locs e
returns all concrete and abstract locations in e
val vars : t -> Utils.Prelude.SS.t
vars e
returns all variables in e
(includes lvars, pvars, alocs and clocs)
val substitutables : t -> Utils.Prelude.SS.t
substitutables e
returns all lvars and alocs
val is_concrete : t -> bool
is_concrete e
returns true
iff the expression contains no lvar or aloc
val all_literals : t list -> bool
all_literals lst
returns true
iff all elements of the given list lst
are literals
val from_lit_list : Gillian.Gil_syntax.Literal.t -> t
from_lit_list lst
lifts a literal list to an expression list
subst_clocs subst e
substitutes expressions of the form Lit (Loc l)
with subst l
in e
val from_var_name : string -> t
from_var_name var
returns either an aloc, an lvar or a pvar if var
name matches one of these types (see Utils.Names.is_aloc_name
, Utils.Names.is_lvar_name
and Utils.Names.is_pvar_name
)
val loc_from_loc_name : string -> t
loc_from_loc_name loc
Has the same behaviour as from_var_name
except that it returns either an ALoc loc
or a Lit (Loc loc)
subst_expr_for_expr ~to_subst ~subst_with expr
substitutes every occurence of the expression to_subst
with the expression subst_with
in expr
base_elements e
returns the list containing all logical variables, abstract locations, and non-list literals in e
val var_to_expr : string -> t
var_to_expr x
returns the expression representing the program/logical variable or abstract location x
val is_matchable : t -> bool
is_matchable x
returns whether or not the expression e
is matchable