aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pretyping/detyping.ml3
-rw-r--r--test-suite/complexity/lettuple.v29
-rw-r--r--test-suite/complexity/ring2.v2
3 files changed, 32 insertions, 2 deletions
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml
index 905bb49e0..6560f7b48 100644
--- a/pretyping/detyping.ml
+++ b/pretyping/detyping.ml
@@ -327,7 +327,6 @@ let detype_case computable detype detype_eqns testdep avoid data p c bl =
n, aliastyp, Some typ
in
let constructs = Array.init (Array.length bl) (fun i -> (indsp,i+1)) in
- let eqnl = detype_eqns constructs consnargsl bl in
let tag =
try
if !Flags.raw_print then
@@ -355,8 +354,10 @@ let detype_case computable detype detype_eqns testdep avoid data p c bl =
RIf (dl,tomatch,(alias,pred),
Option.get nondepbrs.(0),Option.get nondepbrs.(1))
else
+ let eqnl = detype_eqns constructs consnargsl bl in
RCases (dl,tag,pred,[tomatch,(alias,aliastyp)],eqnl)
| _ ->
+ let eqnl = detype_eqns constructs consnargsl bl in
RCases (dl,tag,pred,[tomatch,(alias,aliastyp)],eqnl)
let detype_sort = function
diff --git a/test-suite/complexity/lettuple.v b/test-suite/complexity/lettuple.v
new file mode 100644
index 000000000..f97decf0a
--- /dev/null
+++ b/test-suite/complexity/lettuple.v
@@ -0,0 +1,29 @@
+(* This example checks if printing nested let-in's stays in linear time *)
+(* Expected time < 1.00s *)
+
+Definition f (x : nat * nat) :=
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ let (a,b) := x in
+ 0.
+
+Timeout 5 Print f.
diff --git a/test-suite/complexity/ring2.v b/test-suite/complexity/ring2.v
index af678a2e1..ab57afdbb 100644
--- a/test-suite/complexity/ring2.v
+++ b/test-suite/complexity/ring2.v
@@ -1,4 +1,4 @@
-(* This example, checks the efficiency of the abstract machine used by ring *)
+(* This example checks the efficiency of the abstract machine used by ring *)
(* Expected time < 1.00s *)
Require Import BinInt Zbool.