Frama-C API - Cvalue_transfer
Transfer functions for the main domain of the Value analysis.
type value = Main_values.CVal.ttype origin = valuetype location = Main_locations.PLoc.locationinclude Abstract_domain.Transfer with type state := Frama_c_kernel.Cvalue.Model.t and type value := value and type location := location and type origin := origin
val update : (value, location, origin) Abstract_domain.valuation -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.t Eval.or_bottomupdate valuation t updates the state t with the values of expressions and the locations of lvalues available in the valuation record.
val assign : pos:Position.t -> location Eval.left_value -> Eval.exp -> (location, value) Eval.assigned -> (value, location, origin) Abstract_domain.valuation -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.t Eval.or_bottomassign ~pos lv expr v valuation state is the transfer function for the assignment lv = expr for state. It must return the state where the assignment has been performed.
posis the position of the assignment, designating either a global initialization or a function assignment statement with the current callstack.- when the position is a function call,
expris the special variable in!Eval.call.return. vcarries the value being assigned tolv, i.e. the value of the expressionexpr.valso denotes the kind of assignment: Assign for the default assignment of the value, or Copy for the exact copy of a location if the right expressionexpris a lvalue.valuationis a cache of all sub-expressions and locations computed for the evaluation oflvalandexpr; it can also be used to reduce the state.
val assume : pos:Position.t -> Eval.exp -> bool -> (value, location, origin) Abstract_domain.valuation -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.t Eval.or_bottomTransfer function for an assumption. assume ~pos expr bool valuation state returns a state in which the boolean expression expr evaluates to bool.
posis the analysis position of the assumption.valuationis a cache of all sub-expressions and locations computed for the evaluation and the reduction ofexpr; it can also be used to reduce the state.
val start_call : pos:Position.local -> (location, value) Eval.call -> Eval.recursion option -> (value, location, origin) Abstract_domain.valuation -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.t Eval.or_bottomstart_call ~pos call recursion valuation state returns an initial state for the analysis of a called function. In particular, this function should introduce the formal parameters in the state, if necessary.
posis the analysis position of the call site;callrepresents the call: the called function and the arguments;recursionis the information needed to interpret a recursive call. It is None if the call is not recursive.stateis the abstract state at the call site, before the call;valuationis a cache for all values and locations computed during the evaluation of the function and its arguments.
On recursive calls, recursion contains some substitution of variables to be applied on the domain state to prevent mixing up local variables and formal parameters of different recursive calls. See Eval.recursion for more details. This substitution has been applied on values and expressions in call, but not in the valuation given as argument. If the domain uses some information from the valuation on a recursive call, it must apply the substitution on it.
val finalize_call : pos:Position.local -> (location, value) Eval.call -> Eval.recursion option -> pre:Frama_c_kernel.Cvalue.Model.t -> post:Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.t Eval.or_bottomfinalize_call ~pos call recursion ~pre ~post computes the state after a function call, given the state pre before the call, and the state post at the end of the called function.
posis the analysis position of the call site;callrepresents the function call and its arguments.recursionis the information needed to interpret a recursive call. It is None if the call is not recursive.preandpostare the states before and at the end of the call respectively.
val show_expr : (value, location, origin) Abstract_domain.valuation -> Frama_c_kernel.Cvalue.Model.t -> Stdlib.Format.formatter -> Eval.exp -> unitCalled on the Frama_C_domain_show_each directive. Prints the internal properties inferred by the domain in the state about the expression exp. Can use the valuation resulting from the cooperative evaluation of the expression. Defined by Domain_builder.Complete but prints nothing.
val warn_imprecise_write : ?prefix:string -> Eva_ast.lval -> Frama_c_kernel.Locations.location -> Frama_c_kernel.Cvalue.V.t -> unitwarn_imprecise_write lval loc v emits a warning about the assignment of value v into location loc if one of them is overly imprecise. lval is the assigned lvalue, and prefix is an optional prefix to the warning.
val warn_imprecise_offsm_write : ?prefix:string -> Eva_ast.lval -> Frama_c_kernel.Cvalue.V_Offsetmap.t -> unitwarn_imprecise_offsm_write lval offsm emits a warning about the assignment of offsetmap offsm if it contains an overly imprecise value. lval is the assigned lvalue, and prefix is an optional prefix to the warning.
