Skip to Content.
Sympa Menu

ssreflect - RE: [ssreflect] Universe inconsistency with coq 8.5

Subject: Ssreflect Users Discussion List

List archive

RE: [ssreflect] Universe inconsistency with coq 8.5


Chronological Thread 
  • From: Georges Gonthier <>
  • To: Florent Hivert <>, "" <>
  • Subject: RE: [ssreflect] Universe inconsistency with coq 8.5
  • Date: Mon, 14 Mar 2016 18:06:51 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=Pass
  • Ironport-phdr: 9a23:cgSjuhwbmKeaJ3fXCy+O+j09IxM/srCxBDY+r6Qd0O4eIJqq85mqBkHD//Il1AaPBtWEraMawLuG+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStGU3pr8hrD60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jFsR7ZQA2TrlsdTGgMjlIcLQzC9hz8QtHRszX3rPZV3DObe8PsG/R8Ey+59aplTBLjlA8CLCR88WfNi8U2jaRBoRvnqQY1i9rPe5uYOv5zdb/1eMgAAGtHRMdYES1HGIK1KYUVWbkvJ+Fd+qbwoEEBoAD2Kg6qGOPuxyUA0nDx27E60uk7OQTH1xYnBNUArDLfq9CjZ/Raavy80KSdlWaLVPhRwzqordGQKh0=
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:23

While the code was accepted in 8.4, I suspect it did not have the intended
semantics, and that Coq simply ignored the predArgType annotation in the
Structure declaration, as this was the case in earlier versions, and that
this was "fixed" in 8.5 by trying to equate the sort imposed by the
Record/structure code with the declared one - whence your error.
Possible workarounds:
- Use Inductive to declare your type, and define the coercion to nat * nat
explicitly. You will not be able to infer canonical box_ins if you do this,
though. This is what the mathcomp library does for ordinal.
- Replace the predArgType annotation with Type. You will need to use the {:
box_in sh} notation when you want to use box_in as a collection (e.g., in
#|{: box_in sh}| = sumn sh).
- Define box_in : predArgType := box_in_struct, where box_in_struct is your
declared Structure. Note that the "internal" box_in_struct type will then
appear in the type of coord and BoxIn.

Thus, there are no perfect solutions; you should also probably report a
Coq bug.

Cheers,
Georges

-----Original Message-----
From:


[mailto:]
On Behalf Of Florent Hivert
Sent: 14 March 2016 17:14
To:

Subject: [ssreflect] Universe inconsistency with coq 8.5

Dear MathComp fans,

The following code which was perfectly working with Coq-8.4pl6 and
MathComp-1.6 is refused by switching to Coq-8.5 with a

Toplevel input, characters 15-105:
Error: Universe inconsistency. Cannot enforce Set =
mathcomp.ssreflect.ssrbool.517.

I've no idea what changed. Any suggestion or fix ?

Best,

Florent


Set Printing Universes.

Require Import mathcomp.ssreflect.ssreflect.
From mathcomp Require Import ssrbool ssrfun ssrnat eqtype fintype choice seq.

Set Implicit Arguments.
Unset Strict Implicit.


(** * Shapes *)
Definition is_in_shape sh r c := c < nth 0 sh r.

(** ** A finite type [finType] for coordinate of boxes inside a shape *)
Section BoxIn.

Variable sh : seq nat.

Definition is_box_in_shape b := is_in_shape sh b.1 b.2.

Structure box_in : predArgType :=
BoxIn {coord :> nat * nat; _ : is_box_in_shape coord}.




Archive powered by MHonArc 2.6.18.

Top of Page