Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Problems with ignored notations

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Problems with ignored notations


Chronological Thread 
  • From: Gaetan Gilbert <gaetan.gilbert AT ens-lyon.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Problems with ignored notations
  • Date: Thu, 9 Feb 2017 15:09:03 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT ens-lyon.fr; spf=Pass smtp.mailfrom=gaetan.gilbert AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Ironport-phdr: 9a23:eMmALhfal8hx+vDRiwk3eyIVlGMj4u6mDksu8pMizoh2WeGdxcu8Zh7h7PlgxGXEQZ/co6odzbGH7+awBCdbut6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCzbL52Ixi6twbcu8kZjYZsJKs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9ZwgbpGrhy/qRxxw43abo+bO/VxfKzSYdwUSHFdXstSTSFNHp+wYoUNAucHIO1Wr5P9p1wLrRamBAejHv3gyiNSiX/wwKY00uUhEQXd0wM+BdIOrGnfodL6NKgIT++10LPHzTPZY/NZ2Df97JPHfQ47ofGQRr9/b8zRyVI2GwPBjlSQrorlMymb1uQXqmWW6fdrW+G3i2M/tg18rSSjyt0uh4TLnI4Z11HJ+CdjzIorO9G0VlZ3bcOgHZZerS2XN4R7TtkgTmxpoio217wLtYC9cSMX0poo3QTfZOaCc4WQ4hLsSuKRITBgiXJhYr2wnA29/la6xuLiUMm0y09Gri5Fk9nLsHABzRLT6tKfRvt8+EeuxyqP2hjO5uxLPUw4j6jWJpw7zrItl5ces17PEjHolEnolKOWc18r+ums6+TpeLXmoZqcOpd7ig7kLKsuhtawAeIiPggBXmib/f+z26P5/U3lW7hFkPs2krLAvJDeJcUboai5DxVb0oY58xq/FSup0MwEnXkbK1JIYA6Ij4/wO13XPP/4Ceq/jE+3nTdwx/HGO6XhDY/XInjClrfhZ7d95FRGxAo919AMr65TX7oGObf4XlL7nN3eFB4wdQKukMj9D9Ao+YoTRWuJSoCYNKnfq0PAsu0mLvWFYskauTL3JuI5z/Poljo9iFgbO6ezi8hEIEukF+hrdh3KKUHnhc0MRD8H

The reason this happens is that Coq keeps track of casts internally, ie "a : b" and just "a" are not the same terms internally.

So when you write "〈ℕ0, ℕ0〉" it doesn't match ℤ0's definition of "〈ℕ0, ℕ0〉 : ℤ", and when you simpl the casts go away.

Beyond that I don't know much about notations so I don't know if notations could ignore casts.

Gaëtan Gilbert

On 09/02/2017 14:57, Sebastian Böhne wrote:
Dear Coq-community!

We, Tim Richter and Sebastian Böhne, have problems with some notations we introduced for numbers in Coq. Sometimes an already introduced notation is ignored by Coq and -- even worse -- when processing in a proof our notations are replaced by their original versions. This is a big problem, since even simple contents become very confusing.

You find a minimal example below and attached.

Thank you very much for your help!

Best regards

Tim Richter and Sebastian Böhne

PS: We use CoqIde 8.4pl3.

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

Require Import Utf8_core.

Notation "〈 a , b 〉" := (pair a b)
(no associativity).

Inductive ℕ := Zero : ℕ | Suc : ℕ → ℕ.

Notation ℕ0 := (Zero).
Notation ℕ1 := (Suc ℕ0).

Check ℕ0.
Check Zero.
Check Suc Zero.
(* Here Coq sticks correctly to notations and
furthermore retranslates objects, which can be
displayed as Notations *)

Notation ℤ := (ℕ * ℕ)%type.

Check (〈ℕ0,ℕ1〉).
Check (〈Zero, Suc Zero〉).
(* So Coq does not seem to have problems with
the pair notation *)

Notation ℤ0 := (〈ℕ0, ℕ0〉 : ℤ).
Notation ℤ1 := (〈ℕ1, ℕ0〉 : ℤ).
Notation "ℤ-1" := (〈ℕ0, ℕ1〉 : ℤ).

Check ℤ1.
(* Still like expected *)

Check (〈ℕ1, ℕ0〉).
(* Here Coq does not retranslate anymore *)

Check (〈ℕ1, ℕ0〉 : ℤ).
(* However, with some little help it still
works *)

Lemma example : ℤ-1 = ℤ-1 ∧ ℤ0 = ℤ0 ∧ ℤ1 = ℤ1.
Proof.
simpl.
(* We did not even do anything but Coq
replaces our abbreviations with the longer
original versions. Why? *)
admit.
Admitted.

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






Archive powered by MHonArc 2.6.18.

Top of Page