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_______________________________________________________________ *)
14 module E = BrgEnvironment
15 module R = BrgReduction
18 (* Interface functions ******************************************************)
21 let type_check err f ?(si=false) g = function
23 | Some (e, uri, B.Abst (a, t)) ->
24 let f tt entry = f (Some tt) (Some entry) in
25 let f xt tt = E.set_entry (f tt) (e, uri, B.abst a xt) in
26 L.loc := e; T.type_of err f ~si g R.empty_kam t
27 | Some (e, uri, B.Abbr (a, t)) ->
28 let f tt entry = f (Some tt) (Some entry) in
29 let f xt tt = E.set_entry (f tt) (e, uri, B.abbr a xt) in
30 L.loc := e; T.type_of err f ~si g R.empty_kam t
31 | Some (e, uri, (B.Void _ as b)) ->
32 let f entry = f None (Some entry) in
33 L.loc := e; E.set_entry f (e, uri, b)