-
Notifications
You must be signed in to change notification settings - Fork 0
/
gml.mli
195 lines (164 loc) · 4.91 KB
/
gml.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
(*
* Praline
* Copyright 2011 LSV, CNRS & ENS de Cachan, France
* Author: Romain Brenguier <[email protected]>
* File: gml.mli
* Created: Thu Jul 28 2011
*
* This file is part of Praline.
*
* Praline is a free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*)
(** Parser and printers for arenas given in the
gml and dot file formats *)
module Point :
sig
type t
val x : t -> int
val y : t -> int
val set_x : t -> int -> t
val set_y : t -> int -> t
val make : x:int -> y:int -> t
val print : t -> (string * Graph.Gml.value)
val parse : (string * Graph.Gml.value) -> t
end
module type N =
sig
type t
val empty : unit -> t
val id : t -> string
val label : t -> string
val x : t -> int
val y : t -> int
val w : t -> int
val h : t -> int
val fill : t -> string
val _type : t -> string
val outline : t -> string
val compare : t -> t -> int
val hash : t -> int
val equal : t -> t -> bool
val of_id : string -> t
val print : t -> Graph.Gml.value_list
val parse : Graph.Gml.value_list -> t
end
module Node :
sig
include N
val set_id : t -> string -> t
val set_x : t -> int -> t
val set_y : t -> int -> t
val set_w : t -> int -> t
val set_h : t -> int -> t
val set_label : t -> string -> t
val set_fill : t -> string -> t
val set_type : t -> string -> t
val set_outline : t -> string -> t
val make : ?id:string -> ?label:string -> ?x:int -> ?y:int -> ?w:int -> ?h:int -> ?fill:string -> ?_type:string -> ?outline:string -> unit -> t
end
(** Imperative version of nodes *)
module INode :
sig
include N
val set_id : t -> string -> unit
val set_x : t -> int -> unit
val set_y : t -> int -> unit
val set_w : t -> int -> unit
val set_h : t -> int -> unit
val set_label : t -> string -> unit
val set_fill : t -> string -> unit
val set_type : t -> string -> unit
val set_outline : t -> string -> unit
val make : ?id:string -> ?label:string -> ?x:int -> ?y:int -> ?w:int -> ?h:int -> ?fill:string -> ?_type:string -> ?outline:string -> unit -> t
end
module type E =
sig
type t
type node
val default : t
val compare : t -> t -> int
val source : t -> node
val target : t -> node
val label : t -> string
val fill : t -> string
val line : t -> Point.t list
val set_source : t -> node -> t
val set_target : t -> node -> t
val set_label : t -> string -> t
val set_fill : t -> string -> t
val set_line : t -> Point.t list -> t
val make : source:node -> target:node -> ?label:string -> ?fill:string -> ?line:(Point.t list) -> unit -> t
val print : t -> Graph.Gml.value_list
val parse : Graph.Gml.value_list -> t
end
module Edge : E with type node = Node.t
module IEdge : E with type node = INode.t
(** graphs containing all the usefull GML information *)
module Persistent :
sig
module G : Graph.Sig.P
val node : G.V.t -> Node.t
val edge : G.E.t -> Edge.t
(** print the graph in the gml file format *)
val print : Format.formatter -> G.t -> unit
(** parse a graph in the gml file format *)
val parse : string -> G.t
(** parse a graph in the dot file format *)
val parse_dot : string -> G.t
end
module Imperative :
sig
module G : Graph.Sig.I
val node : G.V.t -> INode.t
val edge : G.E.t -> IEdge.t
val of_node : INode.t -> G.V.t
val of_edge : IEdge.t -> G.E.t
(** print the graph in the gml file format *)
val print : Format.formatter -> G.t -> unit
(** parse a graph in the gml file format *)
val parse : string -> G.t
(** parse a graph in the dot file format *)
val parse_dot : string -> G.t
(** copy the first graph in the second one *)
val copy : G.t -> G.t -> unit
end
module GmlArena :
sig
module A : Arena.S
with
type M.Player.t = int
and
type M.Action.t = string
and
type G.V.t = Node.t
and
type G.V.label = Node.t
(** print the arena in the gml file format *)
val print : Format.formatter -> A.G.t -> unit
(** parse an arena in the gml file format *)
val parse : string -> A.G.t
(** parse an arena in the dot file format *)
val parse_dot : string -> A.G.t
end
module GmlGame :
sig
include Game.BUCHI_DEFINABLE
val reach : (A.G.V.t -> int) -> objective
val buchi : (A.G.V.t -> int) -> objective
val safety : Arena.Util(A).StateSet.t -> objective
val automaton : Auto.t -> objective
end
with
module A = GmlArena.A
and type Auto.States.elt = int
and type Auto.Alphabet.elt = GmlArena.A.G.V.t