aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/omega
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-06-02 15:02:12 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-06-02 15:02:12 +0200
commitce1e1dba837ad6e2c79ff7e531b5e3adea3cd327 (patch)
tree9eaffc54269f33d7da29620fb154de20f7003b23 /plugins/omega
parent03fee03c9bc31225d8f0c3a1cef206145490d341 (diff)
parent1d6a1036a7c472e1f20c5ec586d2484203a2fe2e (diff)
Merge PR#705: Fix bug #5019 (looping zify on dependent types)
Diffstat (limited to 'plugins/omega')
-rw-r--r--plugins/omega/PreOmega.v7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/omega/PreOmega.v b/plugins/omega/PreOmega.v
index 5f5f548f8..6c0e2d776 100644
--- a/plugins/omega/PreOmega.v
+++ b/plugins/omega/PreOmega.v
@@ -174,12 +174,18 @@ Ltac zify_nat_op :=
match isnat with
| true => simpl (Z.of_nat (S a)) in H
| _ => rewrite (Nat2Z.inj_succ a) in H
+ | _ => (* if the [rewrite] fails (most likely a dependent occurence of [Z.of_nat (S a)]),
+ hide [Z.of_nat (S a)] in this one hypothesis *)
+ change (Z.of_nat (S a)) with (Z_of_nat' (S a)) in H
end
| |- context [ Z.of_nat (S ?a) ] =>
let isnat := isnatcst a in
match isnat with
| true => simpl (Z.of_nat (S a))
| _ => rewrite (Nat2Z.inj_succ a)
+ | _ => (* if the [rewrite] fails (most likely a dependent occurence of [Z.of_nat (S a)]),
+ hide [Z.of_nat (S a)] in the goal *)
+ change (Z.of_nat (S a)) with (Z_of_nat' (S a))
end
(* atoms of type nat : we add a positivity condition (if not already there) *)
@@ -401,4 +407,3 @@ Ltac zify_N := repeat zify_N_rel; repeat zify_N_op; unfold Z_of_N' in *.
(** The complete Z-ification tactic *)
Ltac zify := repeat (zify_nat; zify_positive; zify_N); zify_op.
-