1lab/mikan
13
52
Fork
You've already forked mikan
9

Post-fork language consolidation #1

Open
opened 2026年04月20日 14:19:10 +02:00 by amyliao · 1 comment

We've inherited almost half a million type theories, controlled by something like 30 different command-line flags, along with almost 20 years of miscellaneous accumulated cruft. I don't think this is maintainable. I think the following features should be removed:

  • Every language mode except for full cubical (so: --with-K, --without-K, --cubical-compatible, --cubical=erased, and --cubical=no-glue). This includes some features that do not make sense for full cubical mode:
    • --injective-type-constructors
    • --large-indices
    • compilation (in general).
  • Sized types, which are known to be inconsistent, hence also:
    • src/size-solver
    • --no-guardedness
  • Musical coinduction
  • Every modal system:
    • --erasure, --erased-matches
    • --experimental-irrelevance, --irrelevant-projections
    • --cohesion, --flat-split
    • --polarity
    • --guarded
  • Variants on the sort system:
    • --level-universe
    • --no-two-level
    • --no-prop
    • --cumulativity
    • --no-universe-polymorphism
    • --type-in-type, --omega-in-omega
  • Rewrite rules
  • The unused MEASURE pragma, which was kept for backwards compatibility
  • The STATIC pragma, used for compilation

The result should be an implementation of a two-level type theory whose fibrant fragment is De Morgan cubical type theory with a universe of strict propositions. The two "teaching" options --no-pattern-matching and --no-copatterns seem like they affect the type theory, but they only do so locally to a module, and their implementation is very contained (unlike e.g. --no-universe-polymorphism), so they can be kept without great burden.

Note: a previous version of the proposed downsizing recovered limited definitional proof-irrelevance by keeping the irrelevance modality, but, given that irrelevant record fields are a very dodgy feature, I think it makes more sense to keep Prop, which is better understood.

We've inherited almost half a million type theories, controlled by something like 30 different command-line flags, along with almost 20 years of miscellaneous accumulated cruft. I don't think this is maintainable. I think the following features should be **removed**: - [x] Every language mode except for *full cubical* (so: `--with-K`, `--without-K`, `--cubical-compatible`, `--cubical=erased`, and `--cubical=no-glue`). This includes some features that do not make sense for full cubical mode: - [x] `--injective-type-constructors` - [x] `--large-indices` - [x] **compilation** (in general). - [x] Sized types, which are known to be inconsistent, hence also: - [x] `src/size-solver` - [x] `--no-guardedness` - [x] Musical coinduction - [x] _Every_ modal system: - [x] `--erasure`, `--erased-matches` - [x] `--experimental-irrelevance`, `--irrelevant-projections` - [x] `--cohesion`, `--flat-split` - [x] `--polarity` - [x] `--guarded` - [ ] Variants on the sort system: - [ ] `--level-universe` - [x] `--no-two-level` - [ ] `--no-prop` - [x] `--cumulativity` - [x] `--no-universe-polymorphism` - [x] `--type-in-type`, `--omega-in-omega` - [x] Rewrite rules - [x] The unused `MEASURE` pragma, which was kept for backwards compatibility - [x] The `STATIC` pragma, used for compilation The result should be an implementation of a two-level type theory whose fibrant fragment is De Morgan cubical type theory with a universe of strict propositions. The two "teaching" options `--no-pattern-matching` and `--no-copatterns` _seem_ like they affect the type theory, but they only do so locally to a module, and their implementation is very contained (unlike e.g. `--no-universe-polymorphism`), so they can be kept without great burden. **Note:** a previous version of the proposed downsizing recovered limited definitional proof-irrelevance by keeping the irrelevance modality, but, given that irrelevant record fields are a very dodgy feature, I think it makes more sense to keep `Prop`, which is better understood.
Author
Owner
Copy link

Even though irrelevant record fields are harder to come by now, you can still write "boxed unboxings" using copattern matching. These combine with the map ∥ A ∥ → Squash A to give .

recordSquash{l}(A:Typel):Typelwhereconstructorliftfield.lower:Ano-squash-⊥:Squash⊥⊥no-squash-⊥()squash-global-choice:Squash({A:Type}SquashAA)squash-global-choice.lower(liftx)=x
Even though irrelevant record fields are harder to come by now, you can still write "boxed unboxings" using copattern matching. These combine with the map `∥ A ∥ → Squash A` to give `⊥`. ```agda record Squash {l} (A : Type l) : Type l where constructor lift field .lower : A no-squash-⊥ : Squash ⊥ → ⊥ no-squash-⊥ () squash-global-choice : Squash (∀ {A : Type} → Squash A → A) squash-global-choice .lower (lift x) = x ```
Sign in to join this conversation.
No Branch/Tag specified
main
aliao/occurs-opt
aliao/rec-con
fix-license
aliao/oopsie
aliao/strengthen-iapply
No results found.
Labels
Clear labels
1 - scope
language
Backwards-compatible changes to the surface language, such as adding new features.
1 - scope
language change
Breaking changes to a documented part of the surface language. These should be documented and specifically called out in the changelog.
1 - scope
performance
Semantics-preserving performance work.
1 - scope
task
Changes that are not apparent to the user, e.g. developer documentation and refactors, which do not need to be documented.
A: dead-code
Dead code elimination and --save-metas.
A: errors
Reporting of error and warning messages.
A: highlighting
Highlighting during interaction & literate compilation
A: imports
Handling of imports and interface file de/serialization.
A: infra
Iinfrastructure (e.g. CI, developer documentation, the build system, or the repository itself)
A: instance
Instance declarations, arguments, and resolution
A: lhs
LHS checking, coverage checking, and clause compilation
A: modules
Declaration and instantiation of parametrised modules.
A: parallel
Parallel typechecking.
A: positivity
Positivity checking
A: printing
Pretty-printing, display forms, and the wording of diagnostic messages
A: records
Record declarations, record expressions and copattern matching
A: scoping
Scope checking (ConcreteToAbstract)
A: termination
Termination checking
0 - type
bug
Issues describing an incorrect behaviour in the project, typos in the documentation, etc.
0 - type
discussion
An issue raised to gather opinions on a proposed change, or a suggested language change.
0 - type
question
An issue raised to ask a question.
9 - status
duplicate
This issue or pull request already exists.
9 - status
info needed
More information is needed from the submitter to decide how to proceed with the issue report.
9 - status
invalid
The issue report or pull request does not describe an actual bug, or does otherwise does not meet the contributing guidelines.
good first issue
Interested in contributing? Get started here.
upstream
Related to an upstream repository, already reported there
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
1lab/mikan#1
Reference in a new issue
1lab/mikan
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?