Commit 04bc675b authored by Sylvain Dailler's avatar Sylvain Dailler

Changed node type and node info.

Ide server compiles.
Gtk ide still does not compile.
parent 02457a14
open Format
(*open Format
open Why3
open Gconfig
open Stdlib
......@@ -39,7 +39,7 @@ module Protocol_why3ide = struct
l
let send_request r =
print_request_debug (fst r);
print_request_debug r;
Debug.dprintf debug_proto "@.";
list_requests := r :: !list_requests
......@@ -217,7 +217,7 @@ let (_ : GtkSignal.id) = main_window#connect#destroy
let (_ : GMenu.menu_item) =
file_factory#add_item ~key:GdkKeysyms._S "_Save session"
~callback:(fun () -> send_request (Save_req, root_node))
~callback:(fun () -> send_request Save_req)
let (replay_menu_item : GMenu.menu_item) =
file_factory#add_item ~key:GdkKeysyms._R "_Replay all"
......@@ -436,21 +436,21 @@ let _ =
let () =
let n = gconfig.session_nb_processes in
Debug.dprintf debug "[IDE] setting max proof tasks to %d@." n;
send_request (Set_max_tasks_req n, root_node)
send_request (Set_max_tasks_req n)
let (_ : GtkSignal.id) =
replay_menu_item#connect#activate
~callback:(fun () -> send_request (Replay_req, root_node))
~callback:(fun () -> send_request Replay_req)
(***********************************)
(* Mapping session to the GTK tree *)
(***********************************)
let node_id_type : node_type Hint.t = Hint.create 17
let node_id_info : node_info Hint.t = Hint.create 17
let node_id_proved : bool Hint.t = Hint.create 17
let get_node_type id = Hint.find node_id_type id
let get_node_info id = Hint.find node_id_info id
let get_node_proved id = Hint.find node_id_proved id
let get_node_id iter = goals_model#get ~row:iter ~column:node_id_column
......@@ -484,7 +484,7 @@ let image_of_result ~obsolete rOpt =
let set_status_column iter =
let id = get_node_id iter in
let proved = (get_node_info id).proved in
let proved = get_node_proved id in
let image = match get_node_type id with
| NRoot -> assert false
| NFile
......@@ -494,7 +494,7 @@ let set_status_column iter =
if proved
then !image_valid
else !image_unknown
| NProofAttempt (pa, obs) ->
| NProofAttempt ->
image_of_result ~obsolete:obs pa
in
goals_model#set ~row:iter ~column:status_column image
......@@ -761,3 +761,4 @@ let () =
message_zone#buffer#set_text "Welcome to Why3 IDE\ntype 'help' for help";
main_window#show ();
GMain.main ()
*)
......@@ -71,6 +71,11 @@ type controller =
controller_provers : (Whyconf.config_prover * Driver.driver) Whyconf.Hprover.t;
}
let clear_proof_state c =
Hid.clear c.proof_state.th_state;
Htn.clear c.proof_state.tn_state;
Hpn.clear c.proof_state.pn_state
exception LoadDriverFailure of Whyconf.config_prover * exn
let create_controller env provers =
......@@ -98,8 +103,8 @@ let create_controller env provers =
provers;
c
let init_controller s c =
clear_proof_state (c);
c.controller_session <- s
let tn_proved c tid = Htn.find_def c.proof_state.tn_state false tid
......
This diff is collapsed.
......@@ -59,7 +59,7 @@ type node_type =
| NTheory
| NTransformation
| NGoal
| NProofAttempt (* of Call_provers.prover_answer option * bool *)
| NProofAttempt
type update_info =
| Proved of bool
......@@ -67,7 +67,6 @@ type update_info =
Controller_itp.proof_attempt_status
* bool (* obsolete or not *)
* Call_provers.resource_limit
(* or 3 constructors if better *)
type notification =
| New_node of node_ID * node_ID * node_type * string
......@@ -88,27 +87,25 @@ type notification =
| Task of node_ID * string
(* the node_ID's task *)
type request_type =
| Command_req of string
| Prove_req of prover * resource_limit
| Transform_req of transformation * string list
| Strategy_req of strategy
| Open_req of string
type ide_request =
| Command_req of node_ID * string
| Prove_req of node_ID * prover * resource_limit
| Transform_req of node_ID * transformation * string list
| Strategy_req of node_ID * strategy
| Open_session_req of string
| Add_file_req of string
| Set_max_tasks_req of int
| Get_task
| Get_task of node_ID
| Get_Session_Tree_req
| Save_req
| Reload_req
| Replay_req
| Exit_req
val print_request: Format.formatter -> request_type -> unit
val print_request: Format.formatter -> ide_request -> unit
val print_msg: Format.formatter -> message_notification -> unit
val print_notify: Format.formatter -> notification -> unit
(* TODO: change to request_type * node_ID list ? *)
type ide_request = request_type * node_ID
(* The server part of the protocol *)
module type Protocol = sig
......
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