Commit 37a91e70 authored by bguillaum's avatar bguillaum

trailing whitespaces

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@7422 7838e531-6607-4d57-9587-6c381814729c
parent c1144628
...@@ -87,8 +87,8 @@ module P_graph = struct ...@@ -87,8 +87,8 @@ module P_graph = struct
let table = Array.of_list sorted_ids in let table = Array.of_list sorted_ids in
(* the nodes, in the same order *) (* the nodes, in the same order *)
let map_without_edges = List_.foldi_left let map_without_edges = List_.foldi_left
(fun i acc elt -> Pid_map.add (Pid.Pos i) elt acc) (fun i acc elt -> Pid_map.add (Pid.Pos i) elt acc)
Pid_map.empty node_list in Pid_map.empty node_list in
let (map : t) = let (map : t) =
...@@ -153,7 +153,7 @@ module P_graph = struct ...@@ -153,7 +153,7 @@ module P_graph = struct
| None -> Pid.Neg (Id.build ~loc ast_edge.Ast.src new_table) in | None -> Pid.Neg (Id.build ~loc ast_edge.Ast.src new_table) in
let i2 = let i2 =
match Id.build_opt ast_edge.Ast.tar old_table with match Id.build_opt ast_edge.Ast.tar old_table with
| Some i -> Pid.Pos i | Some i -> Pid.Pos i
| None -> Pid.Neg (Id.build ~loc ast_edge.Ast.tar new_table) in | None -> Pid.Neg (Id.build ~loc ast_edge.Ast.tar new_table) in
let edge = P_edge.build ~locals (ast_edge, loc) in let edge = P_edge.build ~locals (ast_edge, loc) in
match map_add_edge acc i1 edge i2 with match map_add_edge acc i1 edge i2 with
......
...@@ -41,16 +41,16 @@ module P_graph: sig ...@@ -41,16 +41,16 @@ module P_graph: sig
val build: val build:
?pat_vars: string list -> ?pat_vars: string list ->
?locals: Label.decl array -> ?locals: Label.decl array ->
Ast.node list -> Ast.node list ->
Ast.edge list -> Ast.edge list ->
(t * Id.table * (Pid.t * P_fs.t) list ) (t * Id.table * (Pid.t * P_fs.t) list )
val build_extension: val build_extension:
?locals: Label.decl array -> ?locals: Label.decl array ->
Id.table -> Id.table ->
Ast.node list -> Ast.node list ->
Ast.edge list -> Ast.edge list ->
(extension * Id.table) (extension * Id.table)
val roots: t -> Pid.t list val roots: t -> Pid.t list
...@@ -72,9 +72,9 @@ module G_graph: sig ...@@ -72,9 +72,9 @@ module G_graph: sig
val find: Gid.t -> t -> G_node.t val find: Gid.t -> t -> G_node.t
val build: val build:
?locals: Label.decl array -> ?locals: Label.decl array ->
Ast.node list -> Ast.node list ->
Ast.edge list -> Ast.edge list ->
t t
val of_conll: ?loc:Loc.t -> Conll.line list -> t val of_conll: ?loc:Loc.t -> Conll.line list -> t
...@@ -93,14 +93,14 @@ module G_graph: sig ...@@ -93,14 +93,14 @@ module G_graph: sig
val del_edge : ?edge_ident: string -> Loc.t -> t -> Gid.t -> G_edge.t -> Gid.t -> t val del_edge : ?edge_ident: string -> Loc.t -> t -> Gid.t -> G_edge.t -> Gid.t -> t
val del_node : t -> Gid.t -> t val del_node : t -> Gid.t -> t
val add_neighbour : Loc.t -> t -> Gid.t -> G_edge.t -> (Gid.t * t) val add_neighbour : Loc.t -> t -> Gid.t -> G_edge.t -> (Gid.t * t)
val merge_node : Loc.t -> t -> Gid.t -> Gid.t -> t option val merge_node : Loc.t -> t -> Gid.t -> Gid.t -> t option
val shift_in : Loc.t -> t -> Gid.t -> Gid.t -> t val shift_in : Loc.t -> t -> Gid.t -> Gid.t -> t
val shift_out : Loc.t -> t -> Gid.t -> Gid.t -> t val shift_out : Loc.t -> t -> Gid.t -> Gid.t -> t
val shift_edges : Loc.t -> t -> Gid.t -> Gid.t -> t val shift_edges : Loc.t -> t -> Gid.t -> Gid.t -> t
(** [update_feat tar_id tar_feat_name concat_items] sets the feature of the node [tar_id] (** [update_feat tar_id tar_feat_name concat_items] sets the feature of the node [tar_id]
with feature name [tar_feat_name] to be the contatenation of values described by the [concat_items]. with feature name [tar_feat_name] to be the contatenation of values described by the [concat_items].
It returns both the new graph and the new feature value produced as the second element *) It returns both the new graph and the new feature value produced as the second element *)
val update_feat: ?loc:Loc.t -> t -> Gid.t -> string -> concat_item list -> (t * string) val update_feat: ?loc:Loc.t -> t -> Gid.t -> string -> concat_item list -> (t * string)
......
...@@ -20,13 +20,13 @@ module G_node = struct ...@@ -20,13 +20,13 @@ module G_node = struct
let empty = { fs = G_fs.empty; pos = None; next = Massoc_gid.empty } let empty = { fs = G_fs.empty; pos = None; next = Massoc_gid.empty }
let to_string t = let to_string t =
Printf.sprintf " fs=[%s]\n next=%s\n" Printf.sprintf " fs=[%s]\n next=%s\n"
(G_fs.to_string t.fs) (G_fs.to_string t.fs)
(Massoc_gid.to_string G_edge.to_string t.next) (Massoc_gid.to_string G_edge.to_string t.next)
let to_gr t = let to_gr t =
sprintf "%s [%s] " sprintf "%s [%s] "
(match t.pos with Some i -> sprintf "(%d)" i | None -> "") (match t.pos with Some i -> sprintf "(%d)" i | None -> "")
(G_fs.to_gr t.fs) (G_fs.to_gr t.fs)
...@@ -36,7 +36,7 @@ module G_node = struct ...@@ -36,7 +36,7 @@ module G_node = struct
| None -> None | None -> None
let build (ast_node, loc) = let build (ast_node, loc) =
(ast_node.Ast.node_id, (ast_node.Ast.node_id,
{ fs = G_fs.build ast_node.Ast.fs; { fs = G_fs.build ast_node.Ast.fs;
pos = ast_node.Ast.position; pos = ast_node.Ast.position;
next = Massoc_gid.empty; next = Massoc_gid.empty;
...@@ -47,18 +47,17 @@ module G_node = struct ...@@ -47,18 +47,17 @@ module G_node = struct
pos = Some line.Conll.num; pos = Some line.Conll.num;
next = Massoc_gid.empty; next = Massoc_gid.empty;
} }
let remove (id_tar : Gid.t) label t = {t with next = Massoc_gid.remove id_tar label t.next} let remove (id_tar : Gid.t) label t = {t with next = Massoc_gid.remove id_tar label t.next}
let remove_key node_id t = let remove_key node_id t =
try {t with next = Massoc_gid.remove_key node_id t.next} with Not_found -> t try {t with next = Massoc_gid.remove_key node_id t.next} with Not_found -> t
let merge_key ?(strict=false) src_id tar_id t = let merge_key ?(strict=false) src_id tar_id t =
try Some {t with next = Massoc_gid.merge_key src_id tar_id t.next} try Some {t with next = Massoc_gid.merge_key src_id tar_id t.next}
with Massoc_gid.Duplicate -> if strict then None else Some t with Massoc_gid.Duplicate -> if strict then None else Some t
let shift_out ?(strict=false) src_t tar_t = let shift_out ?(strict=false) src_t tar_t =
try Some {tar_t with next = Massoc_gid.disjoint_union src_t.next tar_t.next} try Some {tar_t with next = Massoc_gid.disjoint_union src_t.next tar_t.next}
with Massoc_gid.Not_disjoint -> if strict then None else Some tar_t with Massoc_gid.Not_disjoint -> if strict then None else Some tar_t
...@@ -87,10 +86,10 @@ module P_node = struct ...@@ -87,10 +86,10 @@ module P_node = struct
let unif_fs fs t = { t with fs = P_fs.unif fs t.fs } let unif_fs fs t = { t with fs = P_fs.unif fs t.fs }
let empty = { fs = P_fs.empty; next = Massoc_pid.empty; name = ""; loc=None } let empty = { fs = P_fs.empty; next = Massoc_pid.empty; name = ""; loc=None }
let build ?pat_vars (ast_node, loc) = let build ?pat_vars (ast_node, loc) =
(ast_node.Ast.node_id, (ast_node.Ast.node_id,
{ {
name = ast_node.Ast.node_id; name = ast_node.Ast.node_id;
fs = P_fs.build ?pat_vars ast_node.Ast.fs; fs = P_fs.build ?pat_vars ast_node.Ast.fs;
next = Massoc_pid.empty; next = Massoc_pid.empty;
......
...@@ -17,10 +17,10 @@ module G_node: sig ...@@ -17,10 +17,10 @@ module G_node: sig
val set_fs: t -> G_fs.t -> t val set_fs: t -> G_fs.t -> t
(* FIXME move Gid up and replace int by Gid.t *) (* FIXME move Gid up and replace int by Gid.t *)
val remove: Gid.t -> G_edge.t -> t -> t val remove: Gid.t -> G_edge.t -> t -> t
val remove_key: Gid.t -> t -> t val remove_key: Gid.t -> t -> t
val merge_key: ?strict:bool -> Gid.t -> Gid.t -> t -> t option val merge_key: ?strict:bool -> Gid.t -> Gid.t -> t -> t option
val shift_out: ?strict:bool -> t -> t -> t option val shift_out: ?strict:bool -> t -> t -> t option
......
...@@ -10,19 +10,19 @@ module Instance : sig ...@@ -10,19 +10,19 @@ module Instance : sig
graph: G_graph.t; graph: G_graph.t;
commands: Command.h list; commands: Command.h list;
rules: string list; rules: string list;
big_step: Grew_types.big_step option; big_step: Grew_types.big_step option;
} }
val empty:t val empty:t
val build: Ast.gr -> t val build: Ast.gr -> t
val of_conll: ?loc:Loc.t -> Conll.line list -> t val of_conll: ?loc:Loc.t -> Conll.line list -> t
(* rev_steps reverse the small step list: during rewriting, the last rule is in the head of the list and the reverse is needed for display *) (* rev_steps reverse the small step list: during rewriting, the last rule is in the head of the list and the reverse is needed for display *)
val rev_steps: t -> t val rev_steps: t -> t
val clear: t -> t val clear: t -> t
val from_graph: G_graph.t -> t val from_graph: G_graph.t -> t
val get_graph: t -> G_graph.t val get_graph: t -> G_graph.t
...@@ -60,7 +60,7 @@ module Rule : sig ...@@ -60,7 +60,7 @@ module Rule : sig
(* raise Stop if some command fails to apply *) (* raise Stop if some command fails to apply *)
val normalize: val normalize:
string -> (* module name *) string -> (* module name *)
?confluent:bool -> ?confluent:bool ->
t list -> (* rule list *) t list -> (* rule list *)
t list -> (* filter list *) t list -> (* filter list *)
Instance.t -> Instance.t ->
......
This diff is collapsed.
...@@ -11,7 +11,7 @@ val png_file_from_dot: string -> string -> unit ...@@ -11,7 +11,7 @@ val png_file_from_dot: string -> string -> unit
(* ================================================================================ *) (* ================================================================================ *)
(* [Loc] general module to describe errors location: (file name, line number in file) *) (* [Loc] general module to describe errors location: (file name, line number in file) *)
module Loc: sig module Loc: sig
type t = string * int type t = string * int
val opt_set_line: int -> t option -> t option val opt_set_line: int -> t option -> t option
...@@ -25,7 +25,7 @@ module File: sig ...@@ -25,7 +25,7 @@ module File: sig
(** [write data file_name] write [data] in file named [file_name] *) (** [write data file_name] write [data] in file named [file_name] *)
val write: string -> string -> unit val write: string -> string -> unit
(** [read file_name] read the content of [file_name] line by line. (** [read file_name] read the content of [file_name] line by line.
Blanks lines (empty or only with spaces and tabs) are ignored. Blanks lines (empty or only with spaces and tabs) are ignored.
Lines with '%' as the first char are ignored. *) Lines with '%' as the first char are ignored. *)
val read: string -> string list val read: string -> string list
...@@ -55,7 +55,7 @@ module Pid_set : Set.S with type elt = Pid.t ...@@ -55,7 +55,7 @@ module Pid_set : Set.S with type elt = Pid.t
(* ================================================================================ *) (* ================================================================================ *)
(* [Gid] describes identifier used in full graphs *) (* [Gid] describes identifier used in full graphs *)
module Gid : sig module Gid : sig
type t = type t =
| Old of int | Old of int
| New of int * int (* identifier for "created nodes" *) | New of int * int (* identifier for "created nodes" *)
...@@ -64,7 +64,7 @@ end ...@@ -64,7 +64,7 @@ end
(* ================================================================================ *) (* ================================================================================ *)
(* [Gid_map] is the map used in full graphs *) (* [Gid_map] is the map used in full graphs *)
module Gid_map : Map.S with type key = Gid.t module Gid_map : Map.S with type key = Gid.t
(* ================================================================================ *) (* ================================================================================ *)
...@@ -91,14 +91,14 @@ module List_: sig ...@@ -91,14 +91,14 @@ module List_: sig
(** [rm elt list] removes the first occurence of [elt] in [list]. [Not_found] can be raised. *) (** [rm elt list] removes the first occurence of [elt] in [list]. [Not_found] can be raised. *)
val rm: 'a -> 'a list -> 'a list val rm: 'a -> 'a list -> 'a list
val opt: 'a option list -> 'a list val opt: 'a option list -> 'a list
(** [pos elt list] return [Some index] if [index] is the smallest position in the [list] equals to [elt]. None is returned if [elt] is not in the [list] *) (** [pos elt list] return [Some index] if [index] is the smallest position in the [list] equals to [elt]. None is returned if [elt] is not in the [list] *)
val pos: 'a -> 'a list -> int option val pos: 'a -> 'a list -> int option
val opt_map: ('a -> 'b option) -> 'a list -> 'b list val opt_map: ('a -> 'b option) -> 'a list -> 'b list
val flat_map: ('a -> 'b list) -> 'a list -> 'b list val flat_map: ('a -> 'b list) -> 'a list -> 'b list
(* remove [elt] from [list]. raise Not_found if [elt] is not in [list] *) (* remove [elt] from [list]. raise Not_found if [elt] is not in [list] *)
val remove: 'a -> 'a list -> 'a list val remove: 'a -> 'a list -> 'a list
val foldi_left: (int -> 'a -> 'b -> 'a) -> 'a -> 'b list -> 'a val foldi_left: (int -> 'a -> 'b -> 'a) -> 'a -> 'b list -> 'a
...@@ -130,7 +130,7 @@ module List_: sig ...@@ -130,7 +130,7 @@ module List_: sig
val sort_assoc: 'a -> ('a * 'b) list -> 'b option val sort_assoc: 'a -> ('a * 'b) list -> 'b option
(* [sort_remove_assoc k ass_list] returns the input list without the [key] element, (* [sort_remove_assoc k ass_list] returns the input list without the [key] element,
if [key] not found, the unchanged input list is returned *) if [key] not found, the unchanged input list is returned *)
val sort_remove_assoc: 'a -> ('a * 'b) list -> ('a * 'b) list val sort_remove_assoc: 'a -> ('a * 'b) list -> ('a * 'b) list
...@@ -156,12 +156,12 @@ module type OrderedType = ...@@ -156,12 +156,12 @@ module type OrderedType =
module type S = module type S =
sig sig
type key type key
type +'a t type +'a t
val empty: 'a t val empty: 'a t
(* an empty list returned if the key is undefined *) (* an empty list returned if the key is undefined *)
val assoc: key -> 'a t -> 'a list val assoc: key -> 'a t -> 'a list
val is_empty: 'a t -> bool val is_empty: 'a t -> bool
...@@ -187,7 +187,7 @@ module type S = ...@@ -187,7 +187,7 @@ module type S =
val mem_key: key -> 'a t -> bool val mem_key: key -> 'a t -> bool
exception Not_disjoint exception Not_disjoint
val disjoint_union: 'a t -> 'a t -> 'a t val disjoint_union: 'a t -> 'a t -> 'a t
exception Duplicate exception Duplicate
val merge_key: key -> key -> 'a t -> 'a t val merge_key: key -> key -> 'a t -> 'a t
...@@ -206,7 +206,7 @@ module Massoc: sig ...@@ -206,7 +206,7 @@ module Massoc: sig
val empty: 'a t val empty: 'a t
(* an empty list returned if the key is undefined *) (* an empty list returned if the key is undefined *)
val assoc: int -> 'a t -> 'a list val assoc: int -> 'a t -> 'a list
val is_empty: 'a t -> bool val is_empty: 'a t -> bool
...@@ -232,14 +232,14 @@ module Massoc: sig ...@@ -232,14 +232,14 @@ module Massoc: sig
val mem_key: int -> 'a t -> bool val mem_key: int -> 'a t -> bool
exception Not_disjoint exception Not_disjoint
val disjoint_union: 'a t -> 'a t -> 'a t val disjoint_union: 'a t -> 'a t -> 'a t
exception Duplicate exception Duplicate
val merge_key: int -> int -> 'a t -> 'a t val merge_key: int -> int -> 'a t -> 'a t
val exists: (int -> 'a -> bool) -> 'a t -> bool val exists: (int -> 'a -> bool) -> 'a t -> bool
end end
module Massoc_gid : S with type key = Gid.t module Massoc_gid : S with type key = Gid.t
module Massoc_pid : S with type key = Pid.t module Massoc_pid : S with type key = Pid.t
...@@ -267,7 +267,7 @@ module Id: sig ...@@ -267,7 +267,7 @@ module Id: sig
(* [Stop] is raised if [string] is not in [table] *) (* [Stop] is raised if [string] is not in [table] *)
val build: ?loc:Loc.t -> name -> table -> t val build: ?loc:Loc.t -> name -> table -> t
val build_opt: name -> table -> t option val build_opt: name -> table -> t option
end end
module Html: sig module Html: sig
...@@ -287,7 +287,7 @@ module Conll: sig ...@@ -287,7 +287,7 @@ module Conll: sig
gov: int; gov: int;
dep_lab: string; dep_lab: string;
} }
val load: string -> line list val load: string -> line list
end end
...@@ -295,7 +295,7 @@ end ...@@ -295,7 +295,7 @@ end
module Lex_par: sig module Lex_par: sig
type t type t
val empty:t val empty:t
val append: t -> t -> t val append: t -> t -> t
(** [from_lines filename nb_pattern_var nb_command_var strings] *) (** [from_lines filename nb_pattern_var nb_command_var strings] *)
...@@ -304,7 +304,7 @@ module Lex_par: sig ...@@ -304,7 +304,7 @@ module Lex_par: sig
(** [load ?loc local_dir_name nb_pattern_var nb_command_var file] *) (** [load ?loc local_dir_name nb_pattern_var nb_command_var file] *)
val load: ?loc: Loc.t -> string -> int -> int -> string -> t val load: ?loc: Loc.t -> string -> int -> int -> string -> t
(** [filter index atom t] returns the subset of [t] which contains only entries (** [filter index atom t] returns the subset of [t] which contains only entries
which refers to [atom] at the [index]^th pattern_var. which refers to [atom] at the [index]^th pattern_var.
[None] is returnes if no such entry s founded. [None] is returnes if no such entry s founded.
*) *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment