Debian Codegraph @

test-suite/success/mutual_ind.v

raw
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10 (* Definition mutuellement inductive et dependante *)
11
12 Record signature : Type :=
13 {sort : Set;
14 sort_beq : sort -> sort -> bool;
15 sort_beq_refl : forall f : sort, true = sort_beq f f;
16 sort_beq_eq : forall f1 f2 : sort, true = sort_beq f1 f2 -> f1 = f2;
17 fsym :> Set;
18 fsym_type : fsym -> list sort * sort;
19 fsym_beq : fsym -> fsym -> bool;
20 fsym_beq_refl : forall f : fsym, true = fsym_beq f f;
21 fsym_beq_eq : forall f1 f2 : fsym, true = fsym_beq f1 f2 -> f1 = f2}.
22
23
24 Parameter F : signature.
25
26 Definition vsym := (sort F * nat)%type.
27
28 Definition vsym_sort := fst (A:=sort F) (B:=nat).
29 Definition vsym_nat := snd (A:=sort F) (B:=nat).
30
31
32 Inductive term : sort F -> Set :=
33 | term_var : forall v : vsym, term (vsym_sort v)
34 | term_app :
35 forall f : F,
36 list_term (fst (fsym_type F f)) -> term (snd (fsym_type F f))
37 with list_term : list (sort F) -> Set :=
38 | term_nil : list_term nil
39 | term_cons :
40 forall (s : sort F) (l : list (sort F)),
41 term s -> list_term l -> list_term (s :: l).
42