| 1 |
t_rect = |
| 2 |
fun (P : t -> Type) (k : let x := t in forall x0 : x, P x0 -> P (k x0)) => |
| 3 |
fix F (t : t) : P t := |
| 4 |
match t as t0 return P t0 with |
| 5 |
| Cases.k _ x0 => k x0 (F x0) |
| 6 |
end |
| 7 |
: forall P : t -> Type, |
| 8 |
(let x := t in forall x0 : x, P x0 -> P (k x0)) -> forall t : t, P t |
| 9 |
|
| 10 |
Arguments t_rect (P k)%_function_scope t |
| 11 |
= fun d : TT => match d with |
| 12 |
| {| f3 := b |} => b |
| 13 |
end |
| 14 |
: TT -> 0 = 0 |
| 15 |
= fun d : TT => match d with |
| 16 |
| {| f3 := b |} => b |
| 17 |
end |
| 18 |
: TT -> 0 = 0 |
| 19 |
proj = |
| 20 |
fun (x y : nat) (P : nat -> Type) (def : P x) (prf : P y) => |
| 21 |
match eq_nat_dec x y with |
| 22 |
| left eqprf => match eqprf in _ = z return P z with |
| 23 |
| eq_refl => def |
| 24 |
end |
| 25 |
| right _ => prf |
| 26 |
end |
| 27 |
: forall (x y : nat) (P : nat -> Type), P x -> P y -> P y |
| 28 |
|
| 29 |
Arguments proj (x y)%_nat_scope P%_function_scope def prf |
| 30 |
foo = |
| 31 |
fix foo (A : Type) (l : list A) {struct l} : option A := |
| 32 |
match l with |
| 33 |
| nil => None |
| 34 |
| (x0 :: nil)%list => Some x0 |
| 35 |
| (x0 :: (_ :: _) as l0)%list => foo A l0 |
| 36 |
end |
| 37 |
: forall A : Type, list A -> option A |
| 38 |
|
| 39 |
Arguments foo A%_type_scope l%_list_scope |
| 40 |
uncast = |
| 41 |
fun (A : Type) (x : I A) => match x with |
| 42 |
| x0 <: _ => x0 |
| 43 |
end |
| 44 |
: forall A : Type, I A -> A |
| 45 |
|
| 46 |
Arguments uncast A%_type_scope x |
| 47 |
foo' = if A 0 then true else false |
| 48 |
: bool |
| 49 |
f = |
| 50 |
fun H : B => |
| 51 |
match H with |
| 52 |
| AC x => |
| 53 |
(fun x0 : P b => |
| 54 |
let b0 := b in |
| 55 |
(if b0 as b return P b -> True |
| 56 |
then fun _ : P true => Logic.I |
| 57 |
else fun _ : P false => Logic.I) x0) x |
| 58 |
end |
| 59 |
: B -> True |
| 60 |
File "./output/Cases.v", line 91, characters 0-98: |
| 61 |
The command has indeed failed with message: |
| 62 |
Non exhaustive pattern-matching: no clause found for pattern |
| 63 |
gadtTy _ _ |
| 64 |
File "./output/Cases.v", line 108, characters 17-18: |
| 65 |
The command has indeed failed with message: |
| 66 |
In environment |
| 67 |
texpDenote : forall t : type, texp t -> typeDenote t |
| 68 |
t : type |
| 69 |
e : texp t |
| 70 |
n : nat |
| 71 |
The term "n" has type "nat" while it is expected to have type |
| 72 |
"typeDenote ?t@{t1:=Nat}". |
| 73 |
fun '{{n, m, _}} => n + m |
| 74 |
: J -> nat |
| 75 |
fun '{{n, m, p}} => n + m + p |
| 76 |
: J -> nat |
| 77 |
fun '(D n m p q) => n + m + p + q |
| 78 |
: J -> nat |
| 79 |
File "./output/Cases.v", line 126, characters 29-42: |
| 80 |
The command has indeed failed with message: |
| 81 |
Once notations are expanded, the resulting constructor D (in type J) is |
| 82 |
expected to be applied to no arguments while it is actually applied to |
| 83 |
1 argument. |
| 84 |
lem1 = |
| 85 |
fun dd : nat * nat => let (bb, cc) as aa return aa = aa := dd in eq_refl |
| 86 |
: forall k : nat * nat, k = k |
| 87 |
|
| 88 |
Arguments lem1 k |
| 89 |
lem2 = |
| 90 |
fun dd : bool => if dd as aa return aa = aa then eq_refl else eq_refl |
| 91 |
: forall k : bool, k = k |
| 92 |
|
| 93 |
Arguments lem2 k%_bool_scope |
| 94 |
lem3 = |
| 95 |
fun dd : nat * nat => let (bb, cc) as aa return aa = aa := dd in eq_refl |
| 96 |
: forall k : nat * nat, k = k |
| 97 |
|
| 98 |
Arguments lem3 k |
| 99 |
1 goal |
| 100 |
|
| 101 |
x : nat |
| 102 |
n, n0 := match x + 0 with |
| 103 |
| 0 | S _ => 0 |
| 104 |
end : nat |
| 105 |
e, e0 := |
| 106 |
match x + 0 as y return y = y with |
| 107 |
| 0 => eq_refl |
| 108 |
| S n => eq_refl |
| 109 |
end : x + 0 = x + 0 |
| 110 |
n1, n2 := match x with |
| 111 |
| 0 | S _ => 0 |
| 112 |
end : nat |
| 113 |
e1, e2 := match x return x = x with |
| 114 |
| 0 => eq_refl |
| 115 |
| S n => eq_refl |
| 116 |
end |
| 117 |
: x = x |
| 118 |
============================ |
| 119 |
x + 0 = 0 |
| 120 |
1 goal |
| 121 |
|
| 122 |
p : nat |
| 123 |
a, a0 := |
| 124 |
match eq_refl as y in _ = e return y = y /\ e = e with |
| 125 |
| eq_refl => conj eq_refl eq_refl |
| 126 |
end : eq_refl = eq_refl /\ p = p |
| 127 |
a1, a2 := |
| 128 |
match eq_refl in _ = e return p = p /\ e = e with |
| 129 |
| eq_refl => conj eq_refl eq_refl |
| 130 |
end : p = p /\ p = p |
| 131 |
============================ |
| 132 |
eq_refl = eq_refl |
| 133 |
fun x : comparison => match x with |
| 134 |
| Eq => 1 |
| 135 |
| _ => 0 |
| 136 |
end |
| 137 |
: comparison -> nat |
| 138 |
fun x : comparison => match x with |
| 139 |
| Eq => 1 |
| 140 |
| Lt => 0 |
| 141 |
| Gt => 0 |
| 142 |
end |
| 143 |
: comparison -> nat |
| 144 |
fun x : comparison => match x with |
| 145 |
| Eq => 1 |
| 146 |
| Lt | Gt => 0 |
| 147 |
end |
| 148 |
: comparison -> nat |
| 149 |
fun x : comparison => |
| 150 |
match x return nat with |
| 151 |
| Eq => S O |
| 152 |
| Lt => O |
| 153 |
| Gt => O |
| 154 |
end |
| 155 |
: forall _ : comparison, nat |
| 156 |
fun x : K => match x with |
| 157 |
| a3 | a4 => 3 |
| 158 |
| _ => 2 |
| 159 |
end |
| 160 |
: K -> nat |
| 161 |
fun x : K => match x with |
| 162 |
| a1 | a2 => 4 |
| 163 |
| a3 => 3 |
| 164 |
| _ => 2 |
| 165 |
end |
| 166 |
: K -> nat |
| 167 |
fun x : K => match x with |
| 168 |
| a1 | a2 => 4 |
| 169 |
| a4 => 3 |
| 170 |
| _ => 2 |
| 171 |
end |
| 172 |
: K -> nat |
| 173 |
fun x : K => match x with |
| 174 |
| a1 | a3 | a4 => 3 |
| 175 |
| _ => 2 |
| 176 |
end |
| 177 |
: K -> nat |
| 178 |
File "./output/Cases.v", line 224, characters 38-86: |
| 179 |
The command has indeed failed with message: |
| 180 |
Pattern "S _, _" is redundant in this clause. |
| 181 |
stray = |
| 182 |
fun N : Tree => |
| 183 |
match N with |
| 184 |
| App (App Node (Node as strayvariable)) _ | |
| 185 |
App (App Node (App Node _ as strayvariable)) _ | |
| 186 |
App (App Node (App (App Node Node) (App _ _) as strayvariable)) _ | |
| 187 |
App (App Node (App (App Node (App _ _)) _ as strayvariable)) _ | |
| 188 |
App (App Node (App (App (App _ _) _) _ as strayvariable)) _ => |
| 189 |
strayvariable |
| 190 |
| _ => Node |
| 191 |
end |
| 192 |
: Tree -> Tree |
| 193 |
|
| 194 |
Arguments stray N |
| 195 |
File "./output/Cases.v", line 253, characters 4-5: |
| 196 |
Warning: Unused variable B might be a misspelled constructor. Use _ or _B to |
| 197 |
silence this warning. [unused-pattern-matching-variable,default] |
| 198 |
File "./output/Cases.v", line 266, characters 33-40: |
| 199 |
The command has indeed failed with message: |
| 200 |
Application of arguments to a recursive notation not supported in patterns. |
| 201 |
File "./output/Cases.v", line 267, characters 33-43: |
| 202 |
The command has indeed failed with message: |
| 203 |
The constructor cons (in type list) is expected to be applied to 2 arguments |
| 204 |
while it is actually applied to 3 arguments. |
| 205 |
File "./output/Cases.v", line 268, characters 33-39: |
| 206 |
The command has indeed failed with message: |
| 207 |
The constructor cons (in type list) is expected to be applied to 2 arguments |
| 208 |
while it is actually applied to 1 argument. |
| 209 |
File "./output/Cases.v", line 271, characters 33-45: |
| 210 |
The command has indeed failed with message: |
| 211 |
The constructor D' (in type J') is expected to be applied to 4 arguments (or |
| 212 |
6 arguments when including variables for local definitions) while it is |
| 213 |
actually applied to 5 arguments. |
| 214 |
fun x : J' bool (true, true) => |
| 215 |
match x with |
| 216 |
| @D' _ _ _ _ _ m _ e => existT (fun x0 : nat => x0 = x0) m e |
| 217 |
end |
| 218 |
: J' bool (true, true) -> {x : nat & x = x} |
| 219 |
fun x : J' bool (true, true) => match x with |
| 220 |
| D' _ _ _ n p _ => n + p |
| 221 |
end |
| 222 |
: J' bool (true, true) -> nat |
| 223 |
File "./output/Cases.v", line 277, characters 33-40: |
| 224 |
The command has indeed failed with message: |
| 225 |
Application of arguments to a recursive notation not supported in patterns. |
| 226 |
File "./output/Cases.v", line 278, characters 33-43: |
| 227 |
The command has indeed failed with message: |
| 228 |
The constructor cons (in type list) is expected to be applied to 2 arguments |
| 229 |
while it is actually applied to 3 arguments. |
| 230 |
File "./output/Cases.v", line 279, characters 33-39: |
| 231 |
The command has indeed failed with message: |
| 232 |
The constructor cons (in type list) is expected to be applied to 2 arguments |
| 233 |
while it is actually applied to 1 argument. |
| 234 |
File "./output/Cases.v", line 281, characters 33-39: |
| 235 |
The command has indeed failed with message: |
| 236 |
The constructor D' (in type J') is expected to be applied to 3 arguments (or |
| 237 |
4 arguments when including variables for local definitions) while it is |
| 238 |
actually applied to 2 arguments. |
| 239 |
File "./output/Cases.v", line 282, characters 33-45: |
| 240 |
The command has indeed failed with message: |
| 241 |
The constructor D' (in type J') is expected to be applied to 3 arguments (or |
| 242 |
4 arguments when including variables for local definitions) while it is |
| 243 |
actually applied to 5 arguments. |
| 244 |
fun x : J' bool (true, true) => |
| 245 |
match x with |
| 246 |
| @D' _ _ _ _ _ m _ e => existT (fun x0 : nat => x0 = x0) m e |
| 247 |
end |
| 248 |
: J' bool (true, true) -> {x : nat & x = x} |
| 249 |
fun x : J' bool (true, true) => |
| 250 |
match x with |
| 251 |
| @D' _ _ _ _ n _ p _ => (n, p) |
| 252 |
end |
| 253 |
: J' bool (true, true) -> nat * nat |
| 254 |
File "./output/Cases.v", line 313, characters 3-4: |
| 255 |
Warning: Unused variable x might be a misspelled constructor. Use _ or _x to |
| 256 |
silence this warning. [unused-pattern-matching-variable,default] |
| 257 |
File "./output/Cases.v", line 314, characters 6-7: |
| 258 |
Warning: Unused variable y might be a misspelled constructor. Use _ or _y to |
| 259 |
silence this warning. [unused-pattern-matching-variable,default] |
| 260 |
File "./output/Cases.v", line 314, characters 3-4: |
| 261 |
Warning: Unused variable x might be a misspelled constructor. Use _ or _x to |
| 262 |
silence this warning. [unused-pattern-matching-variable,default] |
| 263 |
File "./output/Cases.v", line 325, characters 4-12: |
| 264 |
The command has indeed failed with message: |
| 265 |
Once notations are expanded, the resulting constructor true (in type bool) is |
| 266 |
expected to be applied to no arguments while it is actually applied to |
| 267 |
2 arguments. |