[Agda] strange mismatch
Andrés Sicard-Ramírez
asr at eafit.edu.co
Thu May 25 02:41:43 CEST 2017
On 24 May 2017 at 14:35, Sergei Meshveliani <mechvel at botik.ru> wrote:
> On Wed, 2017-05-24 at 22:13 +0300, Sergei Meshveliani wrote:
>> Please, what is wrong here?
>>
>> test1 is type-checked, and test2 is not
>> (in Agda 2.6.0-207bde6) :
>
>> -----------------------------------------------------------------------
>> open import Relation.Binary.PropositionalEquality as PE using (_≡_)
>>
>> module _ {α} (A : Set α) (zr a : A)
>> where
>> data Expression : Set α where
>> con : A → Expression
>> _:+_ : Expression → Expression → Expression
>>
>> f : Expression → Expression → Expression
>> f (con zr) y = y
>> f x (con zr) = x
>> f x y = x :+ y
>>
>> test1 : f (con zr) (con a) ≡ con a
>> test1 = PE.refl
>>
>> test2 : f (con a) (con zr) ≡ con a
>> test2 = PE.refl
>> ------------------------------------------------------------------------
>>
>> How to fix?
>
>
> May be, listing "zr a" in parameters does not imply that a does not
> match against zr.
> I am not sure.
>
> May be, I have instead to add to Expression the constructors
> zr : Expression
> a : Expression,
>
> and this will imply that a does not match against zr.
Note that the `zr` in equations
f (con zr) y = y
f x (con zr) = x
is *different* from the `zr` in the parameters.
--
Andrés
La información contenida en este correo electrónico está dirigida únicamente a su destinatario y puede contener información confidencial, material privilegiado o información protegida por derecho de autor. Está prohibida cualquier copia, utilización, indebida retención, modificación, difusión, distribución o reproducción total o parcial. Si usted recibe este mensaje por error, por favor contacte al remitente y elimínelo. La información aquí contenida es responsabilidad exclusiva de su remitente por lo tanto la Universidad EAFIT no se hace responsable de lo que el mensaje contenga. The information contained in this email is addressed to its recipient only and may contain confidential information, privileged material or information protected by copyright. Its prohibited any copy, use, improper retention, modification, dissemination, distribution or total or partial reproduction. If you receive this message by error, please contact the sender and delete it. The information contained herein is the sole responsibility of the sender therefore Universidad EAFIT is not responsible for what the message contains.
More information about the Agda
mailing list