KEventEvent logging and communication
Every relevant event must be logged through the functions in this module whether in single-process or multi-process mode. The subprocesses must not produce any output in multi-process mode and shall send their output as messages to the invariant manager instead.
Expose functions from logging module
include Log.Sigtype 'a log_printer =
Lib.log_level ->
('a, Stdlib.Format.formatter, unit) Stdlib.format ->
'atype 'a m_log_printer = Lib.kind_module -> 'a log_printerval set_module : Lib.kind_module -> unitSet module currently running
val get_module : unit -> Lib.kind_moduleGet module currently running
val get_log_format : unit -> log_formatReturns the log format
val set_log_format : log_format -> unitChooses the log format
Print the separator between JSON objects (could be nothing for incremental json, or comma for standard json)
val pp_print_kind_module_xml_src :
Stdlib.Format.formatter ->
Lib.kind_module ->
unitval printf_xml : 'a m_log_printerval printf_json : 'a m_log_printerval parse_log_xml : Lib.log_level -> Lib.position -> string -> unitval parse_log_json : Lib.log_level -> Lib.position -> string -> unitLogging instantiated with an actual relay function
include Log.SLogval log : 'a Log.log_printerlog m l f v ... outputs a message from module m on level l, formatted with the parameterized string f and the values v ...
log_uncond m f v ... outputs a message from module m unconditionally, formatted with the parameterized string f and the values v ...
val log_result :
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'a -> unit) ->
'a ->
unitlog_result pt xml json a outputs a result (for instance, for a post analysis) by choosing the right printing function depending on the output format
Relay log messages to invariant manager (overrides function from Log)
val log_step_cex :
Lib.kind_module ->
Lib.log_level ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string ->
(StateVar.t * Model.value list) list ->
unitLogs a step counterexample.
Should only be used by step for sending the cex, and invariant manager to actually print it.
val log_disproved :
Lib.kind_module ->
Lib.log_level ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string ->
(StateVar.t * Model.value list) list ->
unitLog a disproved property
Should only be used by the invariant manager, other modules must use prop_status to send it as a message.
val log_proved :
Lib.kind_module ->
Lib.log_level ->
TransSys.t ->
int option ->
string ->
unitLog a proved property
Should only be used by the invariant manager, other modules must use prop_status to send it as a message.
val log_with_tag :
Lib.log_level ->
(Stdlib.Format.formatter -> unit) ->
string ->
unitval log_prop_status :
Lib.log_level ->
TransSys.t ->
(string * Property.prop_status * Property.prop_kind) list ->
unitLog summary of status of properties
Should only be used by the invariant manager, other modules must use prop_status to send it as a message.
val log_stat :
Lib.kind_module ->
Lib.log_level ->
(string * Stat.snapshot list) list ->
unitLog statistics
Should only be used by the invariant manager, other modules must use stat to send it as a message.
Terminate log, called at the very end of a run. Output closing tags for XML output.
val log_run_end : _ InputSystem.t -> Analysis.result list -> unitLogs the end of a run. log_run_start results logs the end of a run.
val log_analysis_start :
'a InputSystem.t ->
TransSys.t ->
Analysis.param ->
unitLogs the start of an analysis. log_analysis_start top abs logs the start of an analysis for top system top with abstraction abs.
val log_contractck_analysis_start : 'a InputSystem.t -> Scope.t -> unitLogs the start of an analysis. Simplified version of log_analysis_start that is used for contract checking
Logs the end of an analysis. log_analysis_end logs the end of an analysis.
Logs the start of a post-analysis treatment. Arguments: * name of the treatment (concise, for XML) * title of the treatment (verbose, for pt)
val pp_print_trace_pt :
?title:string ->
?color:string ->
bool ->
Lib.log_level ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string option ->
bool ->
Stdlib.Format.formatter ->
(StateVar.t * Model.value list) list ->
unitval pp_print_trace_xml :
?tag:string ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string option ->
bool ->
Stdlib.Format.formatter ->
(StateVar.t * Model.value list) list ->
unitval pp_print_trace_json :
?object_name:string ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string option ->
bool ->
Stdlib.Format.formatter ->
(StateVar.t * Model.value list) list ->
unitEvents exposed to callers
type event = | Invariant of string list * Term.t * Certificate.t * bool| PropStatus of string * Property.prop_status| StepCex of string * (StateVar.t * Model.value list) listval pp_print_event : Stdlib.Format.formatter -> event -> unitPretty-print an event
val all_stats :
unit ->
(Lib.kind_module * (string * Stat.snapshot list) list) listReturn the last statistics received
val stat : (string * Stat.stat_item list) list -> unitOutput the statistics of the module
val invariant : string list -> Term.t -> Certificate.t -> bool -> unitBroadcast a discovered top level invariant
val step_cex :
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string ->
(StateVar.t * Model.value list) list ->
unitBroadcast a step cex
val prop_status :
Property.prop_status ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string ->
unitBroadcast a property status
val prop_invariant : TransSys.t -> string -> Certificate.t -> Term.TermSet.tBroadcast a property is invariant, and return a set of logical consequences that are also invariant
val cex_wam :
(StateVar.t * Model.value list) list ->
(string * bool) list ->
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
string ->
unitval proved_wam : Certificate.t -> TransSys.t -> string -> unitval unknown_wam : TransSys.t -> string -> unitval execution_path :
?full_contract:bool ->
'a InputSystem.t ->
TransSys.t ->
(StateVar.t * Model.value list) list ->
unitBroadcast an execution path
val recv : unit -> (Lib.kind_module * event) listReceive all queued events
Terminates if a termination message was received. Does NOT modify received messages.
val update_trans_sys_sub :
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
(Lib.kind_module * event) list ->
(Term.TermSet.t * Term.TermSet.t) Scope.Map.t
* (Lib.kind_module * (string * Property.prop_status)) listUpdate transition system from events and return new invariants INCLUDING subsystem ones, scoped and properties with changed status.
For a property status message the status saved in the transition system is updated if the status is more general (k-true for a greater k, k-false for a smaller k, etc.).
Received invariants are stored in the transition system, also proved properties are added as invariants.
Counterexamples are ignored.
val update_trans_sys :
'a InputSystem.t ->
Analysis.param ->
TransSys.t ->
(Lib.kind_module * event) list ->
(Term.TermSet.t * Term.TermSet.t)
* (Lib.kind_module * (string * Property.prop_status)) listUpdate transition system from events and return new top level invariants and properties with changed status.
For a property status message the status saved in the transition system is updated if the status is more general (k-true for a greater k, k-false for a smaller k, etc.).
Received invariants are stored in the transition system, also proved properties are added as invariants.
Counterexamples are ignored.
val setup : unit -> messaging_setupCreate the messaging system in the supervisor
val run_im : messaging_setup -> unitTake the supervisor role in the calling domain
val purge_im : messaging_setup -> unitPurge the invariant manager mailbox. Should be called between two analyses, after all engines of the previous analysis have exited, to get rid of messages from the previous analysis.
val register_worker : Lib.kind_module -> int -> messaging_setup -> mworkerCreate and register the mailbox of an engine with the given identifier. Must be called in the supervisor, before the engine domain is spawned, so that no message sent from then on is missed.
Start messaging for a process. Must be called in the domain of the engine with the registration returned by register_worker.
val unregister_worker : mworker -> unitUnregister the mailbox of an engine that never ran because its domain could not be spawned
Send a termination message to the engine with the given identifier
val exit : mworker -> unitUnregister the mailbox of an engine
val pp_print_user_node_name :
'a InputSystem.t ->
Stdlib.Format.formatter ->
Scope.t ->
unitval pp_print_path_pt :
?full_contract:bool ->
'a InputSystem.t ->
TransSys.t ->
Stdlib.Format.formatter ->
(StateVar.t * Model.value list) list ->
unit