Debian Codegraph @

test-suite/bugs/bug_10175.v

raw
1 From Corelib Require Import ssreflect ssrbool ssrfun.
2 From Corelib Require Import ListDef.
3
4 Import Nat.
5
6 Fixpoint filter A (f : A -> bool) (l:list A) : list A :=
7 match l with
8 | nil => nil
9 | x :: l => if f x then x::(filter A f l) else filter A f l
10 end.
11 Arguments filter {_}.
12
13 Definition partition {X : Type}
14 (test : X -> bool)
15 (l : list X)
16 : list X * list X
17 := (filter test l, filter (fun x => negb (test x)) l).
18
19 Section Fold_Right_Recursor.
20 Variables (A : Type) (B : Type).
21 Variable f : B -> A -> A.
22 Variable a0 : A.
23
24 Fixpoint fold_right (l:list B) : A :=
25 match l with
26 | nil => a0
27 | cons b t => f b (fold_right t)
28 end.
29 End Fold_Right_Recursor.
30 Arguments fold_right {_ _}.
31
32 Definition fold (A B: Type) f l b:= @fold_right B A f b l.
33
34 Theorem partition_fst: forall (X : Type) (test : X -> bool) (l : list X),
35 fold_right andb true (map test (fst (partition test l))) = true.
36 Proof.
37 move => ? test.
38 elim => [|x xs IHxs] //.
39 case H: eqb (test x) true. (* <-- anomaly here! *)
40 Abort.