Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] [Coq] [Using Coq] avoiding type error

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] [Coq] [Using Coq] avoiding type error


Chronological Thread 
  • From: Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>
  • To: Jim Fehrle <jim.fehrle AT gmail.com>, "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] [Coq] [Using Coq] avoiding type error
  • Date: Tue, 5 Jan 2021 10:33:35 +1100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=anu.edu.au; dmarc=pass action=none header.from=anu.edu.au; dkim=pass header.d=anu.edu.au; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MkMBWvoYiyLxXyx7zFl5FI0vvS/SN6p/n/2DhXibvGM=; b=VJVTG80Oaeyty6B/kJ2Dn+mWLruNj9YYm4BjJKwJM6bNr/8OELXWHo8V9ev9njaGBZrgSOag5y74oo6fnczSVkS5EMchfWxy1UdxHQ9isqTBxORW3HIxztp6de3jiXWRrTPxb4/OIV4zHZg8GJ+wfMo14/tUCYwA8oz+OcokSAkhjPPuVe2dMoK6oG/SON8veW1J2cciYayYR/roB4DnrPqG9Gw8aeHE8EHAJc3v0NmjtRwsZXFH+arKB0Z9MnuxA8sNBXv5hNQKw0+JW1AiTk2JiI9YyNFSdS+V8YPGT1rwkMHnT4pZFCDOEORLZqWsiFM7NgXelFa6fEcH8S6jBA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VNVbDno2HZCRX48Ct6yfcAaoKjb793rRqIAbdzesk9BdP05SRHWF4FQxrTAv4JtP0fO9mOyf2d56aWvuxUsWS8jYs+sytw4kJ0aw96u8vODRFUsVf499Y6uiK0mw1qdCzB3ltPIBbBWdfHIRwO2La753o8C22IbXCKXxb03XaiX6r2VuTqXicmNIS/Dn/kMRrzPIELwG0z+SLAATxw4Bg6wugNh90HqKGW763GoTLd8RmXC0ZlQv+ULRCOSyKVNBdavyqvLY49o0G38C3xoerBEz8Xo9h//4EIGig29Zv9xtERvm1Jdm1GHi9nuZduI1s1WY3eTk7ocmZXjVi9MU6w==
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.mailfrom=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.helo=postmaster AT AUS01-ME3-obe.outbound.protection.outlook.com
  • Ironport-phdr: 9a23:WxCRKRUm2YzWmmKag1MOguVJ49rV8LGtZVwlr6E/grcLSJyIuqrYZRaAtadThVPEFb/W9+hDw7KP9fy5BipausrK6ShKWacPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3wOgVvO+v6BJPZgdip2OCu4Z3TZBhDiCagbb9oIxi6sAfcutMIjYZsJas9xQbFrmdVcOlK2G1kIk6ekQzh7cmq5p5j9CpQu/Ml98FeVKjxYro1Q79FAjk4Km45/MLkuwXNQguJ/XscT34ZkgFUDAjf7RH1RYn+vy3nvedgwiaaPMn2TbcpWTS+6qpgVRHlhDsbOzM/7WrakdJ7gr5Frx29phx/24/Ub5+TNPpiZaPWYNcWSXNcUspNSyBNB4WxZJYNAeUcJ+ZVt5TzqUUArRW+BgeiCu3gxT1UiXH53K013P8sER3F0QE6A94CrHrZodfzOawPUe611q7IzTDbYv1Sxzj98pbHchUhoPqRU7x/a8TQyVIoFwPDk16drojrMC2P1usTtmia7/BsW+y1hG8psAFxpT6vy9w2hYnPm4IZ0E7L+jhkwIovP9K4VVd2bNi5G5Rfqy+ULZF5Qt8+Q252oiY6zKULt5ClcCQUy5kpxxrSZvybfoSW/x/uSficLDl4inxqZL+ymhe//0igxOP8S8S51EpHoypYntXRuX0Byxzd58uHR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2MQ0lBO+pfsqkpI8mhav2KnraxO/ptly6nimIB551h1kWL9Gx3Teuahs9ZkcHd5ROOUnLHtHnkqtr+wNoWbDcPWGez1G7tGdwJP/wgTcMwEW6rZvaP6JB7jp/pVWRf8Qf5VVoAxYmkdQfUZkGvhAA=

