3 Require Export terms_defs.
5 Inductive Set C := CSort : nat -> C
6 | CTail : C -> K -> T -> C.
8 Hint f3CKT : ltlc := Resolve (f_equal3 C K T).
10 Definition r: K -> nat -> nat := [k;i] Cases k of
15 Fixpoint app [c:C] : nat -> T -> T := [j;t]Cases j c of
18 | (S i) (CTail c k u) => (app c (r k i) (TTail k u t))
21 Section r_props. (********************************************************)
23 Theorem r_S: (k:?; i:?) (r k (S i)) = (S (r k i)).
27 Theorem r_plus_sym: (k:?; i,j:?) (r k (plus i j)) = (plus i (r k j)).
28 XElim k; Intros; Simpl; XAuto.
31 Theorem r_minus: (i,n:?) (lt n i) ->
32 (k:?) (minus (r k i) (S n)) = (r k (minus i (S n))).
33 XElim k; Intros; Simpl; XEAuto.
36 Theorem r_dis: (k:?; P:Prop)
37 (((i:?) (r k i) = i) -> P) ->
38 (((i:?) (r k i) = (S i)) -> P) -> P.
44 Tactic Definition RRw :=
45 Repeat (Rewrite r_S Orelse Rewrite r_plus_sym).
47 Section r_arith. (********************************************************)
49 Theorem r_arith0: (k:?; i:?) (minus (r k (S i)) (1)) = (r k i).
50 Intros; RRw; Rewrite minus_Sx_SO; XAuto.
53 Theorem r_arith1: (k:?; i,j:?) (minus (r k (S i)) (S j)) = (minus (r k i) j).
59 Section app_props. (******************************************************)
61 Theorem app_csort : (t:?; i,n:?) (app (CSort n) i t) = t.
62 XElim i; Intros; Simpl; XAuto.
65 Theorem app_O : (c:?; t:?) (app c (0) t) = t.
71 Hints Resolve app_csort app_O : ltlc.