Skip to content

Commit

Permalink
[ re agda#5610 ] Move proof of false from BuiltinFlatBadType.agda to …
Browse files Browse the repository at this point in the history
…BuiltinSharpBadType.agda
  • Loading branch information
jespercockx committed Nov 3, 2021
1 parent 77e7ac3 commit 2252459
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
20 changes: 0 additions & 20 deletions test/Fail/BuiltinFlatBadType.agda
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,3 @@ postulate
{-# BUILTIN INFINITY ∞ #-}
{-# BUILTIN SHARP ♯_ #-}
{-# BUILTIN FLAT ♭ #-}

-- Issue #5610: with these bad types for sharp and flat, we can prove
-- false. The reason is that ∞ is assumed to be strictly-positive in
-- the positivity checker (even guarding positive). So making ∞ A
-- isomorphic to A → ⊥ will be contradictory to this assumption.

data D : Set where
wrap : ∞ D D

lam : (D ⊥) D
lam f = wrap (♯ f)

app : D D
app (wrap g) d = ♭ g d

delta : D
delta = lam (λ x app x x)

omega :
omega = app delta delta
22 changes: 22 additions & 0 deletions test/Fail/BuiltinSharpBadType.agda
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ data ⊥ : Set where
postulate
: {a} Set a Set a
♯_ : {a} {A : Set a} (A ⊥) ∞ A
: {a} {A : Set a} ∞ A A

{-# BUILTIN INFINITY ∞ #-}
{-# BUILTIN SHARP ♯_ #-}
{-# BUILTIN FLAT ♭ #-}

-- Issue #5610: with these bad types for sharp and flat, we can prove
-- false. The reason is that ∞ is assumed to be strictly-positive in
-- the positivity checker (even guarding positive). So making ∞ A
-- isomorphic to A → ⊥ will be contradictory to this assumption.

data D : Set where
wrap : ∞ D D

lam : (D ⊥) D
lam f = wrap (♯ f)

app : D D
app (wrap g) d = ♭ g d

delta : D
delta = lam (λ x app x x)

omega :
omega = app delta delta
4 changes: 2 additions & 2 deletions test/Fail/BuiltinSharpBadType.err
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BuiltinSharpBadType.agda:9,22-24
A !=< _A_11 → ⊥
BuiltinSharpBadType.agda:10,22-24
A !=< _A_17 → ⊥
when checking that the expression ♯_ has type A → ∞ A

0 comments on commit 2252459

Please sign in to comment.