aboutsummaryrefslogtreecommitdiff
path: root/test-suite/bugs
diff options
context:
space:
mode:
authorHugo Herbelin2020-04-21 11:48:01 +0200
committerHugo Herbelin2020-05-07 11:26:41 +0200
commitdd9bcf341e40b53710dc42b3cb49aed796612631 (patch)
tree72806fa5bba8ed6b617c7bdf52a9bd52ce063bb9 /test-suite/bugs
parentaa23fb72480182eddb7320ed59bf97448be7e04a (diff)
Tactic subst now inactive on section variables occurring indirectly in goal.
This is saner behavior making subst reversible, as discussed in #12139. This also fixes #10812 and #12139. In passing, we also simplify a bit the code of "subst_all".
Diffstat (limited to 'test-suite/bugs')
-rw-r--r--test-suite/bugs/closed/bug_10812.v28
1 files changed, 28 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/bug_10812.v b/test-suite/bugs/closed/bug_10812.v
new file mode 100644
index 0000000000..68f3814781
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10812.v
@@ -0,0 +1,28 @@
+(* subst with indirectly dependent section variables *)
+
+Section A.
+
+Variable a:nat.
+Definition b := a.
+
+Goal a=1 -> a+a=1 -> b=1.
+intros.
+Fail subst a. (* was working; we make it failing *)
+rewrite H in H0.
+discriminate.
+Qed.
+
+Goal a=1 -> a+a=1 -> b=1.
+intros.
+subst. (* should not apply to a *)
+rewrite H in H0.
+discriminate.
+Qed.
+
+Goal forall t, a=t -> b=t.
+intros.
+subst.
+reflexivity.
+Qed.
+
+End A.