let translate logs smt w =
let goal = PO.make L_why w in
Logs.add_file logs goal ;
let base = Filename.chop_suffix goal ".why" in
let file = Printf.sprintf "%s_why.%s" base smt.ext in
Logs.add_file logs file ;
let args = Array.append smt.why [| goal |] in
let stdout = Buffer.create 512 in
Logs.command logs "why" args ;
Task.command ~stdout "why" args
>>? Logs.output logs stdout
>>= fun res ->
if res = 0 then Task.return file
else Task.failed "Why exit %d" res