2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
12 (* kernel version: dual, relative, global *)
13 (* note : fragment of dual lambda-delta serving as abstract layer *)
17 type attrs = Entity.attrs
19 type bind = Abst of term list (* domains *)
20 | Abbr of term list (* bodies *)
21 | Void of int (* number of exclusions *)
23 and term = Sort of attrs * int (* attrs, hierarchy index *)
24 | LRef of attrs * int * int (* attrs, position indexes *)
25 | GRef of attrs * uri (* attrs, reference *)
26 | Cast of attrs * term * term (* attrs, domain, element *)
27 | Appl of attrs * term list * term (* attrs, arguments, function *)
28 | Proj of attrs * lenv * term (* attrs, closure, member *)
29 | Bind of attrs * bind * term (* attrs, binder, scope *)
32 | Cons of lenv * attrs * bind (* closure, attrs, binder *)
34 type entity = term Entity.entity
36 (* helpers ******************************************************************)
39 let str = String.concat "/" ["ld:"; "drg"; root; s ^ ".ld"] in
44 let push f lenv a b = f (Cons (lenv, a, b))
46 let resolve_lref err f id lenv =
47 let rec aux f i k = function
50 let err kk = aux f (succ i) (k + kk) tl in
52 Entity.resolve err f id a