[pulse] log summary creation

Summary:
This step does extra normalization so it's useful to see what's going on
when debugging. Log stuff in the html debug of the exit node.

Reviewed By: da319

Differential Revision: D22596248

fbshipit-source-id: cde3bbb6c
master
Jules Villard 4 years ago committed by Facebook GitHub Bot
parent 2dc830735e
commit 660eceb20f

@ -7,6 +7,7 @@
open! IStd open! IStd
module F = Format module F = Format
module L = Logging
module AbductiveDomain = PulseAbductiveDomain module AbductiveDomain = PulseAbductiveDomain
type t = type t =
@ -48,7 +49,8 @@ let map ~f exec_state =
let of_posts pdesc posts = let of_posts pdesc posts =
List.filter_map posts ~f:(fun exec_state -> List.filter_mapi posts ~f:(fun i exec_state ->
let (AbortProgram astate | ContinueProgram astate | ExitProgram astate) = exec_state in let (AbortProgram astate | ContinueProgram astate | ExitProgram astate) = exec_state in
L.d_printfln "Creating spec out of state #%d:@\n%a" i pp exec_state ;
if PulseArithmetic.is_unsat_expensive astate then None if PulseArithmetic.is_unsat_expensive astate then None
else Some (map exec_state ~f:(AbductiveDomain.of_post pdesc)) ) else Some (map exec_state ~f:(AbductiveDomain.of_post pdesc)) )

@ -11,11 +11,15 @@ open PulseDomainInterface
type t = ExecutionDomain.t list type t = ExecutionDomain.t list
let of_posts pdesc posts = ExecutionDomain.of_posts pdesc posts
let pp fmt summary = let pp fmt summary =
F.open_vbox 0 ; F.open_vbox 0 ;
F.fprintf fmt "%d pre/post(s)@;" (List.length summary) ; F.fprintf fmt "%d pre/post(s)@;" (List.length summary) ;
List.iteri summary ~f:(fun i pre_post -> List.iteri summary ~f:(fun i pre_post ->
F.fprintf fmt "#%d: @[%a@]@;" i ExecutionDomain.pp pre_post ) ; F.fprintf fmt "#%d: @[%a@]@;" i ExecutionDomain.pp pre_post ) ;
F.close_box () F.close_box ()
let of_posts pdesc posts =
AnalysisCallbacks.html_debug_new_node_session (Procdesc.get_exit_node pdesc)
~pp_name:(fun fmt -> F.pp_print_string fmt "pulse summary creation")
~f:(fun () -> ExecutionDomain.of_posts pdesc posts)

Loading…
Cancel
Save