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 f ?(si=false) g = function
23 | Some (e, uri, B.Abst t) ->
24 let f tt obj = f (Some tt) (Some obj) in
25 let f xt tt = E.set_obj (f tt) (e, uri, B.Abst xt) in
26 L.loc := e; T.type_of f ~si g R.empty_machine t
27 | Some (e, uri, B.Abbr t) ->
28 let f tt obj = f (Some tt) (Some obj) in
29 let f xt tt = E.set_obj (f tt) (e, uri, B.Abbr xt) in
30 L.loc := e; T.type_of f ~si g R.empty_machine t
31 | Some (e, uri, B.Void) ->
32 let f obj = f None (Some obj) in
33 L.loc := e; E.set_obj f (e, uri, B.Void)