Thanks Jim, I don't know enough about using this discourse system to troubleshoot, here it is, also to the coq-club mailing list

Cheers, Jeremy

Hi,

I have a situation as follows:

H : [(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [Imp (Var p0) B0], Var p0);
(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [B0], Var p)] = lpst
ind2 : in_dersrec d2 d1
============================
in_dersrec d2 d1

However
exact ind2.
fails with the message
The term "ind2" has type
"@in_dersrec (srseq (PropF V)) (@LJArules V) (@emptyT (srseq (PropF V))) c1
d2
[(@fmlsext (PropF V) (Γ1 ++ @Imp V (@Var V p) B :: H2) Γ3
[@Imp V (@Var V p0) B0], @Var V p0);
(@fmlsext (PropF V) (Γ1 ++ @Imp V (@Var V p) B :: H2) Γ3 [B0], @Var V p)]
d1" while it is expected to have type
"@in_dersrec (srseq (PropF V)) (@LJArules V) (@emptyT (srseq (PropF V))) c1
d2 lpst d1".

That is, the two types are equal (hypothesis H) but expressed differently

Question : where types T and T' are equal, is (for example)
(x : T) = (x' : T') well-typed or not?

In this case, since type type of in_dersrec and d1 are as follows

in_dersrec
: forall (X : Type) (rules : rlsT X) (prems : X -> Type) (concl : X),
derrec rules prems concl ->
forall concls : list X, dersrec rules prems concls -> Type

d1 : dersrec LJArules emptyT lpst

Now if types need to be identical rather than equal, then ind2 is
ill-typed, so should Coq allow this? If types don't need to be identical
but somehow you have to remind Coq that they are equal, then how do you do
this?

I've tried
subst lpst.
rewrite H in ind2.
but both produce an error

Error: Illegal application:
The term "in_dersrec" of type ...
cannot be applied to the terms
...
"d1" : "dersrec LJArules emptyT lpst"
The 7th term has type "dersrec LJArules emptyT lpst"
which should be coercible to
"dersrec LJArules emptyT
[(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [Imp (Var p0) B0], Var p0);
(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [B0], Var p)]".

Trying
destruct ind2.
inversion ind2.
elim ind2.
all produce similar errors, eg
Unable to unify "dersrec LJArules emptyT lpst" with
"dersrec LJArules emptyT
[(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [Imp (Var p0) B0], Var p0);
(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [B0], Var p)]".

Any help would be very much appreciated.

Thanks

Jeremy Dawson

On 5/1/21 10:05 am, Jim Fehrle wrote:
Ah, no.  It's still truncated.

On Mon, Jan 4, 2021 at 3:03 PM Jeremy Dawson via Coq <coq AT discoursemail.com <mailto:coq AT discoursemail.com>> wrote:

__
[jeremydaw] jeremydaw <https://coq.discourse.group/u/jeremydaw>
January 4

Hi Jim,

Yes, obviously, see if this works better

I have a situation as follows:

H : [(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [Imp (Var p0) B0], Var p0);
(fmlsext (Γ1 ++ Imp (Var p) B :: H2) Γ3 [B0], Var p)] = lpst
ind2 : in_dersrec d2 d1

------------------------------------------------------------------------

Visit Topic
<https://coq.discourse.group/t/avoiding-type-error/1177/3> or reply
to this email to respond.

------------------------------------------------------------------------


In Reply To

[jfehrle] jfehrle <https://coq.discourse.group/u/jfehrle>
January 4

Did your posting get truncated?
------------------------------------------------------------------------

Visit Topic
<https://coq.discourse.group/t/avoiding-type-error/1177/3> or reply
to this email to respond.

To unsubscribe from these emails, click here

<https://coq.discourse.group/email/unsubscribe/7fd52dd2c0f88303f5b787f3d388533936dca1aba6b160099e87a654b83ad616>.



  • Re: [Coq-Club] [Coq] [Using Coq] avoiding type error, Jeremy Dawson, 01/05/2021

Archive powered by MHonArc 2.6.19+.

Top of Page