]> matita.cs.unibo.it Git - helm.git/blob - helm/software/lambda-delta/basic_ag/bagUntrusted.ml
we removed some old code and fixed a reduction bug: two instances fo the
[helm.git] / helm / software / lambda-delta / basic_ag / bagUntrusted.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 = Bag
14 module E = BagEnvironment
15 module T = BagType
16
17 (* Interface functions ******************************************************)
18
19 (* to share *)
20 let type_check f g = function
21    | None                    -> f None None
22    | Some (a, uri, B.Abst t) ->
23       let f tt obj = f (Some tt) (Some obj) in
24       let f xt tt = E.set_obj (f tt) (a, uri, B.Abst xt) in
25       L.loc := a; T.type_of f g B.empty_context t
26    | Some (a, uri, B.Abbr t) ->
27       let f tt obj = f (Some tt) (Some obj) in
28       let f xt tt = E.set_obj (f tt) (a, uri, B.Abbr xt) in
29       L.loc := a; T.type_of f g B.empty_context t
30    | Some (a, uri, B.Void)   ->
31       let f obj = f None (Some obj) in
32       L.loc := a; E.set_obj f (a, uri, B.Void)