aboutsummaryrefslogtreecommitdiff
path: root/ide/coqOps.ml
diff options
context:
space:
mode:
authorEnrico Tassi2014-03-12 17:39:42 +0100
committerEnrico Tassi2014-03-12 17:39:42 +0100
commita67c3fe2a5445bf2be94e654aac6ea328cbcd74e (patch)
treef549e2726eca0966bde5c085ddc09a4921788a4d /ide/coqOps.ml
parenta622c4c951f559fa05d45a45b4b25ace00793281 (diff)
Stm: smarter delegation policy
Stm used to delegate every proof when it was possible, but this may be a bad idea. Small proofs may take less time than the overhead delegation implies (marshalling, etc...). Now it delegates only proofs that take >= 1 second. By default a proof takes 1 second (that may be wrong). If the file was compiled before, it reuses the data stored in the .aux file and assumes the timings are still valid. After a proof is checked, Coq knows how long it takes for real, so it wont predict it wrong again (when the user goes up and down in the file for example). CoqIDE now sends to Coq, as part of the init message, the file name so that Coq can load the .aux file.
Diffstat (limited to 'ide/coqOps.ml')
-rw-r--r--ide/coqOps.ml29
1 files changed, 2 insertions, 27 deletions
diff --git a/ide/coqOps.ml b/ide/coqOps.ml
index a43a7989a1..18069c471b 100644
--- a/ide/coqOps.ml
+++ b/ide/coqOps.ml
@@ -764,32 +764,7 @@ object(self)
let next = function
| Fail _ -> messages#set ("Couln't initialize Coq"); Coq.return ()
| Good id -> initial_state <- id; Coq.return () in
- Coq.bind (Coq.init ()) next in
- let add_load_path = match get_filename () with
- | None -> Coq.return ()
- | Some f ->
- let dir = Filename.dirname f in
- let loadpath = Coq.inloadpath dir in
- let next = function
- | Fail (_, _, s) ->
- messages#set
- ("Could not determine lodpath, this might lead to problems:\n"^s);
- Coq.return ()
- | Good true -> Coq.return ()
- | Good false ->
- let cmd = Printf.sprintf "Add LoadPath \"%s\". " dir in
- let cmd = Coq.add ((cmd,hidden_edit_id ()),(Stateid.initial,false)) in
- let next = function
- | Fail (_, l, str) ->
- messages#set ("Couln't add loadpath:\n"^str);
- Coq.return ()
- | Good (id, _) ->
- initial_state <- id; Coq.return ()
- in
- Coq.bind cmd next
- in
- Coq.bind loadpath next
- in
- Coq.seq get_initial_state (Coq.seq add_load_path Coq.PrintOpt.enforce)
+ Coq.bind (Coq.init (get_filename ())) next in
+ Coq.seq get_initial_state Coq.PrintOpt.enforce
end