/[svn]/types/types.mli
ViewVC logotype

Contents of /types/types.mli

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (hide annotations)
Tue Jul 10 16:57:08 2007 UTC (5 years, 10 months ago) by abate
File size: 2846 byte(s)
[r2002-10-10 16:39:45 by cvscast] Empty log message

Original author: cvscast
Date: 2002-10-10 16:39:45+00:00
1 abate 1 type label = int
2     type atom = int
3     type const = Integer of int | Atom of atom | String of string
4    
5     (** Algebra **)
6    
7     type node
8     type descr
9    
10     val make: unit -> node
11     val define: node -> descr -> unit
12    
13     val cons: descr -> node
14     val internalize: node -> node
15    
16     val id: node -> int
17     val descr: node -> descr
18    
19    
20     (** Boolean connectives **)
21    
22     val cup : descr -> descr -> descr
23     val cap : descr -> descr -> descr
24     val diff : descr -> descr -> descr
25     val neg : descr -> descr
26     val empty : descr
27     val any : descr
28    
29     (** Constructors **)
30    
31     val interval : int -> int -> descr
32     val atom : atom -> descr
33     val times : node -> node -> descr
34     val arrow : node -> node -> descr
35     val record : label -> bool -> node -> descr
36     val string : Strings.Regexp.regexp -> descr
37     val constant : const -> descr
38    
39     (** Positive systems and least solutions **)
40    
41     module Positive :
42     sig
43     type v
44     val forward: unit -> v
45     val define: v -> v -> unit
46     val ty: descr -> v
47     val cup: v list -> v
48     val times: v -> v -> v
49    
50     val solve: v -> node
51     end
52    
53     (** Labels and atom names **)
54    
55     val mk_atom : string -> atom
56     val atom_name : atom -> string
57    
58     val label : string -> label
59     val label_name : label -> string
60    
61     (** Normalization **)
62    
63     module Product : sig
64     val any : descr
65    
66     (* List of non-empty rectangles *)
67     type t = (descr * descr) list
68     val get: descr -> t
69     val pi1: t -> descr
70     val pi2: t -> descr
71    
72     (* Intersection with (pi1,Any) *)
73     val restrict_1: t -> descr -> t
74    
75     (* List of non-empty rectangles whose first projection
76     are pair-wise disjunct *)
77     type normal = t
78     val normal: descr -> t
79     end
80    
81     module Record : sig
82     val any : descr
83    
84     (* List of maps label -> (optional, content) *)
85     type t = (label, (bool * descr)) SortedMap.t list
86     val get: descr -> t
87     val is_empty: t -> bool
88     val restrict_label_present: t -> label -> t
89     val restrict_field: t -> label -> descr -> t
90     val restrict_label_absent: t -> label -> t
91     val project_field: t -> label -> descr
92    
93     type normal =
94     [ `Success
95     | `Fail
96     | `Label of label * (descr * normal) list * normal ]
97     val normal: descr -> normal
98    
99     val project : descr -> label -> descr
100     (* Raise Not_found if label is not necessarily present *)
101     end
102    
103    
104     val normalize : node -> node
105    
106 abate 6 val apply : descr -> descr -> descr
107 abate 1
108     (** Subtyping and sample values **)
109    
110     val is_empty : descr -> bool
111     val non_empty: descr -> bool
112     val subtype : descr -> descr -> bool
113    
114     module Sample :
115     sig
116     type t =
117     | Int of int
118     | Atom of atom
119     | String of string
120     | Pair of t * t
121     | Record of (label * t) list
122     | Fun of (node * node) list
123    
124     val get : descr -> t
125     (**
126     Extract a sample value from a non empty type;
127     raise Not_found for an empty type
128     **)
129     end
130    
131     module Print :
132     sig
133     val print : Format.formatter -> node -> unit
134     val print_descr: Format.formatter -> descr -> unit
135     end
136    
137     val check: descr -> unit

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5