Debian Codegraph @

test-suite/bugs/bug_4644.v

raw
1 (* Testing a regression of unification in 8.5 in problems of the form
2 "match ?y with ... end = ?x args" *)
3
4 Lemma foo : exists b, forall a, match a with tt => tt end = b a.
5 Proof.
6 eexists. intro.
7 refine (_ : _ = match _ with tt => _ end).
8 refine eq_refl.
9 Qed.
10
11 (**********************************************************************)
12
13 Axiom proof_admitted : False.
14 Tactic Notation "admit" := case proof_admitted.
15 Require Export Corelib.Classes.Morphisms.
16 Require Import Corelib.Lists.ListDef.
17
18 Global Set Implicit Arguments.
19
20 Definition list_caset A (P : list A -> Type) (N : P nil) (C : forall x xs, P (x::xs))
21 ls
22 : P ls
23 := match ls with
24 | nil => N
25 | x::xs => C x xs
26 end.
27
28 Axiom list_caset_Proper'
29 : forall {A P},
30 Proper (eq
31 ==> pointwise_relation _ (pointwise_relation _ eq)
32 ==> eq
33 ==> eq)
34 (@list_caset A (fun _ => P)).
35 Goal forall (T T' : Set) (a3 : list T), exists y2, forall (a4 : T' -> bool),
36 match a3 with
37 | nil => 0
38 | (_ :: _)%list => 1
39 end = y2 a4.
40 clear; eexists; intros.
41 reflexivity. Undo.
42 Local Ltac t :=
43 lazymatch goal with
44 | [ |- match ?v with nil => ?N | cons x xs => @?C x xs end = _ :> ?P ]
45 => let T := type of v in
46 let A := match (eval hnf in T) with list ?A => A end in
47 refine (@list_caset_Proper' A P _ _ _ _ _ _ _ _ _
48 : @list_caset A (fun _ => P) N C v = match _ with nil => _ | cons x xs => _ end)
49 end.
50 (etransitivity; [ t | reflexivity ]) || fail 0 "too early".
51 Undo.
52 t.
53 Abort.