aboutsummaryrefslogtreecommitdiff
path: root/test-suite/bugs
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2021-03-06 22:54:16 +0100
committerPierre-Marie Pédrot2021-03-12 13:37:37 +0100
commit93ea9206cbf29617feb23646f95e794b11e87793 (patch)
tree91308132147f00535892a7321dc22cfadb8cc9cd /test-suite/bugs
parentd33266649d285b7d8ba5a7093319faa6132d6bc9 (diff)
Algorithmically faster algorithm for term replacing.
Instead of recomputing the n-th lifts of terms for every subterm under a context, we introduce a table storing the value of this lift across contexts. While not the most efficient algorithmically, it is still much more efficient in practice and does not exhibit the exponential behaviour of replacing under different subcontexts. In an ideal world we would have an equality function on terms that allows to compute equality up to lifts, which would prevent having to even compute the lift at all, but the current fix has the advantage to be self-contained and not require dangerous tweaking of an equality function which is already complex enough as it is. Fixes #13896: cbn very slow.
Diffstat (limited to 'test-suite/bugs')
-rw-r--r--test-suite/bugs/closed/bug_13896.v24
1 files changed, 24 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/bug_13896.v b/test-suite/bugs/closed/bug_13896.v
new file mode 100644
index 0000000000..10f24d8564
--- /dev/null
+++ b/test-suite/bugs/closed/bug_13896.v
@@ -0,0 +1,24 @@
+Inductive type : Set :=
+ Tptr : type -> type
+ | Tref : type -> type
+ | Trv_ref : type -> type
+ | Tint : type -> type -> type
+ | Tvoid : type
+ | Tarray : type -> type -> type
+ | Tnamed : type -> type
+ | Tfunction : type -> type -> type -> type
+ | Tbool : type
+ | Tmember_pointer : type -> type -> type
+ | Tfloat : type -> type
+ | Tqualified : type -> type -> type
+ | Tnullptr : type
+ | Tarch : type -> type -> type
+.
+Definition type_eq_dec : forall (ty1 ty2 : type), { ty1 = ty2 } + { ty1 <> ty2 }.
+Proof. fix IHty1 1. decide equality. Defined.
+
+Goal (if type_eq_dec (Tptr Tvoid) (Tptr Tvoid) then True else False).
+Proof.
+timeout 1 cbn.
+constructor.
+Qed.