-
Notifications
You must be signed in to change notification settings - Fork 407
subtyping inductive sized types #2411
Copy link
Copy link
Closed
Labels
polaritypositivityPositivity checking for data-type definitionsPositivity checking for data-type definitionssized typesSized types, termination checking with sized types, size inferenceSized types, termination checking with sized types, size inferencesubtypingIssues relating to subtyping.Issues relating to subtyping.
Description
I was playing around Datatype a la carte with sized types in Agda, and came across this problem (bug?) in subtyping sized types:
open import Size
data NatF (a : Set) : Set where
zeroF : NatF a
succF : a → NatF a
{-# NO_POSITIVITY_CHECK #-}
data μ {i : Size} (F : Set → Set) : Set where
In : {j : Size< i} → F (μ {j} F) → μ {i} F
pred' : ∀ {i} → μ {i} NatF → μ {i} NatF
pred' (In zeroF) = In zeroF
pred' (In (succF x)) = {!cannot type check with x!}However the following will type check
data Nat {i : Size} : Set where
In : {j : Size< i} → NatF (Nat {j}) → Nat {i}
pred : ∀ {i} → Nat {i} → Nat {i}
pred (In zeroF) = In zeroF
pred (In (succF x)) = xAny pointers would be appreciated!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
polaritypositivityPositivity checking for data-type definitionsPositivity checking for data-type definitionssized typesSized types, termination checking with sized types, size inferenceSized types, termination checking with sized types, size inferencesubtypingIssues relating to subtyping.Issues relating to subtyping.