aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-11-06 14:00:41 +0100
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-11-06 14:27:11 +0100
commit6b3d6f9326de9e53805d14e78577411c7174a998 (patch)
tree70e8e0fdca523be276449b7c45b14b556b73bc2b
parentce6392e74fbe0edd5ebcaecb362fec5da9b4703b (diff)
Fixing complexity issue with f_equal. Thanks to J.-H. Jourdan
for reporting it. A "cut" was not appropriately chained on the second goal but on both goals, with the chaining on the first goal introducing noise.
-rw-r--r--plugins/cc/cctac.ml4
-rw-r--r--test-suite/complexity/f_equal.v14
2 files changed, 16 insertions, 2 deletions
diff --git a/plugins/cc/cctac.ml b/plugins/cc/cctac.ml
index 068cb25cf..371f76cf3 100644
--- a/plugins/cc/cctac.ml
+++ b/plugins/cc/cctac.ml
@@ -501,9 +501,9 @@ let f_equal =
let concl = Proofview.Goal.concl gl in
let cut_eq c1 c2 =
try (* type_of can raise an exception *)
- Tacticals.New.tclTHEN
+ Tacticals.New.tclTHENS
(mk_eq _eq c1 c2 Tactics.cut)
- (Tacticals.New.tclTRY ((new_app_global _refl_equal [||]) apply))
+ [Proofview.tclUNIT ();Tacticals.New.tclTRY ((new_app_global _refl_equal [||]) apply)]
with e when Proofview.V82.catchable_exception e -> Proofview.tclZERO e
in
Proofview.tclORELSE
diff --git a/test-suite/complexity/f_equal.v b/test-suite/complexity/f_equal.v
new file mode 100644
index 000000000..30e87939e
--- /dev/null
+++ b/test-suite/complexity/f_equal.v
@@ -0,0 +1,14 @@
+(* Checks that f_equal does not reduce the term uselessly *)
+(* Expected time < 1.00s *)
+
+Fixpoint stupid (n : nat) : unit :=
+match n with
+| 0 => tt
+| S n =>
+ let () := stupid n in
+ let () := stupid n in
+ tt
+end.
+
+Goal stupid 23 = stupid 23.
+f_equal.