[Agda] separate definition of constructors?

Thorsten Altenkirch Thorsten.Altenkirch at nottingham.ac.uk
Fri May 24 16:06:45 CEST 2019


Hi,

I am trying to port the definition of Type Theory in Type Theory form our paper
Type theory in type theory using quotient inductive types. POPL 2016<https://dblp.uni-trier.de/db/conf/popl/popl2016.html#AltenkirchK16>
to cubical agda (yes I know inductive families don’t yet work but Andrea is working on it).

However, when we faked this we were able to first introduce the point constructors and then the equality constructors but when doing this in cubical agda all the constructors have to appear together. This leads to the old problem that you have to create forward references for contructors which is a bit ugly. E.g.

data Con : Set
data Ty : (Γ : Con) → Set
data Tm : (Γ : Con)(A : Ty Γ) → Set
data Tms : (Γ Δ : Con) → Set

data Ty where
    _[_] : Ty Δ → Tms Γ Δ → Ty Γ

data Tms where
      id    : Tms Γ Γ
      _,_  : (σ : Tms Γ Δ) → Tm Γ (A [ σ ]) → Tms Γ (Δ , A)

data Ty where
    [id]T : ∀{Γ}{A : Ty Γ} → A [ id ] ≡ A

The problem is that Tms uses  _[_] hence I have to declare the point constructors for Ty first, but then the equality for Ty refers to id!

This is an old issue (already with inductive-inductive definitions) but it gets worse once we have QIITs. There is a workaround to define a forward definition

id'    : Tms Γ Γ

and then use id’ in the equation for Ty and define later

id' = id

but this is a bit ugly. Would it be possible to allow separate definitions of constructors?

Thorsten



This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment. 

Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored 
where permitted by law.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chalmers.se/pipermail/agda/attachments/20190524/2a0c4030/attachment.html>


More information about the Agda mailing list