【发布时间】:2018-04-08 14:11:06
【问题描述】:
我正在阅读 Coq http://www.cs.cmu.edu/~iliano/projects/metaCLF2/inc/dl/papers/lsfa17.pdf 和 https://github.com/brunofx86/LL 中关于线性逻辑的机械化,但我无法理解来自 https://github.com/brunofx86/LL/blob/master/FOLL/LL/SyntaxLL.v 的归纳类型 term 的类型构造函数:
Inductive term :=
|var (t: T) (* variables *)
|cte (e:A) (* constants from the domain DT.A *)
|fc1 (n:nat) (t: term) (* family of functions of 1 argument *)
|fc2 (n:nat) (t1 t2: term). (* family of functions of 2 argument *)
关于这个样本我有两个问题(我正在阅读本文中的https://softwarefoundations.cis.upenn.edu/lf-current/Basics.html):
-
term的(超)类型是什么? Software Foundations 总是指定新类型的(超)类型,例如Inductive color : Type; -
主要问题 - 如何理解类型构造函数
var (t: T)?。 Software Foundation 在其第一章中只提供了两种类型的构造函数:常量white : color和函数primary : rgb → color。但是var (t: T)是一个非常奇怪的符号——它不是有效的函数类型定义,因为它没有明确的返回类型,也没有箭头。
【问题讨论】:
标签: functional-programming logic coq