【发布时间】:2014-11-05 23:09:43
【问题描述】:
这是一个人为的多类型列表:
Inductive Apple : Set :=.
Inductive Pear : Set :=.
Inductive FruitList : Set :=
| Empty
| Cons_apple (a : Apple) (p : FruitList)
| Cons_pear (p : Pear) (p: FruitList).
Variable a : Apple.
Variable p : Pear.
Definition a_fruitList := Cons_apple a (Cons_pear p Empty).
有没有办法为此定义一个列表表示法,例如,a_fruitList 可以由[p,a] 定义?
【问题讨论】:
-
这与您的问题无关,但请注意
Inductive Apple: Set :=.将Apple定义为空集。因此,当您声明Variable a: Apple时,您会在开发中引入不一致的情况。你应该改用Parameter Apple: Set。
标签: coq