]> matita.cs.unibo.it Git - helm.git/blob - helm/software/lambda-delta/src/common/ccs.ml
Matitaweb: layout change in the matitaweb inteface, in order to allow better
[helm.git] / helm / software / lambda-delta / src / common / ccs.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 = List
13 module U = NUri
14 module C = Cps
15 module E = Entity
16 module G = Options
17
18 type csys = {
19            uri: E.uri;
20    mutable tp : int list;
21    mutable t1 : int list;
22    mutable tn : (int * int) list;
23 }
24
25 let mark a = E.mark C.err C.start a
26
27 (* interface functions ******************************************************)
28
29 let init () = {
30    uri = U.uri_of_string (G.get_baseuri ());
31    tp = []; t1 = []; tn = []
32 }
33
34 let add_nonzero s a = 
35    if !G.si && !G.cc then
36       let i = abs (mark a) in
37       if L.mem i s.tp then () else s.tp <- i :: s.tp
38    else ()
39
40 let add_zero s a = 
41    if !G.si && !G.cc then
42       let i = abs (mark a) in
43       if L.mem i s.t1 then () else s.t1 <- i :: s.t1
44    else ()
45
46 let add_equal s xa ia = 
47    if !G.si && !G.cc then
48       let i = abs (mark xa), abs (mark ia) in
49       if L.mem i s.tn then () else s.tn <- i :: s.tn
50    else ()