Module Logic_typing


module Logic_typing: sig .. end
Logic typing and logic environment.
Consult the Plugin Development Guide for additional details.

module Lenv: sig .. end
Local logic environment

type typing_context = {
   annonCompFieldName : string;
   conditionalConversion : Cil_types.typ -> Cil_types.typ -> Cil_types.typ;
   find_macro : string -> Logic_ptree.lexpr;
   find_var : string -> Cil_types.logic_var;
   find_enum_tag : string -> Cil_types.exp * Cil_types.typ;
   find_comp_type : kind:string -> string -> Cil_types.typ;
   find_comp_field : Cil_types.compinfo -> string -> Cil_types.offset;
   find_type : string -> Cil_types.typ;
   find_label : string -> Cil_types.stmt Pervasives.ref;
   remove_logic_function : string -> unit;
   remove_logic_type : string -> unit;
   remove_logic_ctor : string -> unit;
   add_logic_function : Cil_types.logic_info -> unit;
   add_logic_type : string -> Cil_types.logic_type_info -> unit;
   add_logic_ctor : string -> Cil_types.logic_ctor_info -> unit;
   find_all_logic_functions : string -> Cil_types.logic_info list;
   find_logic_type : string -> Cil_types.logic_type_info;
   find_logic_ctor : string -> Cil_types.logic_ctor_info;
   pre_state : Lenv.t;
   post_state : Cil_types.termination_kind list -> Lenv.t;
   assigns_env : Lenv.t;
   type_predicate : Lenv.t ->
Logic_ptree.lexpr -> Cil_types.predicate Cil_types.named
;
   type_term : Lenv.t -> Logic_ptree.lexpr -> Cil_types.term;
   type_assigns : Lenv.t ->
Logic_ptree.lexpr Cil_types.assigns ->
Cil_types.identified_term Cil_types.assigns
;
   error : 'a.
Cil_types.location -> ('a, Format.formatter, unit) Pervasives.format -> 'a
;
}
val register_behavior_extension : string ->
(typing_context:typing_context ->
loc:Cil_types.location ->
Cil_types.funbehavior -> Logic_ptree.lexpr list -> unit) ->
unit
register_behavior_bextension name f registers a typing function f to be used to type clause with name name. This function may change the funbehavior in place. Here is a basic example: let foo_typer ~typing_context ~loc bhv ps = match ps with p::[] -> bhv.b_extended <- ("FOO",42, Logic_const.new_predicate (typing_context.type_predicate (typing_context.post_state Normal) p)) ::bhv.b_extended | _ -> typing_context.error loc "expecting a predicate after keyword FOO" let () = register_behavior_extension "FOO" foo_typer
Since Carbon-20101201
module Make: 
functor (C : sig
val annonCompFieldName : string
val conditionalConversion : Cil_types.typ -> Cil_types.typ -> Cil_types.typ
val find_macro : string -> Logic_ptree.lexpr
val find_var : string -> Cil_types.logic_var
val find_enum_tag : string -> Cil_types.exp * Cil_types.typ
val find_comp_type : kind:string -> string -> Cil_types.typ
val find_comp_field : Cil_types.compinfo -> string -> Cil_types.offset
val find_type : string -> Cil_types.typ
val find_label : string -> Cil_types.stmt Pervasives.ref
val remove_logic_function : string -> unit
val remove_logic_type : string -> unit
val remove_logic_ctor : string -> unit
val add_logic_function : Cil_types.logic_info -> unit
val add_logic_type : string -> Cil_types.logic_type_info -> unit
val add_logic_ctor : string -> Cil_types.logic_ctor_info -> unit
val find_all_logic_functions : string -> Cil_types.logic_info list
val find_logic_type : string -> Cil_types.logic_type_info
val find_logic_ctor : string -> Cil_types.logic_ctor_info
end) -> sig .. end
val append_old_and_post_labels : Lenv.t -> Lenv.t
append the Old label in the environment
val append_here_label : Lenv.t -> Lenv.t
appends the Here label in the environment
val append_pre_label : pre_is_old:bool -> Lenv.t -> Lenv.t
appends the "Pre" label in the environment when pre_is_old is true, it adds it has a synonym for "Old". (the latter should be set when typing function contracts)
val add_var : string -> Cil_types.logic_var -> Lenv.t -> Lenv.t
adds a given variable in local environment.
val add_result : Lenv.t -> Cil_types.logic_type -> Lenv.t
add \result in the environment.
val enter_post_state : Lenv.t -> Cil_types.termination_kind -> Lenv.t
enter a given post-state.
val post_state_env : Cil_types.termination_kind -> Cil_types.logic_type -> Lenv.t
enter a given post-state and put \result in the env. NB: if the kind of the post-state is neither Normal nor Returns, this is not a normal ACSL environment. Use with caution.