如何获取大小写拆分要使用的语法声明

How to get syntax declarations to be used by case splitting

我想使用声明的语法自动区分参数 除了作为类型构造函数给出的那个。例如,

postulate P : ℕ → ℕ → Set

data Silly : Set where
  goo : (n : ℕ) → Fin n → (m : ℕ) → Fin m → P n m → Silly

在这里,我想证明 P n m 出现在 nm 参数之间,但这不可能,因为两者都需要声明才能成为表达。因此,我们使用语法声明:

syntax goo n i m j pf = i ⟵[ n , pf , m ]⟶ j

现在,我们可以手写了

want-to-use-syntax-in-pattern-matching : Silly → Set
want-to-use-syntax-in-pattern-matching (i ⟵[ n , pf , m ]⟶ j) = ℕ

这很好用,但是当我通过 C-c C-c 区分大小写时,它使用 goo 而不是我的语法。有什么方法可以使用我声明的语法进行大小写拆分吗?

( 顺便说一句,使用

syntax goo n i m j pf = i ─[ n , pf , m ]⟶ j

失败,其中 \---

生成

)

如今,如果模式在不合格范围内,Agda 会在左侧重新添加模式 这样就可以了。