Commit 09db98a3 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

Try Why3: Tree view of goals

parent 907c910f
...@@ -163,14 +163,16 @@ let run textbox preview (_ : D.mouseEvent Js.t) : bool Js.t = ...@@ -163,14 +163,16 @@ let run textbox preview (_ : D.mouseEvent Js.t) : bool Js.t =
Stdlib.Mstr.fold Stdlib.Mstr.fold
(fun thname th acc -> (fun thname th acc ->
let tasks = Task.split_theory th None None in let tasks = Task.split_theory th None None in
let tasks = List.fold_left let tasks = List.map
(fun acc t -> (fun t ->
let tl = Trans.apply split_trans t in let (id,expl,_) = Termcode.goal_expl_task ~root:true t in
List.rev_append tl acc) let expl = match expl with
[] tasks | Some s -> s
| None -> id.Ident.id_string
in in
let tl = Trans.apply split_trans t in
let tasks = let tasks =
List.rev_map List.map
(fun task -> (fun task ->
let (id,expl,_) = Termcode.goal_expl_task ~root:false task in let (id,expl,_) = Termcode.goal_expl_task ~root:false task in
let expl = match expl with let expl = match expl with
...@@ -178,7 +180,15 @@ let run textbox preview (_ : D.mouseEvent Js.t) : bool Js.t = ...@@ -178,7 +180,15 @@ let run textbox preview (_ : D.mouseEvent Js.t) : bool Js.t =
| None -> id.Ident.id_string | None -> id.Ident.id_string
in in
let result = run_alt_ergo_on_task task in let result = run_alt_ergo_on_task task in
let result =
if String.length result > 80 then
"..." ^ String.sub result (String.length result - 80) 80
else result
in
[Html.of_string (expl ^" : " ^ result)]) [Html.of_string (expl ^" : " ^ result)])
tl
in
[Html.of_string expl; Html.ul tasks])
tasks tasks
in in
[ Html.of_string ("Theory " ^ thname); Html.ul tasks] [ Html.of_string ("Theory " ^ thname); Html.ul tasks]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment