]> matita.cs.unibo.it Git - helm.git/blob - helm/software/lambda-delta/basic_rg/brgUntrusted.ml
20b9a5cf1c64f0c8aaa6a6f1d0b5bcc927bc7273
[helm.git] / helm / software / lambda-delta / basic_rg / brgUntrusted.ml
1 (*
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.                     
5     ||I||                                                                
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_______________________________________________________________ *)
11
12 module L = Log
13 module B = Brg
14 module E = BrgEnvironment
15 module R = BrgReduction
16 module T = BrgType
17
18 (* Interface functions ******************************************************)
19
20 (* to share *)
21 let type_check err f ?(si=false) g = function
22    | None                           -> f None None
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)