]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda/redex_pointer.ma
match
[helm.git] / matita / matita / contribs / lambda / redex_pointer.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 "term.ma".
16
17 (* REDEX POINTER ************************************************************)
18
19 (* Policy: boolean metavariables: a, b
20            pointer metavariables: p, q
21 *)
22 (* Note: this is a path in the tree representation of a term
23          in which abstraction nodes are omitted;
24          on application nodes, "false" means "proceed left"
25          and "true" means "proceed right"
26 *)
27 definition rpointer: Type[0] ≝ list bool.
28
29 (* Note: precedence relation on redex pointers: p ≺ q
30          to serve as base for the order relations: p < q and p ≤ q *)
31 inductive rpprec: relation rpointer ≝
32 | rpprec_nil : ∀b,q.   rpprec ([]) (b::q)
33 | rppprc_cons: ∀p,q.   rpprec (false::p) (true::q)
34 | rpprec_comp: ∀b,p,q. rpprec p q → rpprec (b::p) (b::q)
35 .
36
37 interpretation "'precedes' on redex pointers"
38    'prec p q = (rpprec p q).
39
40 (* Note: this should go to core_notation *)
41 notation "hvbox(a break ≺ b)"
42    non associative with precedence 45
43    for @{ 'prec $a $b }.
44
45 (* Note: this is p < q *)
46 interpretation "'less than' on redex pointers"
47    'lt p q = (TC rpointer rpprec p q).
48
49 (* Note: this is p ≤ q, that *really* is p < q ∨ p = q *)
50 interpretation "'less or equal to' on redex pointers"
51    'leq x y = (RC rpointer (TC rpointer rpprec) x y).