aya-prover / aya-dev

A proof assistant and a dependently-typed language
https://www.aya-prover.org
MIT License
280 stars 16 forks source link

Positivity check is incorrectly implemented #849

Open ice1000 opened 1 year ago

ice1000 commented 1 year ago
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 commented 1 year ago

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

HoshinoTented commented 1 year ago

😱

mio-19 commented 1 year ago

A more mature implementation would require explicit polarity annotations

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