Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test-suite/bugs/bug_22093.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
From Stdlib Require Import ZArith Lia.

Section S.
Open Scope Z_scope.
Variable n : Z.
Variable bound_n : 0 <= n < 1.

Goal True.
Proof.
Timeout 1 lia.
(* Used to not terminate, now 3ms *)
Qed.

End S.
7 changes: 6 additions & 1 deletion theories/omega/PreOmega.v
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ Module Z.
Ltac euclidean_division_equations_cleanup :=
repeat
(repeat match goal with
| [ H : 0 <= ?x < _ |- _ ] => destruct H
| [ H : 0 <= ?x < _ |- _ ] =>
destruct H;
try (lazymatch type of H with (* matching on the type of H *after* the destruct, if H still present *)
| 0 <= x < _ => clear H (* H was a section variable, destruct didn't clear it, which would lead to an infinite loop *)
end)
(* tryif is_section_var H then destruct H; clear H else destruct H (* Cleaner version for Rocq >= 9.3 *) *)
end;
repeat match goal with
| [ H : ?x <> ?x -> _ |- _ ] => clear H
Expand Down
Loading