Skip to content

Conversation

@basetunnel
Copy link
Collaborator

This changes the representation of variables in Untyped syntax to Fin n (see Untyped.lagda.md). The current AST type is parametrised by X : Set for variables, meant to be instantiated to Maybe (Maybe (... ⊥)), i.e. something isomorphic to Fin n. This underconstrained definition led to several work-arounds when @ramsay-t was working on the certifier.

The original motivation for using Maybe was to accomodate for an early version of agda2hs, but the metatheory is actually compiled using the MAlonzo backend nowadays.

Resulting simplifications:

  • No more need to parametrise definitions by DecEq instances to compare variables in decision procedures (see e.g. UntypedTranslation.lagda.md)
  • Many uses of Set₁ can now simply be Set
  • Terms are now indexed by a natural number to represent the amount of variables that are in scope, e.g. 2 ⊢ instead of (Maybe (Maybe ⊥)) ⊢
  • {-# OPTIONS --injective-type-constructors #-} is not needed anymore

Copy link
Contributor

@ana-pantilie ana-pantilie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think you need to somehow restart CI since it timed-out. If CI is green, I think we can merge it.

@basetunnel basetunnel added the No Changelog Required Add this to skip the Changelog Check label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants