Commit 27cac799 authored by MARCHE Claude's avatar MARCHE Claude

why3shell: command cd in progress

parent 5978853a
......@@ -55,7 +55,7 @@ let dummy_result =
pr_model = Model_parser.default_model;
}
let build_prover_call s id pr timelimit callback =
let build_prover_call _s _id _pr _timelimit callback =
let c = ref 0 in
let call () =
incr c;
......@@ -134,7 +134,7 @@ let timeout_handler () =
number of running provers, then we heuristically decide to add
more tasks *)
try
for i = Queue.length prover_tasks_in_progress
for _i = Queue.length prover_tasks_in_progress
to 3 * !max_number_of_running_provers do
let (s,id,pr,timelimit,callback) = Queue.pop scheduled_proof_attempts in
try
......
......@@ -798,7 +798,7 @@ module CombinedTheoryChecksum = struct
| None -> assert false
| Some c -> Buffer.add_string b (Termcode.string_of_checksum c)
let compute s th =
let _compute s th =
let () = fold_all_sub_goals_of_theory s f () th in
let c = Termcode.buffer_checksum b in
Buffer.clear b; c
......
......@@ -86,6 +86,7 @@ let comma fmt () = fprintf fmt ",@ "
let star fmt () = fprintf fmt "*@ "
let simple_comma fmt () = fprintf fmt ", "
let underscore fmt () = fprintf fmt "_"
let slash fmt () = fprintf fmt "/"
let semi fmt () = fprintf fmt ";@ "
let colon fmt () = fprintf fmt ":@ "
let space fmt () = fprintf fmt "@ "
......
......@@ -92,6 +92,7 @@ val simple_comma : formatter -> unit -> unit
val semi : formatter -> unit -> unit
val colon : formatter -> unit -> unit
val underscore : formatter -> unit -> unit
val slash : formatter -> unit -> unit
val equal : formatter -> unit -> unit
val arrow : formatter -> unit -> unit
val lbrace : formatter -> unit -> unit
......
......@@ -113,11 +113,23 @@ let ses =
module C = Why3.Controller_itp.Make(Unix_scheduler)
open Why3.Session_itp
open Why3
open Format
exception Error of string
let resolve _ses _path = assert false (* TODO *)
let curdir = ref []
let interp s =
match s with
let cmd,args =
match Strings.split ' ' s with
| [] -> assert false
| a::b -> a,b
in
match cmd with
| "?" ->
printf "Commands@\n";
printf "a : run a simple test of Unix_scheduler.timeout@\n";
......@@ -140,13 +152,32 @@ let interp s =
~prio:0
(fun () -> printf "idle@."; false)
| "p" ->
printf "%a@." print_session !ses
printf "%a@." Session_itp.print_session !ses
| "cd" ->
begin
match args with
| [d] ->
begin
try
let path = Strings.split '/' d in
let path =
if String.get d 0 = '/' then path
else !curdir @ path
in
let dir = resolve !ses path in
curdir := dir
with Error s ->
printf "command cd failed: %s@." s
end
| _ -> printf "command cd expects exactly one argument@."
end
| "pwd" -> printf "/%a@." (Pp.print_list Pp.slash Pp.string) !curdir
| "q" -> exit 0
| "ls" ->
let t = get_theories !ses in
let t = Session_itp.get_theories !ses in
List.iter
(fun (s,l) ->
printf "File: %s@\n" s;
printf "File: %s@\n" (Filename.basename s);
List.iter
(fun (th,_) ->
printf " Theory: %s@\n" th)
......
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