-
Notifications
You must be signed in to change notification settings - Fork 410
Proof of ⊥ with sized types #6002
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
The following code is accepted by both the latest release and master.
{-# OPTIONS --sized-types #-}
module Fix where
open import Agda.Builtin.Size
open import Agda.Primitive
private variable
a : Level
record Thunk (F : Size → Set a) i : Set a where
coinductive
field force : {j : Size< i} → F j
open Thunk
data Embed : ∀ {i} → Thunk (λ _ → Set) i → Set where
[_] : ∀ {i A} → force A → Embed {↑ i} A
expel : {A : Thunk (λ _ → Set) ∞} → Embed A → force A
expel [ x ] = x
Fix′ : Size → (Set → Set) → Set
Fix′ i F = F (Embed {i} λ where .force {j} → Fix′ j F)
Fix = Fix′ ∞
data ⊥ : Set where
⊥-elim : ∀ {a} {A : Set a} → ⊥ → A
⊥-elim ()
data Bad (A : Set) : Set where
bad : (A → ⊥) → Bad A
app : Fix Bad → Fix Bad → ⊥
app (bad f) x = f [ x ]
self : Fix Bad
self = bad λ x → app (expel x) (expel x)
example : ⊥
example = app self selfThe fishiest thing to me is the definition of Embed, which seems like it should belong to Set₁ instead of Set. It would appear that Agda treats A like a parameter instead of an index, despite the fact that its type depends on an index (i).
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