Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Why is < for Z in the standard library computational?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Why is < for Z in the standard library computational?


Chronological Thread 
  • From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: [Coq-Club] Why is < for Z in the standard library computational?
  • Date: Mon, 12 Sep 2016 12:17:52 +0000
  • Accept-language: de-DE, en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga03.intel.com
  • Ironport-phdr: 9a23:e0HuZhZDATYSJXA9TJjogK7/LSx+4OfEezUN459isYplN5qZpcy8bnLW6fgltlLVR4KTs6sC0LuP9f6wEjBRqdbZ6TZZL8wKD0dEwewt3CUeQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2a3IyL0LX48JrKJg5MmTCVYLVoLRzwox+b/p0dhpInIaIswDPIpGFJcqJY3zU7C0iUmkO23cC984J59DwU89cg/M5JXKGwN/A9TLdYBTkidXsy6cL3rx7bZQqJ+nYYFG4Rl0wbUED+8BjmU8Kp4WPBve1n1XzCMA==

Dear Coq users,

 

the definition of Z.le in the standard library is:

 

Z.le = fun x y : Z => (x ?= y)%Z <> Gt

     : Z -> Z -> Prop

 

which is a computing definition. For unknown x and y this computes to a rather lengthy term mapping the Z compare to the one for positives. This makes this definition unusable e.g. for dependent types like:

 

Definition t := { x : Z | 0 <= x < mod }.

 

because if one does computation on instances of such a type, the < and <= are expanded (results in roughly 100 lines).

 

Since for most other types (like nat) < is a relation (an inductive prop) rather than a function, I wonder why it was done like this for Z and what advantages this has.

 

My opinion is that there are computing (bool valued) and non-computing (Prop valued) versions of < and that there is a good reason for having both.

 

Best regards,

 

Michael

 

Michael Soegtrop
iCDG (Intel Communications & Devices Group)

PRD PSE SBA SWR (Software Reliability)
Principal Software Reliability

 

Phone: +49 (0)89 99 8853-60431
Mobile: +49 (0)172 81 62 56 2
michael.soegtrop AT intel.com

 

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



  • [Coq-Club] Why is < for Z in the standard library computational?, Soegtrop, Michael, 09/12/2016

Archive powered by MHonArc 2.6.18.

Top of Page