Frama-C API - Domain
include Abstract_domain.Queries with type context = Context.t with type value = Value.t with type location = Loc.location
type context = Context.tDomains can optionally provide a context to be used by value abstractions when evaluating expressions. This can be safely ignored for most domains. Defined as unit (no context) by Domain_builder.Complete.
type value = Value.tNumerical values to which the expressions are evaluated.
type location = Loc.locationAbstract memory locations associated to left values.
The origin is used by the domain combiners to track the origin of a value. An abstract domain can always use a dummy type unit for origin, or use it to encode some specific information about a value.
Queries functions return a pair of:
- the set of alarms that ensures the of the soundness of the evaluation of
exp.Alarmset.allis always a sound over-approximation of these alarms. - a value for the expression, which can be: – `Bottom if its evaluation is infeasible; – `Value (v, o) where
vis an over-approximation of the abstract value of the expressionexp, andois the origin of the value, which can be None.
When evaluating an expression, the evaluation engine asks the domains for abstract values and alarms at each lvalue (via extract_lval) and each sub-expressions (via extract_expr). In these queries:
oracleis an evaluation function and can be used to find the answer by evaluating some others expressions, especially by relational domain. No recursive evaluation should be done by this function.contextrecord gives some information about the current evaluation.
val extract_expr : oracle:(Eval.exp -> value Eval.evaluated) -> Abstract_domain.evaluation_context -> state -> Eval.exp -> (value * origin option) Eval.evaluatedQuery function for compound expressions: extract_expr ~oracle context t exp returns the known value of exp by the state t. See above for more details on queries.
val extract_lval : oracle:(Eval.exp -> value Eval.evaluated) -> Abstract_domain.evaluation_context -> state -> Eval.lval -> location -> (value * origin option) Eval.evaluatedQuery function for lvalues: extract_lval ~oracle context t lval loc returns the known value stored at the location loc of the left value lval. See above for more details on queries.
val backward_location : state -> Eval.lval -> location -> value -> (location * value) Eval.or_bottombackward_location state lval typ loc v reduces the location loc of the lvalue lval, so that only the locations that may have value v are kept. The returned location must be included in loc, but it is always sound to return loc itself. Also returns the value that may have the returned location, if not bottom. Defined by Domain_builder.Complete with no reduction.
Given a reduction expr = value, provides more reductions that may be performed. Defined by Domain_builder.Complete with no reduction.
val build_context : state -> context Eval.or_bottomReturns the current context to be used by value abstractions for the evaluation of expressions or lvalues. Defined by Domain_builder.Complete with no context.
include Frama_c_kernel.Datatype.S with type t = state
include Frama_c_kernel.Datatype.S_no_copy with type t = state
include Frama_c_kernel.Datatype.Ty with type t = state
type t = stateval ty : t Frama_c_kernel.Type.tval datatype_descr : t Frama_c_kernel.Descr.tDatatype descriptor.
val packed_descr : Frama_c_kernel.Structural_descr.packPacked version of the descriptor.
val reprs : t listList of representants of the descriptor.
val hash : t -> intHash function: same spec than Hashtbl.hash.
val pretty : Stdlib.Format.formatter -> t -> unitPretty print each value in an user-friendly way.
val mem_project : (Frama_c_kernel.Project_skeleton.t -> bool) -> t -> boolmem_project f x must return true iff there is a value p of type Project.t in x such that f p returns true.
