Frama-C API - Acsl
This module contains all functions related to logic types. Most of these functions where moved from Logic_const or Logic_utils and renamed for better consistency.
val instantiate : (string * Cil_types.logic_type) list -> Cil_types.logic_type -> Cil_types.logic_typeinstantiate type variables in a logic type.
val is_unrollable_ltdef : Cil_types.logic_type_info -> boolval unroll_ltdef : Cil_types.logic_type -> Cil_types.logic_typeexpands logic type definitions only. To expands both logic part and C part, uses Ast_types.Acsl.unroll.
val unroll : ?unroll_typedef:bool -> Cil_types.logic_type -> Cil_types.logic_typeExpands logic type definitions. If the unroll_typedef flag is set to true (this is the default), C typedef will be expanded as well using Ast_types.Acsl.unroll_ltdef.
tests and extraction of element type
val fold_plain_ctype : default:'a -> (Cil_types.typ -> 'a) -> Cil_types.logic_type -> 'afold_plain_ctype ~default f t is ~default for pure logic types and the result of f for C types.
val is_plain : Cil_types.logic_type -> booltrue if the argument is not a set type.
val is_plain_set : Cil_types.logic_type -> boolreturns true if the type is a set<t>.
val plain_or_set : (Cil_types.logic_type -> 'a) -> Cil_types.logic_type -> 'aplain_or_set f t applies f to t or to the type of elements of t if it is a set type.
val plain_or_set_ctype : (Cil_types.typ -> bool) -> Cil_types.logic_type -> boolplain_or_set_ctype test typ is false for pure logic types and the result of test for C types. In case of a set type, the function tests the element type.
val is_logic_boolean : Cil_types.logic_type -> booltests for direct type
is_plain_xxx t returns true iff t is a xxx (and not a set<xxx>. Uses Ast_types.Acsl.unroll_ltdef if needed.
val is_plain_volatile : Cil_types.logic_type -> boolCheck for "volatile" qualifier from a logic type using C.is_volatile.
val is_plain_typetag : Cil_types.logic_type -> boolTrue if the argument is the type for reified C types.
val is_plain_boolean : Cil_types.logic_type -> boolTrue if the argument is a boolean type, either integral C type or mathematical boolean one.
val is_plain_pure_boolean : Cil_types.logic_type -> boolTrue if the argument is _Bool or Lboolean.
val is_plain_integral : Cil_types.logic_type -> boolTrue if the argument is an integral type (i.e. integer or enum), either C or mathematical one.
val is_plain_float : Cil_types.logic_type -> boolTrue if the argument is a floating point type.
val is_plain_real : Cil_types.logic_type -> boolTrue if the argument is the logic 'real' type.
val is_plain_real_or_float : Cil_types.logic_type -> boolTrue if the argument is a C floating point type or logic 'real' type.
val is_plain_arithmetic : Cil_types.logic_type -> boolTrue if the argument is a logic arithmetic type (i.e. integer, enum or floating point, either C or mathematical one.
val is_plain_ptr : Cil_types.logic_type -> boolTrue if the argument is a pointer type. Expands the logic type definition if necessary.
val is_plain_array : Cil_types.logic_type -> boolTrue if the argument is an array type. Expands the logic type definition if necessary.
val is_plain_fun : Cil_types.logic_type -> boolTrue if the argument is the logic function type. Expands the logic type definition if necessary.
val is_plain_fun_ptr : Cil_types.logic_type -> boolTrue if the argument is the logic function pointer type. Expands the logic type definition if necessary.
val is_plain_fun_or_ptr : Cil_types.logic_type -> boolTrue if the argument is a pointer or function type. Expands the logic type definition if necessary.
val is_plain_list : Cil_types.logic_type -> boolReturns true if the type is a list<t>.
tests for potential sets
is_xxx t returns true iff t is a xxx _or_ a set of xxx
val is_arithmetic : Cil_types.logic_type -> boolval is_integral : Cil_types.logic_type -> boolval is_fun_ptr : Cil_types.logic_type -> boolval is_array : Cil_types.logic_type -> boolval is_ptr : Cil_types.logic_type -> boolval is_char : Cil_types.logic_type -> boolval is_any_char : Cil_types.logic_type -> boolval is_void : Cil_types.logic_type -> boolval is_void_ptr : Cil_types.logic_type -> boolconstructors
val make_list : Cil_types.logic_type -> Cil_types.logic_typemake_list t returns the type list<t>.
val make_set : Cil_types.logic_type -> Cil_types.logic_typeconverts a type into the corresponding set type if needed. Does nothing if the argument is already a set type.
val make_arrow : Cil_types.logic_var list -> Cil_types.logic_type -> Cil_types.logic_typemake_arrow args rt returns a rt if args is empty or the corresponding Larrow type.
val set_conversion : Cil_types.logic_type -> Cil_types.logic_type -> Cil_types.logic_typeset_conversion ty1 ty2 returns a set type as soon as ty1 and/or ty2 is a set. Elements have type ty1, or the type of the elements of ty1 if it is itself a set-type (i.e. we do not build set of sets that way).
val transform_element : (Cil_types.logic_type -> Cil_types.logic_type) -> Cil_types.logic_type -> Cil_types.logic_typetransform_element f t is the same as set_conversion (plain_or_set f t) t
extract elements
val list_element : Cil_types.logic_type -> Cil_types.logic_typereturns the type of elements of a list type.
val set_element : Cil_types.logic_type -> Cil_types.logic_typereturns the type of elements of a set type.
val direct_pointed : Cil_types.logic_type -> Cil_types.logic_typereturns the type of the element pointed to by the type. If the source type is a set of pointers, returns a set of elements.
val direct_array_element : Cil_types.logic_type -> Cil_types.logic_typesame as Ast_types.Acsl.direct_pointed but for arrays (or set of arrays).
Type conversions
val get_ctype : Cil_types.logic_type -> Cil_types.typval remove_qualifiers : Cil_types.logic_type -> Cil_types.logic_typeremoves qualifiers if logic_type is a C type, identity otherwise.
val direct_pointed_ctype : Cil_types.logic_type -> Cil_types.typval direct_array_element_ctype : Cil_types.logic_type -> Cil_types.typval arithmetic_conversion : Cil_types.logic_type -> Cil_types.logic_type -> Cil_types.logic_type