aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfilliatr2003-04-08 14:33:39 +0000
committerfilliatr2003-04-08 14:33:39 +0000
commitb76827a83f6b7e98bccf484db7f1a3c15add2971 (patch)
tree1de98c719b5a7aae3c580703b6533dc91ea169bf
parentc1aa4794f782ede3493bf172658820491c7a5776 (diff)
test: un boolean et une fonction check_for_interrupt inseree dans la conversion pour permettre a Coq IDE d'interrompre Coq
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3871 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--kernel/reduction.ml1
-rw-r--r--lib/util.ml7
-rw-r--r--lib/util.mli6
3 files changed, 14 insertions, 0 deletions
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index a452138fc1..94363b2d19 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -150,6 +150,7 @@ let conv_sort_leq env s0 s1 = sort_cmp CUMUL s0 s1 Constraint.empty
(* Conversion between [lft1]term1 and [lft2]term2 *)
let rec ccnv cv_pb infos lft1 lft2 term1 term2 cuniv =
+ Util.check_for_interrupt ();
eqappr cv_pb infos
(lft1, whd_stack infos term1 [])
(lft2, whd_stack infos term2 [])
diff --git a/lib/util.ml b/lib/util.ml
index eca6e9885e..982546ca9c 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -723,3 +723,10 @@ let heap_size () =
(max_words_total * Sys.word_size / 8)
let heap_size_kb () = (heap_size () + 1023) / 1024
+
+(*s interruption *)
+
+let interrupt = ref false
+let check_for_interrupt () =
+ if !interrupt then begin interrupt := false; raise Sys.Break end
+
diff --git a/lib/util.mli b/lib/util.mli
index 03062e868e..e7a99acd27 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -217,3 +217,9 @@ val size_kb : 'a -> int
val heap_size : unit -> int
val heap_size_kb : unit -> int
+
+(*s Coq interruption: set the following boolean reference to interrupt Coq
+ (it eventually raises [Break], simulating a Ctrl-C) *)
+
+val interrupt : bool ref
+val check_for_interrupt : unit -> unit