coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Terrell, Jeffrey" <jeffrey.terrell AT kcl.ac.uk>
- To: Coq Club <coq-club AT inria.fr>
- Subject: [Coq-Club] Problem with dependent match statement
- Date: Fri, 15 Sep 2017 06:49:53 +0000
- Accept-language: en-GB, en-US
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jeffrey.terrell AT kcl.ac.uk; spf=Pass smtp.mailfrom=jeffrey.terrell AT kcl.ac.uk; spf=Pass smtp.helo=postmaster AT EUR01-VE1-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:QRcpShX6n2ue4pH0+1jiyUe6ekXV8LGtZVwlr6E/grcLSJyIuqrYZhSHt8tkgFKBZ4jH8fUM07OQ6P+wHzFYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aMlzFOAF0PuX4HJLJx4Tyjrjqus6bXwIdrz2kKZh2MR/++Q7Wr4wdhZZoAqc30BrA5HVSLbd432RtcBivkgzm68O0uNZB/ipeof8wvYYUU6j0cb41XPpEAS48PmQxzM7gsV/KRk2S5S1PAS0tjhNUDl2dv1nBVZDrv36/77Il1Q==
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
In the second branch of the match statement below, I expected f to be of type
Fin (S m) -> A. However, it’s reported to be of type Fin n -> A.
Inductive Fin : nat -> Set :=
fzero : forall n : nat, Fin (S n) |
fsuc : forall n : nat, Fin n -> Fin (S n).
Inductive Vec (A : Set) : nat -> Set :=
vzero : Vec A 0 |
vcons : forall n : nat, A -> Vec A n -> Vec A (S n).
Fixpoint tabulate (n : nat) (A : Set) (f : Fin n -> A) : Vec A n :=
match n as n0 return (Vec A n0) with |
0 => vzero A |
S m => vcons A m (f (fzero m)) ...
end.
From a purely syntactic point of view, I can see why this is the case.
However, I’m not sure how to obtain a function of the required type to apply
to (fzero m).
Regards,
Jeff.
- [Coq-Club] Problem with dependent match statement, Terrell, Jeffrey, 09/15/2017
- RE: [Coq-Club] Problem with dependent match statement, Soegtrop, Michael, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Jan-Oliver Kaiser, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Dominique Larchey-Wendling, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Terrell, Jeffrey, 09/15/2017
- RE: [Coq-Club] Problem with dependent match statement, Soegtrop, Michael, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Dominique Larchey-Wendling, 09/15/2017
- RE: [Coq-Club] Problem with dependent match statement, Soegtrop, Michael, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Terrell, Jeffrey, 09/16/2017
- RE: [Coq-Club] Problem with dependent match statement, Soegtrop, Michael, 09/18/2017
- Re: [Coq-Club] Problem with dependent match statement, Terrell, Jeffrey, 09/21/2017
- Re: [Coq-Club] Problem with dependent match statement, Terrell, Jeffrey, 09/16/2017
- RE: [Coq-Club] Problem with dependent match statement, Soegtrop, Michael, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Dominique Larchey-Wendling, 09/15/2017
- Re: [Coq-Club] Problem with dependent match statement, Dominique Larchey-Wendling, 09/15/2017
Archive powered by MHonArc 2.6.18.