xiaoxiangmoe / pfpl-questions

学习 PFPL 遇到的问题集
1 stars 0 forks source link

什么是 arity? #1

Closed xiaoxiangmoe closed 6 years ago

xiaoxiangmoe commented 6 years ago

see 1.1 Abstract Syntax Trees

For a given set S of sorts, an arity has the form (s1, . . . , sn)s, which specifies the sort s ∈ S of an operator taking n ≥ 0 arguments, each of sort si ∈ S.

If o is an operator of arity (s1, . . . , sn)s, we say that o has sort s and has n arguments of sorts s1,...,sn.

  1. 元数的类型究竟是 nat ,还是一个 S* ?也就是元数带不带类型?
  2. 另外这里写的 an arity has the form (s1, . . . , sn)s 一共有n+1个s放在这里,是指arity是S* × S类型的意思吗?
  3. operator 的类型是 S 还是 S* × S?貌似书上是指返回值类型,感觉有些反直觉。

求更详细地定义/解释这里的 arity,arity的form, operator

注:S* 我是想表达 0到多个S的笛卡尔积,我也不知道它叫啥。

MarisaKirisame commented 6 years ago

MarisaKirisame commented 6 years ago

2:是 3:应该说的是operator吃掉n个arg以后的类型