module Property_status: sig
.. end
Local status
A local status (shortly, a status) of a property is a status directly set
by an emitter. Thus a property may have several distinct status according to
who attempts the verification.
Emitting a status
type
emitted_status =
| |
True |
| |
False_if_reachable |
| |
False_and_reachable |
| |
Dont_know |
Type of status emitted by analyzers. Each Property is attached to a program
point
s
and implicitely depends on an execution path from the program
entry point to
s
. It also depends on an explicit set of hypotheses
H
indicating when emitting the property (see function
Property_status.emit
).
module Emitted_status: Datatype.S
with type t = emitted_status
exception Inconsistent_emitted_status of emitted_status * emitted_status
val emit : Emitter.t ->
hyps:Property.t list ->
Property.t -> ?distinct:bool -> emitted_status -> unit
emit e ~hyps p s
indicates that the status of p
is s
, is emitted by
e
, and is based on the list of hypothesis hyps
. If e
previously
emitted another status s'
, it must be emitted with the same hypotheses and
a consistency check is performed between s
and s'
and the best (by
default the strongest) status is kept. If distinct
is true
(default is
false
), then we consider than the given status actually merges several
statuses coming from distinct execution paths. The strategy for computing
the best status is changed accordingly. One example when ~distinct:true
may be required is when emitting a status for a pre-condition of a function
f
since the status associated to a pre-condition p
merges all statuses
of p
at each callsite of the function f
.
Raises Inconsistent_emitted_status
when emiting False after emiting True or
conversely
Returns the kept status.
val emit_and_get : Emitter.t ->
hyps:Property.t list ->
Property.t ->
?distinct:bool ->
emitted_status -> emitted_status
val logical_consequence : Emitter.t -> Property.t -> Property.t list -> unit
logical_consequence e ppt list
indicates that the emitter e
considers
that ppt
is a logical consequence of the conjunction of properties
list
. Thus it lets the kernel automatically computes it: e
must not call
functions emit*
itself on this property, but the kernel ensures that the
status will be up-to-date when getting it.
val legal_dependency_cycle : Emitter.t -> Property.Set.t -> unit
The given properties may define a legal dependency cycle for the given
emitter.
Since Oxygen-20120901
val self : State.t
The state which stores the computed status.
Getting a (local) status
type
emitter_with_properties = private {
|
emitter : Emitter.Usable_emitter.t ; |
|
mutable properties : Property.t list ; |
|
logical_consequence : bool ; |
}
type
inconsistent = private {
}
type
status = private
Type of known precise status of a property.
include Datatype.S
val get : Property.t -> status
Returns the most precise status and all its emitters.
Consolidated status
module Consolidation: sig
.. end
Consolidation of a property status according to the (consolidated) status of
the hypotheses of the property.
module Feedback: sig
.. end
Lighter version than Consolidation
module Consolidation_graph: sig
.. end
See the consolidated status of a property in a graph, which all its
dependencies and their consolidated status.
Access to the registered properties
val iter : (Property.t -> unit) -> unit
val fold : (Property.t -> 'a -> 'a) -> 'a -> 'a
API not for casual users
val register : Property.t -> unit
Register the given property. It must not be already registered.
val register_property_add_hook : (Property.t -> unit) -> unit
add an hook that will be called for any newly registred property
Since Neon-20130301
val remove : Property.t -> unit
Remove the property deeply. Must be called only when removing the
corresponding annotation.
val register_property_remove_hook : (Property.t -> unit) -> unit
Add and hook that will be called each time a property is removed.
Since Neon-20130301
val merge : old:Property.t list -> Property.t list -> unit
merge old new
registers properties in new
which are not in old
and
removes properties in old
which are not in new
.
val automatically_proven : Property.t -> bool
Is the status of the given property only automatically handled by the
kernel?