Module Eval


module Eval: sig .. end
Analysis for values and pointers

module Ki: Cil_datatype.Kinstr
val make_status : Cil_types.validity -> Cil_types.annotation_status
val status_true : Cil_types.annotation_status
val status_false : Cil_types.annotation_status
val status_maybe : Cil_types.annotation_status
module Status: sig .. end

type cond = {
   exp : Cil_types.exp;
   positive : bool;
}
val get_slevel : Kernel_function.t -> Value_parameters.SlevelFunction.value
val check_comparable : Locations.Location_Bytes.t ->
Locations.Location_Bytes.t ->
bool * Locations.Location_Bytes.t * Locations.Location_Bytes.t
module type Domain = sig .. end
module PtrRelational: sig .. end
module UseRelations: State_builder.Ref(Datatype.Bool)(sig
val name : string
val dependencies : 'a list
val kind : [> `Internal ]
val default : unit -> bool
end)
val compute_call_ref : (Kernel_function.Hptset.elt ->
call_kinstr:Cil_types.kinstr ->
Relations_type.Model.t ->
(Cil_types.exp * Cvalue_type.V.t * Cvalue_type.V_Offsetmap.t) list ->
Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t *
Locations.Location_Bits.Top_Param.t)
Pervasives.ref
val remember_bases_with_locals : Locations.Location_Bits.Top_Param.t Pervasives.ref ->
Locations.location -> Cvalue_type.V.t -> unit
val timer : int Pervasives.ref
val set_loc : Cil_types.kinstr -> unit
exception Leaf
exception Not_an_exact_loc
exception Reduce_to_bottom
module Got_Imprecise_Value: State_builder.Ref(Datatype.Bool)(sig
val name : string
val dependencies : State.t list
val kind : [> `Internal ]
val default : unit -> bool
end)
module Location_list: Datatype.List(Locations.Location)
module Non_linear_assignments: Cil_state_builder.Varinfo_hashtbl(Ki.Hashtbl.Make(Location_list))(sig
val name : string
val size : int
val dependencies : State.t list
val kind : [> `Internal ]
end)
val pretty_current_cfunction_name : Format.formatter -> unit
exception Offset_not_based_on_Null of Locations.Zone.t option * Locations.Location_Bytes.t
val warn_locals_escape : bool -> Cil_types.fundec -> Base.t -> unit
val warn_locals_escape_result : Cil_types.fundec -> unit
val do_cast : with_alarms:CilE.warn_mode ->
Cil_types.typ -> Cvalue_type.V.t -> Cvalue_type.V.t
val do_promotion : with_alarms:CilE.warn_mode ->
src_typ:Cil_types.typ ->
dest_type:Cil_types.typ ->
Cvalue_type.V.t -> Cil_types.exp -> Cvalue_type.V.t
val handle_signed_overflow : with_alarms:CilE.warn_mode ->
CilE.syntactic_context ->
Cil_types.typ -> Cil_types.exp -> Cvalue_type.V.t -> Cvalue_type.V.t
exception Cannot_find_lv
exception Too_linear
val warn_lval_read : Cil_types.lval -> Locations.location -> Locations.Location_Bytes.z -> unit
val lval_to_loc : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> Cil_types.lval -> Locations.location
val lval_to_loc_deps_option : with_alarms:CilE.warn_mode ->
deps:Locations.Zone.t option ->
Relations_type.Model.t ->
reduce_valid_index:Parameters.SafeArrays.t ->
Cil_types.lval ->
Relations_type.Model.t * Locations.Zone.t option * Locations.location
val lval_to_loc_with_offset_deps_only : deps:Locations.Zone.t ->
Relations_type.Model.t ->
Cil_types.lval ->
with_alarms:CilE.warn_mode ->
Relations_type.Model.t * Locations.Zone.t option * Locations.location
val lval_to_loc_with_deps : deps:Locations.Zone.t ->
Relations_type.Model.t ->
Cil_types.lval ->
with_alarms:CilE.warn_mode ->
reduce_valid_index:Parameters.SafeArrays.t ->
Relations_type.Model.t * Locations.Zone.t option * Locations.location
val lval_to_loc_with_offset_deps_only_option : with_alarms:CilE.warn_mode ->
deps:Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.lval ->
Relations_type.Model.t * Locations.Zone.t option * Locations.location

Detects if an expression can be considered as a lvalue even though it is hidden by a cast that does not change the lvalue. Raises exn if it is not an lvalue.

TODO: When the goal is to recognize the form (cast)l-value == expr, it would be better and more powerful to have chains of inverse functions

val pass_cast : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> exn -> Cil_types.typ -> Cil_types.exp -> unit
val find_lv : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> Cil_types.exp -> Cil_types.lval
val find_lv_plus : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> Cil_types.exp -> (Cil_types.lval * Ival.t) list
val base_to_loc : with_alarms:CilE.warn_mode ->
?deps:Locations.Zone.t ->
Relations_type.Model.t ->
Cil_types.lval ->
Cil_types.lhost ->
Ival.t ->
Relations_type.Model.t * Locations.Zone.t option * Locations.location
val eval_expr : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> Cil_types.exp -> Cvalue_type.V.t
val get_influential_vars : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> Cil_types.exp -> Locations.location list
val reduce_by_valid_expr : with_alarms:'a ->
positive:bool ->
Cil_types.exp -> Relations_type.Model.t -> Relations_type.Model.t
val eval_expr_with_deps : with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.exp -> Locations.Zone.t option * Cvalue_type.V.t
val eval_BinOp : with_alarms:CilE.warn_mode ->
Cil_types.exp ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Relations_type.Model.t * Locations.Zone.t option * Cvalue_type.V.t
val eval_expr_with_deps_state : with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.exp ->
Relations_type.Model.t * Locations.Zone.t option * Locations.Location_Bytes.t
val eval_expr_with_deps_state_subdiv : with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.exp ->
Relations_type.Model.t * Locations.Zone.t option * Locations.Location_Bytes.t
val eval_lval_using_main_memory : conflate_bottom:bool ->
with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.lval ->
Relations_type.Model.t * Locations.Zone.t option * Locations.Location_Bytes.t
val eval_lval : conflate_bottom:bool ->
with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.lval ->
Relations_type.Model.t * Locations.Zone.t option * Cvalue_type.V.t
val eval_offset : reduce_valid_index:Parameters.SafeArrays.t ->
with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Cil_types.typ ->
Relations_type.Model.t ->
Cil_types.offset -> Relations_type.Model.t * Locations.Zone.t option * Ival.t
val topify_offset : with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cvalue_type.V.t ->
Cil_types.offset -> Locations.Zone.t option * Cvalue_type.V.t
val eval_cond : with_alarms:CilE.warn_mode ->
Relations_type.Model.t -> cond -> Relations_type.Model.t
raises Reduce_to_bottom and never returns Relations_type.Model.bottom
exception Ignore
val resolv_func_vinfo : with_alarms:CilE.warn_mode ->
Locations.Zone.t option ->
Relations_type.Model.t ->
Cil_types.exp -> Locations.Zone.t option * Kernel_function.Hptset.t
val make_well : Cvalue_type.V.Top_Param.O.elt ->
Relations_type.Model.t -> Locations.location -> Relations_type.Model.t
val create_hidden_base : bool -> hidden_var_name:string -> name_desc:string -> Cil_types.typ -> Base.t
val initialize_var_using_type : Cil_types.varinfo -> Relations_type.Model.t -> Relations_type.Model.t
initialize_var_using_type varinfo state uses the type of varinfo to create an initial value in state.
val initial_state_only_globals : unit -> Relations_type.Model.t

type predicate_value =
| True
| False
| Unknown
exception Stop
val lop_to_cop : Cil_types.relation -> Cil_types.binop
val fold_on_disjunction : (Cil_types.predicate Cil_types.named -> 'a -> 'a) ->
Cil_types.predicate Cil_types.named -> 'a -> 'a
val count_disjunction : Cil_types.predicate Cil_types.named -> int
exception Predicate_alarm
val raise_predicate_alarm : unit -> 'a
val warn_raise_mode : CilE.warn_mode
val reduce_by_predicate : result:Cil_types.varinfo option ->
old:'a ->
Relations_type.Model.t ->
bool -> Cil_types.predicate Cil_types.named -> Relations_type.Model.t
exception Does_not_improve
val reduce_by_disjunction : result:Cil_types.varinfo option ->
old:'a ->
State_set.t -> int -> Cil_types.predicate Cil_types.named -> State_set.t
val eval_predicate : result:Cil_types.varinfo option ->
old:'a ->
State_set.t -> Cil_types.predicate Cil_types.named -> predicate_value
val string_of_status : predicate_value -> string
val check_postconditions : Db_types.kernel_function ->
Cil_types.kinstr ->
result:Cil_types.varinfo option ->
slevel:int ->
string ->
State_set.t ->
State_set.t ->
Cil_types.termination_kind -> Cil_types.funbehavior list -> State_set.t
val check_fct_postconditions : result:Cil_types.varinfo option ->
Kernel_function.t ->
State_set.t -> State_set.t -> Cil_types.termination_kind -> State_set.t
val check_preconditions : Db_types.kernel_function ->
Cil_types.kinstr ->
slevel:int ->
string ->
State_set.t ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> State_set.t
val check_fct_preconditions : Kernel_function.t -> Relations_type.Model.t -> State_set.t
val extract_valid_behaviors : State_set.t ->
('a, Cil_types.identified_predicate, 'b) Cil_types.spec ->
(Cil_types.identified_predicate, 'b) Cil_types.behavior list
val valid_behaviors : Kernel_function.t ->
Relations_type.Model.t ->
(Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.behavior list
val copy_offsetmap_from_virtual : with_alarms:CilE.warn_mode ->
Locations.location ->
Cil_types.lhost * Cil_types.offset ->
Locations.location -> Relations_type.Model.t -> Cvalue_type.V_Offsetmap.t
val need_cast : Cil_types.typ -> Cil_types.typ -> bool
module Computer: 
functor (AnalysisParam : sig
val stmt_can_reach : Cil_types.stmt -> Cil_types.stmt -> bool
val is_natural_loop : Cil_types.stmt -> bool
val slevel : int
val initial_state : State_set.t
end) -> sig .. end
val dummy_non_linear_assignment : '_a Ki.Hashtbl.t
module Loc_hashtbl: Hashtbl.Make(Locations.Location_Bits)
class do_non_linear_assignments : object .. end
val no_pretty : 'a -> 'b -> unit
val compute_non_linear_assignments : Cil_types.fundec -> Location_list.t Ki.Hashtbl.t
val compute_using_cfg : Kernel_function.t ->
call_kinstr:Cil_types.kinstr ->
State_set.t ->
Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t *
Locations.Location_Bits.Top_Param.t
module Leaf_Table: Kernel_function.Make_Table(Base)(sig
val dependencies : State.t list
val size : int
val name : string
val kind : [> `Internal ]
end)
Associates kernel_function to a fresh base for the address returned by the kernel_function.
val return_value : Cil_types.typ ->
Leaf_Table.key ->
Relations_type.Model.t -> Cvalue_type.V.t * Relations_type.Model.t
exception Deref_lvals of Cil_types.lval list
val compute_using_prototype : Kernel_function.t ->
state_with_formals:Relations_type.Model.t ->
Library_functions.Retres.data option * Relations_type.Model.t *
Locations.Location_Bits.Top_Param.t
val compute_using_mem : 'a ->
Relations_type.Model.t ->
'b * Relations_type.Model.t ->
Locations.Zone.t ->
Cvalue_type.Model.instanciation ->
'b * Relations_type.Model.t * Locations.Location_Bits.Top_Param.t
val initial_state_contextfree_only_globals : unit -> Relations_type.Model.t
Compute only once the initial values for globals and NULL
val initial_state_formals : Db_types.kernel_function -> Relations_type.Model.t -> Relations_type.Model.t
val fold_left2_best_effort : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a
val actualize_formals : Kernel_function.t ->
Relations_type.Model.t ->
('a * 'b * Cvalue_type.V_Offsetmap.t) list -> Relations_type.Model.t
val compute_with_initial_state : Kernel_function.t ->
Relations_type.Model.t ->
call_kinstr:Cil_types.kinstr ->
Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t *
Locations.Location_Bits.Top_Param.t
val compute_entry_point : Kernel_function.t ->
library:bool ->
Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t *
Locations.Location_Bits.Top_Param.t
exception Not_modular
exception Invalid_CEA_alloc
exception Invalid_CEA_memcpy
module Mem_Exec: Kernel_function.Make_Table(Datatype.Make(sig
include Datatype.Undefined
type t = Relations_type.Model.t *
(Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t) *
Locations.Zone.t * Locations.Zone.t
val name : string
val reprs : (Relations_type.Model.t *
(Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t) *
Locations.Zone.t * Locations.Zone.t)
list
end))(sig
val name : string
val size : int
val dependencies : State.t list
val kind : [> `Internal ]
end)
val compute_call : Kernel_function.t ->
call_kinstr:Cil_types.kinstr ->
Relations_type.Model.t ->
(Cil_types.exp * Cvalue_type.V.z * Cvalue_type.V_Offsetmap.t) list ->
Cvalue_type.V_Offsetmap.t option * Relations_type.Model.t *
Locations.Location_Bits.Top_Param.t
val memoize : Mem_Exec.key -> unit
val force_compute : unit -> unit
val _self : State.t