François Thiré
2018-12-04 09:32:21 UTC
Dear mailing list,
I am not really familiar with the Agda system, but I want to use it to make
some experiments.
On the relatively small example below, I have a definition that is
well-typed when everything is instantiated. However, if I replace the
second occurrence of "a" by a hole, Agda refuses to elaborate the term and
gives me an error. I don't understand why Agda is giving me this error
message and is there a way to overcome this problem?
I am using the version 2.6.0 of Agda.
{-# OPTIONS --rewriting #-}
module test where
open import Level
open import Agda.Builtin.Equality
{-# BUILTIN REWRITE _â¡_ #-}
1â : Level
1â = suc zero
postulate
prod : {â ââ² : Level} â (A : Set â) â (B : Set ââ²) â Set (â â ââ²)
p : Set 1â â Set 1â
q : Set 1â â Set 1â
f : â (c : Set 0â) â p (Lift 1â c) â q (Lift 1â c)
g : â (a : Set 1â) â â (b : Set 1â) â p (prod a b)
a : Set 0â
b : Set 0â
canL : {â ââ² ââ³ : Level} â (A : Set â) â (B : Set ââ²) â (prod (Lift ââ³
A) B) â¡ Lift (ââ³ â ââ²) (prod A B)
canR : {â ââ² ââ³ : Level} â (A : Set â) â (B : Set ââ²) â (prod A (Lift ââ³
B)) â¡ Lift (â â ââ³) (prod A B)
canT : {â ââ² ââ³ : Level} â (A : Set â) â Lift ââ³ (Lift ââ² A) â¡ Lift (ââ³ â
ââ²) A
{-# REWRITE canL #-}
{-# REWRITE canR #-}
{-# REWRITE canT #-}
ali : q (Lift 1â (prod a b))
ali = f (prod a b) (g (Lift 1â a) (Lift 1â b))
{- ali = f (prod a b) (g (Lift 1â ?) (Lift 1â b)) FAILS -}
For this last line, the error message is:
Setâ != Set
when checking that the expression g (Lift 1â ?) (Lift 1â b) has
type p (Lift 1â (prod a b))
Best wishes,
François Thiré
I am not really familiar with the Agda system, but I want to use it to make
some experiments.
On the relatively small example below, I have a definition that is
well-typed when everything is instantiated. However, if I replace the
second occurrence of "a" by a hole, Agda refuses to elaborate the term and
gives me an error. I don't understand why Agda is giving me this error
message and is there a way to overcome this problem?
I am using the version 2.6.0 of Agda.
{-# OPTIONS --rewriting #-}
module test where
open import Level
open import Agda.Builtin.Equality
{-# BUILTIN REWRITE _â¡_ #-}
1â : Level
1â = suc zero
postulate
prod : {â ââ² : Level} â (A : Set â) â (B : Set ââ²) â Set (â â ââ²)
p : Set 1â â Set 1â
q : Set 1â â Set 1â
f : â (c : Set 0â) â p (Lift 1â c) â q (Lift 1â c)
g : â (a : Set 1â) â â (b : Set 1â) â p (prod a b)
a : Set 0â
b : Set 0â
canL : {â ââ² ââ³ : Level} â (A : Set â) â (B : Set ââ²) â (prod (Lift ââ³
A) B) â¡ Lift (ââ³ â ââ²) (prod A B)
canR : {â ââ² ââ³ : Level} â (A : Set â) â (B : Set ââ²) â (prod A (Lift ââ³
B)) â¡ Lift (â â ââ³) (prod A B)
canT : {â ââ² ââ³ : Level} â (A : Set â) â Lift ââ³ (Lift ââ² A) â¡ Lift (ââ³ â
ââ²) A
{-# REWRITE canL #-}
{-# REWRITE canR #-}
{-# REWRITE canT #-}
ali : q (Lift 1â (prod a b))
ali = f (prod a b) (g (Lift 1â a) (Lift 1â b))
{- ali = f (prod a b) (g (Lift 1â ?) (Lift 1â b)) FAILS -}
For this last line, the error message is:
Setâ != Set
when checking that the expression g (Lift 1â ?) (Lift 1â b) has
type p (Lift 1â (prod a b))
Best wishes,
François Thiré