]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda/pointer_order.ma
9d79e9dc61b11a60cd60341e7fb484e52a83db6b
[helm.git] / matita / matita / contribs / lambda / pointer_order.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "pointer.ma".
16
17 (* POINTER ORDER ************************************************************)
18
19 (* Note: precedence relation on redex pointers: p ≺ q
20          to serve as base for the order relations: p < q and p ≤ q *)
21 inductive pprec: relation ptr ≝
22 | pprec_nil : ∀c,q.   pprec (◊) (c::q)
23 | ppprc_cons: ∀p,q.   pprec (dx::p) (sn::q)
24 | pprec_comp: ∀c,p,q. pprec p q → pprec (c::p) (c::q)
25 | pprec_skip:         pprec (dx::◊) ◊
26 .
27
28 interpretation "'precedes' on pointers"
29    'prec p q = (pprec p q).
30
31 (* Note: this should go to core_notation *)
32 notation "hvbox(a break ≺ b)"
33    non associative with precedence 45
34    for @{ 'prec $a $b }.
35
36 (* Note: this is p < q *)
37 definition plt: relation ptr ≝ TC … pprec.
38
39 interpretation "'less than' on redex pointers"
40    'lt p q = (plt p q).
41
42 (* Note: this is p ≤ q *)
43 definition ple: relation ptr ≝ star … pprec.
44
45 interpretation "'less or equal to' on redex pointers"
46    'leq p q = (ple p q).
47
48 lemma pprec_ple: ∀p,q. p ≺ q → p ≤ q.
49 /2 width=1/
50 qed.
51
52 lemma ple_dx: dx::◊ ≤ ◊.
53 /2 width=1/
54 qed.
55
56 lemma ple_nil: ∀p. ◊ ≤ p.
57 * // /2 width=1/
58 qed.
59
60 lemma ple_comp: ∀p1,p2. p1 ≤ p2 → ∀c. (c::p1) ≤ (c::p2).
61 #p1 #p2 #H elim H -p2 // /3 width=3/
62 qed.