Logic 在Agda中建立依赖型系统

Logic 在Agda中建立依赖型系统,logic,agda,dependent-type,type-theory,Logic,Agda,Dependent Type,Type Theory,如何在Agda中制定依赖类型的逻辑,而不是通过重新使用Agda类型系统本身来“欺骗” 我可以很容易地定义一个独立类型的逻辑: infixr 5 _⇒_ data Type : Set where _⇒_ : Type → Type → Type infix 4 _⊢_ data _⊢_ : List Type → Type → Set where var : {a : Type} → [ a ] ⊢ a λ' : {a b : Type} {γ : _} → a ∷

如何在Agda中制定依赖类型的逻辑,而不是通过重新使用Agda类型系统本身来“欺骗”

我可以很容易地定义一个独立类型的逻辑:

infixr 5 _⇒_
data Type : Set where
    _⇒_ : Type → Type → Type

infix 4 _⊢_
data _⊢_ : List Type → Type → Set where
    var : {a : Type} → [ a ] ⊢ a
    λ'  : {a b : Type} {γ : _} → a ∷ γ ⊢ b → γ ⊢ a ⇒ b
    ply : {a b : Type} {γ δ : _} → γ ⊢ a ⇒ b → δ ⊢ a → γ ++ δ ⊢ b
    weak : {a b : Type} {γ : _} → γ ⊢ b → a ∷ γ ⊢ b
    cntr : {a b : Type} {γ : _} → a ∷ a ∷ γ ⊢ b → a ∷ γ ⊢ b
    xchg : {a : Type} {γ δ : _} → γ ↭ δ → γ ⊢ a → δ ⊢ a
我还可以大致了解Haskell中依赖类型λ-演算的教程实现。但它是隐式类型的,不像我的Agda代码,我甚至不知道从哪里开始修改我的代码,因为到目前为止我想到的路径导致了无限回归:

data _⊢_ : List (? ⊢ ?) → (? ⊢ ?) → Set where ...

谷歌搜索“在Agda中嵌入依赖类型”之类的搜索,只会返回在Agda中的依赖类型编程的点击数。Agda…

我们在关于类型理论中类型理论的论文中做了这项工作,它实际上在Agda中正式化了。基本思想是将上下文、类型、术语和替换定义为相互归纳的定义。我们只定义类型化对象,所以我们永远不必定义非类型化的东西或类型化判断。类型是通过依赖关系定义的,例如类型依赖于上下文,术语依赖于类型和上下文。为了表述定义等式,我们使用同伦类型理论的思想并允许等式构造函数。这意味着我们必须将更高归纳类型的实例公理化,或者成为精确的商归纳类型。在cubical Agda中,这应该很快就能实现


是的,我们的回购协议是在线的。您可以在以下位置找到代码:
@article{altenkirch2016type,
  title={Type theory in type theory using quotient inductive types},
  author={Altenkirch, Thorsten and Kaposi, Ambrus},
  journal={ACM SIGPLAN Notices},
  volume={51},
  number={1},
  pages={18--29},
  year={2016},
  publisher={ACM}
}