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 "basic_2/notation/relations/unfold_4.ma".
16 include "basic_2/grammar/lenv_append.ma".
17 include "basic_2/grammar/genv.ma".
18 include "basic_2/substitution/drop.ma".
20 (* CONTEXT-SENSITIVE UNFOLD FOR TERMS ***************************************)
23 inductive unfold: relation4 genv lenv term lenv ≝
24 | unfold_sort: ∀G,L,s. unfold G L (⋆s) L
25 | unfold_lref: ∀I,G,L1,L2,K1,K2,V,i. ⬇[i] L1 ≡ K1. ⓑ{I}V →
26 unfold G K1 V K2 → ⬇[Ⓣ, |L2|, i] L2 ≡ K2 →
27 unfold G L1 (#i) (L1@@L2)
28 | unfold_bind: ∀a,I,G,L1,L2,V,T.
29 unfold G (L1.ⓑ{I}V) T L2 → unfold G L1 (ⓑ{a,I}V.T) L2
30 | unfold_flat: ∀I,G,L1,L2,V,T.
31 unfold G L1 T L2 → unfold G L1 (ⓕ{I}V.T) L2
34 interpretation "context-sensitive unfold (term)"
35 'Unfold G L1 T L2 = (unfold G L1 T L2).