1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "terms/term.ma".
17 (* PATH *********************************************************************)
19 (* Policy: path step metavariables: c *)
20 (* Note: this is a step of a path in the tree representation of a term:
21 rc (rectus) : proceed on the argument of an abstraction
22 sn (sinister): proceed on the left argument of an application
23 dx (dexter) : proceed on the right argument of an application
25 inductive step: Type[0] ≝
31 definition is_dx: predicate step ≝ λc. dx = c.
33 (* Policy: path metavariables: p, q *)
34 (* Note: this is a path in the tree representation of a term, heading to a redex *)
35 definition path: Type[0] ≝ list step.
37 (* Note: a redex is "in whd" when is not under an abstraction nor in the lefr argument of an application *)
38 definition in_whd: predicate path ≝ All … is_dx.
40 lemma in_whd_ind: ∀R:predicate path. R (◊) →
41 (∀p. in_whd p → R p → R (dx::p)) →
43 #R #H #IH #p elim p -p // -H *
44 #p #IHp * #H1 #H2 destruct /3 width=1/
47 definition compatible_rc: predicate (path→relation term) ≝ λR.
48 ∀p,A1,A2. R p A1 A2 → R (rc::p) (𝛌.A1) (𝛌.A2).
50 definition compatible_sn: predicate (path→relation term) ≝ λR.
51 ∀p,B1,B2,A. R p B1 B2 → R (sn::p) (@B1.A) (@B2.A).
53 definition compatible_dx: predicate (path→relation term) ≝ λR.
54 ∀p,B,A1,A2. R p A1 A2 → R (dx::p) (@B.A1) (@B.A2).