aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite
diff options
context:
space:
mode:
authorGravatar Julien Forest <julien.forest@ensiie.fr>2017-03-21 22:53:27 +0100
committerGravatar Julien Forest <forest@ensiie.fr>2017-04-04 17:41:32 +0200
commit59f5391576aca91400f506adfc7f1a1965f79069 (patch)
treee13a1fb852b837c219c5fa51906399e550b6ab4c /test-suite
parent32bf31fda75918bf2910301dffa7b3137c81b236 (diff)
bug file for 4306
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/bugs/opened/4306.v32
1 files changed, 32 insertions, 0 deletions
diff --git a/test-suite/bugs/opened/4306.v b/test-suite/bugs/opened/4306.v
new file mode 100644
index 000000000..4aef5bb95
--- /dev/null
+++ b/test-suite/bugs/opened/4306.v
@@ -0,0 +1,32 @@
+Require Import List.
+Require Import Arith.
+Require Import Recdef.
+Require Import Omega.
+
+Function foo (xys : (list nat * list nat)) {measure (fun xys => length (fst xys) + length (snd xys))} : list nat :=
+ match xys with
+ | (nil, _) => snd xys
+ | (_, nil) => fst xys
+ | (x :: xs', y :: ys') => match Compare_dec.nat_compare x y with
+ | Lt => x :: foo (xs', y :: ys')
+ | Eq => x :: foo (xs', ys')
+ | Gt => y :: foo (x :: xs', ys')
+ end
+ end.
+Proof.
+ intros; simpl; omega.
+ intros; simpl; omega.
+ intros; simpl; omega.
+Qed.
+
+Function bar (xys : (list nat * list nat)) {measure (fun xys => length (fst xys) + length (snd xys))} : list nat :=
+ let (xs, ys) := xys in
+ match (xs, ys) with
+ | (nil, _) => ys
+ | (_, nil) => xs
+ | (x :: xs', y :: ys') => match Compare_dec.nat_compare x y with
+ | Lt => x :: foo (xs', ys)
+ | Eq => x :: foo (xs', ys')
+ | Gt => y :: foo (xs, ys')
+ end
+ end. \ No newline at end of file