Skip to content
Snippets Groups Projects
Commit 06e25b89 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[wp/why3] update why3 command outputs

parent 432da749
No related branches found
No related tags found
No related merge requests found
...@@ -133,21 +133,21 @@ class visitor fmt c = ...@@ -133,21 +133,21 @@ class visitor fmt c =
method add_import ?was thy = method add_import ?was thy =
self#lines ; self#lines ;
match was with match was with
| None -> Format.fprintf fmt "use import %s@\n" thy | None -> Format.fprintf fmt "use %s@\n" thy
| Some was -> Format.fprintf fmt "use import %s as %s@\n" thy was | Some was -> Format.fprintf fmt "use %s as %s@\n" thy was
method add_import2 file thy = method add_import2 file thy =
self#lines ; self#lines ;
Format.fprintf fmt "use import %s.%s@\n" file thy Format.fprintf fmt "use %s.%s@\n" file thy
method add_import3 file thy name = method add_import3 file thy name =
self#lines ; self#lines ;
Format.fprintf fmt "use import %s.%s as %s@\n" file thy name Format.fprintf fmt "use %s.%s as %s@\n" file thy name
method on_cluster c = method on_cluster c =
self#lines ; self#lines ;
let name = (cluster_id c) in let name = (cluster_id c) in
Format.fprintf fmt "use import %s.%s@\n" Format.fprintf fmt "use %s.%s@\n"
name (Transitioning.String.capitalize_ascii name) ; name (Transitioning.String.capitalize_ascii name) ;
deps <- (D_cluster c) :: deps deps <- (D_cluster c) :: deps
...@@ -348,7 +348,7 @@ let assemble_goal ~id ~title ~theory ?axioms prop fmt = ...@@ -348,7 +348,7 @@ let assemble_goal ~id ~title ~theory ?axioms prop fmt =
engine#set_goal true ; engine#set_goal true ;
engine#global engine#global
begin fun () -> begin fun () ->
v#printf "@[<hv 2>goal %s \"expl:%s\":@ %a@]@\n@\n" v#printf "@[<hv 2>goal %s[@expl:%s]:@ %a@]@\n@\n"
why3_goal_name why3_goal_name
title title
engine#pp_prop (F.e_prop prop) ; engine#pp_prop (F.e_prop prop) ;
...@@ -469,11 +469,11 @@ let assemble_goal wpo = ...@@ -469,11 +469,11 @@ let assemble_goal wpo =
open ProverTask open ProverTask
let p_goal = p_until_space ^ " " ^ p_until_space ^ " " ^ p_until_space ^ " : " let p_goal = ".* [a-zA-Z0-9_]+: "
let p_valid = p_goal ^ "Valid (" ^ p_float ^ "s\\(,[^)]*\\)?)" let p_valid = p_goal ^ "Valid (" ^ p_float ^ "s\\(,[^)]*\\)?)"
let p_limit = p_goal ^ "Timeout" let p_limit = p_goal ^ "Timeout"
let p_error = "File " ^ p_string ^ ", line " ^ p_int ^ ", characters " let p_error = "File " ^ p_string ^ ", line " ^ p_int ^ ", characters "
^ p_int ^ "-" ^ p_int ^ ":\n\\(warning:\\)?" ^ p_int ^ "-" ^ p_int ^ ":\nsyntax error"
let re_valid = Str.regexp p_valid let re_valid = Str.regexp p_valid
let re_limit = Str.regexp p_limit let re_limit = Str.regexp p_limit
...@@ -515,17 +515,13 @@ class why3 ~timeout ~prover ~pid ~file ~includes ~logout ~logerr = ...@@ -515,17 +515,13 @@ class why3 ~timeout ~prover ~pid ~file ~includes ~logout ~logerr =
method private time t = time <- t method private time t = time <- t
method private error (a : pattern) = method private error (a : pattern) =
try let lpos = ProverTask.location (a#get_string 1) (a#get_int 2) in
let _warning = a#get_string 5 in error <- Error_Generated ( lpos , "why3 " ^ a#get_after ~offset:1 4 )
()
with Not_found ->
let lpos = ProverTask.location (a#get_string 1) (a#get_int 2) in
error <- Error_Generated ( lpos , a#get_after ~offset:1 4 )
method private valid (a : pattern) = method private valid (a : pattern) =
begin begin
valid <- true ; valid <- true ;
time <- a#get_float 4 ; time <- a#get_float 1 ;
end end
method private limit (_a : pattern) = method private limit (_a : pattern) =
...@@ -541,10 +537,10 @@ class why3 ~timeout ~prover ~pid ~file ~includes ~logout ~logerr = ...@@ -541,10 +537,10 @@ class why3 ~timeout ~prover ~pid ~file ~includes ~logout ~logerr =
match error with match error with
| Error_Generated(pos,message) -> | Error_Generated(pos,message) ->
let source = Cil_datatype.Position.of_lexing_pos pos in let source = Cil_datatype.Position.of_lexing_pos pos in
Wp_parameters.error ~source "Why3 error:@\n%s" message ; Wp_parameters.error ~source "%s" message ;
VCS.failed ~pos message VCS.failed ~pos message
| Error_No -> | Error_No ->
if r = 0 then if r = 0 || r = 1 then
let verdict = let verdict =
if valid then VCS.Valid else if valid then VCS.Valid else
if limit then VCS.Timeout else if limit then VCS.Timeout else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment