aya-dev icon indicating copy to clipboard operation
aya-dev copied to clipboard

Positivity check is incorrectly implemented

Open ice1000 opened this issue 2 years ago • 3 comments

data Dead : Set
open data Zaoqi (A : Type)
| essentially (A -> Dead)
open data Cat : Type
  | meow : (Zaoqi Cat) → Cat

def catIsDead : Cat → Dead
  | meow (essentially f) => f (meow (essentially f))

def catIsAlive : Cat
  => meow (essentially catIsDead)
  
def catIsBothDeadAndAlive: Dead
  => catIsDead catIsAlive

/cc @tsao-chi

ice1000 avatar Dec 21 '22 19:12 ice1000

https://github.com/JetBrains/Arend/blob/master/base/src/main/java/org/arend/typechecking/covariance/CovarianceChecker.java

ice1000 avatar Dec 21 '22 21:12 ice1000

😱

HoshinoTented avatar Dec 23 '22 03:12 HoshinoTented

A more mature implementation would require explicit polarity annotations

References: https://github.com/agda/agda/issues/2411 https://github.com/agda/agda/pull/6385

mio-19 avatar Dec 26 '22 14:12 mio-19