-
Notifications
You must be signed in to change notification settings - Fork 409
Sized types allow defining inconsistent data #7178
Copy link
Copy link
Open
Labels
falseProof of the empty type which checks without known-unsafe flags (e.g. without --type-in-type)Proof of the empty type which checks without known-unsafe flags (e.g. without --type-in-type)infinity-less-than-infinityBugs relating to the ∞ < ∞ ruleBugs relating to the ∞ < ∞ rulesized typesSized types, termination checking with sized types, size inferenceSized types, termination checking with sized types, size inference
Milestone
Description
Consider the following data type:
{-# OPTIONS --sized-types #-}
module _ where
open import Agda.Builtin.Size
data ⊥ : Set where
record SPN (i j : Size) : Set
data SPM (i j : Size) : Set
data SPM i j where
inj : ∀ {k : Size< j} → SPN i k → SPM i j
record SPN i j where
coinductive
field
rec : {k : Size< i} → SPM k j
open SPN
spn : {i : Size} → SPN i ∞
spn .rec = inj spn
spm : {i : Size} → SPM ∞ i → ⊥
spm (inj x) = spm (x .rec)
boom : ⊥
boom = spm (spn .rec)Yet again an inconsistency with sized types, but I believe that this one is of a new kind. Both spn and spm are legal, and ∞ < ∞ is not abused anywhere.
I think the problem here is that SPM and SPN can be expressed neither as νY.μX.Y nor as μX.νY.X, which messes with the theory. It is unclear how to forbid such definitions though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
falseProof of the empty type which checks without known-unsafe flags (e.g. without --type-in-type)Proof of the empty type which checks without known-unsafe flags (e.g. without --type-in-type)infinity-less-than-infinityBugs relating to the ∞ < ∞ ruleBugs relating to the ∞ < ∞ rulesized typesSized types, termination checking with sized types, size inferenceSized types, termination checking with sized types, size inference