相关疑难解决方法(0)

在立方模式下定义非一元函数

我想在Cubical模式下定义一个带有两个更高归纳类型的参数的函数。我cubical软件包用作“前奏”库。

我首先将整数的商类型定义为HIT:

{-# OPTIONS --cubical #-}
module _ where

open import Data.Nat renaming (_+_ to _+?_)
open import Cubical.Core.Prelude

data ? : Set where
  _-_ : (x : ?) ? (y : ?) ? ?
  quot : ? {x y x? y?} ? (x ?+ y?) ? (x? ?+ y) ? (x - y) ? (x? - y?)
Run Code Online (Sandbox Code Playgroud)

然后,我可以使用模式匹配来定义一元函数:

_+1 : ? ? ?
(x - y) +1 = suc x - y
quot {x} {y} …
Run Code Online (Sandbox Code Playgroud)

topology agda cubical-type-theory homotopy-type-theory

5
推荐指数
1
解决办法
424
查看次数