@ -22,26 +22,30 @@ module Import : sig
(* * {2 Imported types for ease of use and so we can write variants without the corresponding
module prefix } * )
type ' abductive_domain_t base_t = ' abductive_domain_t ExecutionDomain . base_t =
type ' abductive_domain_t execution_domain_ base_t = ' abductive_domain_t ExecutionDomain . base_t =
| ContinueProgram of ' abductive_domain_t
| ExitProgram of AbductiveDomain . summary
| AbortProgram of AbductiveDomain . summary
| LatentAbortProgram of { astate : AbductiveDomain . summary ; latent_issue : LatentIssue . t }
| ISLLatentMemoryError of ' abductive_domain_t
type ' a access_result = ' a PulseReport . access_result
type ' astate base_error = ' astate AccessResult . error =
| ReportableError of { astate : ' astate ; diagnostic : Diagnostic . t }
(* * {2 Monadic syntax} *)
include module type of IResult . Let_syntax
val ( let < * > ) : ' a access_result -> ( ' a -> ' b access_result list ) -> ' b access_result list
(* * monadic "bind" but not really that turns an [access_result] into a list of [access_result]s
( not really because the first type is not an [ access_result list ] but just an [ access_result ] ) * )
val ( let < * > ) : ' a AccessResult . t -> ( ' a -> ' b AccessResult . t list ) -> ' b AccessResult . t list
(* * monadic "bind" but not really that turns an [AccessResult.t] into a list of [AccessResult.t]s
( not really because the first type is not an [ AccessResult . t list ] but just an
[ AccessResult . t ] ) * )
val ( let < + > ) :
' a access_result -> ( ' a -> ' abductive_domain_t ) -> ' abductive_domain_t base_t access_result list
(* * monadic "map" but even less really that turns an [access_result] into an analysis result *)
' a AccessResult . t
-> ( ' a -> ' abductive_domain_t )
-> ' abductive_domain_t execution_domain_base_t AccessResult . t list
(* * monadic "map" but even less really that turns an [AccessResult.t] into an analysis result *)
end
include module type of Import
@ -49,16 +53,16 @@ include module type of Import
type t = AbductiveDomain . t
val check_addr_access :
access_mode -> Location . t -> AbstractValue . t * ValueHistory . t -> t -> t access_resul t
access_mode -> Location . t -> AbstractValue . t * ValueHistory . t -> t -> t AccessResult . t
(* * Check that the [address] is not known to be invalid *)
module Closures : sig
val check_captured_addresses : Location . t -> AbstractValue . t -> t -> ( t , Diagnostic . t * t ) resul t
val check_captured_addresses : Location . t -> AbstractValue . t -> t -> t AccessResult . t
(* * assert the validity of the addresses captured by the lambda *)
end
val eval :
access_mode -> Location . t -> Exp . t -> t -> ( t * ( AbstractValue . t * ValueHistory . t ) ) access_resul t
access_mode -> Location . t -> Exp . t -> t -> ( t * ( AbstractValue . t * ValueHistory . t ) ) AccessResult . t
(* * Use the stack and heap to evaluate the given expression down to an abstract address representing
its value .
@ -70,17 +74,17 @@ val eval_structure_isl :
-> Location . t
-> Exp . t
-> t
-> ( bool * ( t * ( AbstractValue . t * ValueHistory . t ) ) access_result list ) access_resul t
-> ( bool * ( t * ( AbstractValue . t * ValueHistory . t ) ) AccessResult . t list ) AccessResult . t
(* * Similar to eval but apply to data structures and ISL abduction. Return a list of abduced states
( ISLOk and ISLErs ) ; The boolean indicates whether it is data structures or not . * )
val prune : Location . t -> condition : Exp . t -> t -> t access_resul t
val prune : Location . t -> condition : Exp . t -> t -> t AccessResult . t
val eval_deref : Location . t -> Exp . t -> t -> ( t * ( AbstractValue . t * ValueHistory . t ) ) access_resul t
val eval_deref : Location . t -> Exp . t -> t -> ( t * ( AbstractValue . t * ValueHistory . t ) ) AccessResult . t
(* * Like [eval] but evaluates [ * exp]. *)
val eval_deref_isl :
Location . t -> Exp . t -> t -> ( t * ( AbstractValue . t * ValueHistory . t ) ) access_resul t list
Location . t -> Exp . t -> t -> ( t * ( AbstractValue . t * ValueHistory . t ) ) AccessResult . t list
val eval_access :
access_mode
@ -88,7 +92,7 @@ val eval_access :
-> AbstractValue . t * ValueHistory . t
-> BaseMemory . Access . t
-> t
-> ( t * ( AbstractValue . t * ValueHistory . t ) ) access_resul t
-> ( t * ( AbstractValue . t * ValueHistory . t ) ) AccessResult . t
(* * Like [eval] but starts from an address instead of an expression, checks that it is valid, and if
so dereferences it according to the access . * )
@ -100,7 +104,7 @@ val havoc_field :
-> Fieldname . t
-> ValueHistory . t
-> t
-> t access_resul t
-> t AccessResult . t
val realloc_pvar : Tenv . t -> Pvar . t -> Typ . t -> Location . t -> t -> t
@ -112,7 +116,7 @@ val write_field :
-> Fieldname . t
-> obj : AbstractValue . t * ValueHistory . t
-> t
-> t access_resul t
-> t AccessResult . t
(* * write the edge [ref --.field--> obj] *)
val write_arr_index :
@ -121,7 +125,7 @@ val write_arr_index :
-> index : AbstractValue . t
-> obj : AbstractValue . t * ValueHistory . t
-> t
-> t access_resul t
-> t AccessResult . t
(* * write the edge [ref\[index\]--> obj] *)
val write_deref :
@ -129,7 +133,7 @@ val write_deref :
-> ref : AbstractValue . t * ValueHistory . t
-> obj : AbstractValue . t * ValueHistory . t
-> t
-> t access_resul t
-> t AccessResult . t
(* * write the edge [ref -- * --> obj] *)
val write_deref_biad_isl :
@ -138,14 +142,14 @@ val write_deref_biad_isl :
-> AbstractValue . t HilExp . Access . t
-> obj : AbstractValue . t * ValueHistory . t
-> t
-> t access_resul t list
-> t AccessResult . t list
val invalidate :
Location . t -> Invalidation . t -> AbstractValue . t * ValueHistory . t -> t -> t access_resul t
Location . t -> Invalidation . t -> AbstractValue . t * ValueHistory . t -> t -> t AccessResult . t
(* * record that the address is invalid *)
val invalidate_biad_isl :
Location . t -> Invalidation . t -> AbstractValue . t * ValueHistory . t -> t -> t access_resul t list
Location . t -> Invalidation . t -> AbstractValue . t * ValueHistory . t -> t -> t AccessResult . t list
(* * record that the address is invalid. If the address has not been allocated, abduce ISL specs for
both invalid ( null , free , unint ) and allocated heap . * )
@ -161,28 +165,28 @@ val invalidate_access :
-> AbstractValue . t * ValueHistory . t
-> BaseMemory . Access . t
-> t
-> t access_resul t
-> t AccessResult . t
(* * record that what the address points via the access to is invalid *)
val invalidate_array_elements :
Location . t -> Invalidation . t -> AbstractValue . t * ValueHistory . t -> t -> t access_resul t
Location . t -> Invalidation . t -> AbstractValue . t * ValueHistory . t -> t -> t AccessResult . t
(* * record that all the array elements that address points to is invalid *)
val shallow_copy :
Location . t
-> AbstractValue . t * ValueHistory . t
-> t
-> ( t * ( AbstractValue . t * ValueHistory . t ) ) access_resul t
-> ( t * ( AbstractValue . t * ValueHistory . t ) ) AccessResult . t
(* * returns the address of a new cell with the same edges as the original *)
val get_dynamic_type_unreachable_values : Var . t list -> t -> ( Var . t * Typ . t ) list
(* * Given a list of variables, computes the unreachable values if the variables were removed from
the stack , then return the dynamic types of those values if they are available * )
val remove_vars : Tenv . t -> Var . t list -> Location . t -> t -> t access_resul t
val remove_vars : Tenv . t -> Var . t list -> Location . t -> t -> t AccessResult . t
val check_address_escape :
Location . t -> Procdesc . t -> AbstractValue . t -> ValueHistory . t -> t -> t access_resul t
Location . t -> Procdesc . t -> AbstractValue . t -> ValueHistory . t -> t -> t AccessResult . t
val call :
Tenv . t
@ -194,7 +198,7 @@ val call :
-> actuals : ( ( AbstractValue . t * ValueHistory . t ) * Typ . t ) list
-> formals_opt : ( Pvar . t * Typ . t ) list option
-> t
-> ExecutionDomain . t access_resul t list
-> ExecutionDomain . t AccessResult . t list
(* * perform an interprocedural call: apply the summary for the call proc name passed as argument if
it exists * )