我无法理解构造函数的原理以及它的工作原理。 例如,在勒柯克,我们都被教导来定义自然数是这样的: Inductive nat : Type :=
| O : nat
| S : nat -> nat.
而且已被告知,S是一个构造,但究竟是什么意思? 如果我再做: Check (S (S (S (S O)))).
我得到的,它是4和nat类型。 这是如何工作的,Coq如何知
我的定义归纳类型: Inductive InL (A:Type) (y:A) : list A -> Prop :=
| InHead : forall xs:list A, InL y (cons y xs)
| InTail : forall (x:A) (xs:list A), InL y xs -> InL y (cons x xs).
Inductive SubS