Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Question about mutual inductive definition with fixpoint

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Question about mutual inductive definition with fixpoint


Chronological Thread 
  • From: Ilmārs Cīrulis <ilmars.cirulis AT gmail.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: [Coq-Club] Question about mutual inductive definition with fixpoint
  • Date: Mon, 15 Feb 2016 19:09:47 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ilmars.cirulis AT gmail.com; spf=Pass smtp.mailfrom=ilmars.cirulis AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw0-f175.google.com
  • Ironport-phdr: 9a23:df37dxLhF0MU5OCuyNmcpTZWNBhigK39O0sv0rFitYgULPjxwZ3uMQTl6Ol3ixeRBMOAu60C17Od4v6ocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC0ILrjqvjpdX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVG679ZuEzSaFSJDUgKWE8osPx/1GXRgyWo3AYT28+kxxSAgGD4gusDbnrtS6vl+54czOBdeb3V60wWC/qu6ZvTRbyk2EMNiQk9GDMosN1haNf5hmmokoskMbvfIiJOa8mLevmdtQASD8ZUw==

Here it is:

Inductive list A: nat → Type :=
 | nil: list A 0
 | cons: ∀ n, A → list A n → list A (S n).

Definition Language (A B: Type) := A → nat.

Inductive Term A B (W: Language A B) :=
 | variable: nat → Term W
 | function_node: ∀ x, list (Term W) (W x) → Term W
 | binder_node: ∀ (b: B) (v: nat), Term W → Term W.

 
Here I want to add the following condition in this inductive definition (for binder_node case).
 
Fixpoint variable_is_free A B (W: Language A B) (T: Term W) (x: nat) :=
 match T with
 | variable _ v => True
 | function_node _ L => Forall L (λ t, variable_is_free t x)
 | binder_node _ v t => v <> x ∧ variable_is_free t x
 end.


It should be something similar to this:
 
Inductive Term A B (W: Language A B) :=
 | variable: nat → Term W
 | function_node: ∀ x, list (Term W) (W x) → Term W
 | binder_node: ∀ (b: B) (v: nat) (T: Term W), variable_is_free T v → Term W
with variable_is_free A B (W: Language A B) := ...
 

How can I do such thing? 




Archive powered by MHonArc 2.6.18.

Top of Page