Module Gil_syntax.Expr
type t = | Lit of 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 UnOp.t * t| BinOp of t * BinOp.t * t| LstSub of t * t * t(*Sublist
*)| NOp of NOp.t * t list| EList of t list(*Lists of expressions
*)| ESet of t list(*Sets of expressions
*)| Exists of (string * Type.t option) list * t(*Existential quantification.
*)| ForAll of (string * Type.t option) list * t
val to_yojson : t -> Yojson.Safe.tval of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_orHelpers for building expressions
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 num : float -> tval num_int : int -> tval int : int -> tval int_z : Z.t -> tval string : string -> tval bool : bool -> tval false_ : tval true_ : tval zero_i : tLit (Int Z.zero)
val one_i : tLit (Int Z.one)
val is_concrete_zero_i : t -> boolmodule Infix : sig ... endFloating point math
module Map : Utils.Prelude.Map.S with type key := tMaps with expressions as keys
val pp : t Fmt.tval full_pp : t Fmt.tPretty-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.tlvars e returns all logical variables in e
val pvars : t -> Utils.Prelude.SS.tpvars e returns all program variables in e
val alocs : t -> Utils.Prelude.SS.talocs e returns all abstract locations in e
val clocs : t -> Utils.Prelude.SS.tclocs e returns all concrete locations in e
val locs : t -> Utils.Prelude.SS.tlocs e returns all concrete and abstract locations in e
val vars : t -> Utils.Prelude.SS.tvars e returns all variables in e (includes lvars, pvars, alocs and clocs)
push_in_negations e pushes all negations in e "downwards", recursively
val is_boolean_expr : t -> boolReturns if this expression is a boolean expression, recursively.
val substitutables : t -> Utils.Prelude.SS.tsubstitutables e returns all lvars and alocs
val is_concrete : t -> boolis_concrete e returns true iff the expression contains no lvar or aloc
val all_literals : t list -> boolall_literals lst returns true iff all elements of the given list lst are literals
subst_clocs subst e substitutes expressions of the form Lit (Loc l) with subst l in e
val from_var_name : string -> tfrom_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 -> tloc_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 -> tvar_to_expr x returns the expression representing the program/logical variable or abstract location x
val is_matchable : t -> boolis_matchable x returns whether or not the expression e is matchable