Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcaml-grew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
grew
libcaml-grew
Commits
ca3d349c
Commit
ca3d349c
authored
Aug 08, 2018
by
Bruno Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean unused code (step 4)
parent
a3e8999b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
569 deletions
+2
-569
src/grew_command.ml
src/grew_command.ml
+0
-19
src/grew_command.mli
src/grew_command.mli
+0
-16
src/grew_grs.ml
src/grew_grs.ml
+2
-2
src/grew_rule.ml
src/grew_rule.ml
+0
-483
src/grew_rule.mli
src/grew_rule.mli
+0
-49
No files found.
src/grew_command.ml
View file @
ca3d349c
...
...
@@ -153,25 +153,6 @@ module Command = struct
]
)]
(* a item in the command history: command applied to a graph *)
type
h
=
|
H_DEL_NODE
of
Gid
.
t
|
H_DEL_EDGE_EXPL
of
(
Gid
.
t
*
Gid
.
t
*
G_edge
.
t
)
|
H_DEL_EDGE_NAME
of
string
|
H_ADD_EDGE
of
(
Gid
.
t
*
Gid
.
t
*
G_edge
.
t
)
|
H_ADD_EDGE_EXPL
of
(
Gid
.
t
*
Gid
.
t
*
string
)
|
H_DEL_FEAT
of
(
Gid
.
t
*
string
)
|
H_UPDATE_FEAT
of
(
Gid
.
t
*
string
*
string
)
|
H_NEW_NODE
of
string
|
H_NEW_BEFORE
of
(
string
*
Gid
.
t
)
|
H_NEW_AFTER
of
(
string
*
Gid
.
t
)
|
H_SHIFT_EDGE
of
(
Gid
.
t
*
Gid
.
t
)
|
H_SHIFT_IN
of
(
Gid
.
t
*
Gid
.
t
)
|
H_SHIFT_OUT
of
(
Gid
.
t
*
Gid
.
t
)
let
build
?
domain
?
param
lexicons
(
kni
,
kei
)
table
ast_command
=
(* kni stands for "known node idents", kei for "known edge idents" *)
...
...
src/grew_command.mli
View file @
ca3d349c
...
...
@@ -46,22 +46,6 @@ module Command : sig
type
t
=
(
p
*
Loc
.
t
)
val
to_json
:
?
domain
:
Domain
.
t
->
t
->
Yojson
.
Basic
.
json
type
h
=
|
H_DEL_NODE
of
Gid
.
t
|
H_DEL_EDGE_EXPL
of
(
Gid
.
t
*
Gid
.
t
*
G_edge
.
t
)
|
H_DEL_EDGE_NAME
of
string
|
H_ADD_EDGE
of
(
Gid
.
t
*
Gid
.
t
*
G_edge
.
t
)
|
H_ADD_EDGE_EXPL
of
(
Gid
.
t
*
Gid
.
t
*
string
)
|
H_DEL_FEAT
of
(
Gid
.
t
*
string
)
|
H_UPDATE_FEAT
of
(
Gid
.
t
*
string
*
string
)
|
H_NEW_NODE
of
string
|
H_NEW_BEFORE
of
(
string
*
Gid
.
t
)
|
H_NEW_AFTER
of
(
string
*
Gid
.
t
)
|
H_SHIFT_EDGE
of
(
Gid
.
t
*
Gid
.
t
)
|
H_SHIFT_IN
of
(
Gid
.
t
*
Gid
.
t
)
|
H_SHIFT_OUT
of
(
Gid
.
t
*
Gid
.
t
)
val
build
:
?
domain
:
Domain
.
t
->
...
...
src/grew_grs.ml
View file @
ca3d349c
...
...
@@ -236,7 +236,7 @@ module Grs = struct
(* Rewriting in the deterministic case with graph type *)
(* ============================================================================================= *)
(* apply a package to an
instance
= apply only top level rules in the package *)
(* apply a package to an
graph
= apply only top level rules in the package *)
let
onf_pack_rewrite
?
domain
decl_list
graph
=
let
rec
loop
=
function
|
[]
->
None
...
...
@@ -307,7 +307,7 @@ module Grs = struct
(* Rewriting in the non-deterministic case with Graph_with_history.t type *)
(* ============================================================================================= *)
(* apply a package to an
instance
= apply only top level rules in the package *)
(* apply a package to an
graph_with_history
= apply only top level rules in the package *)
let
gwh_pack_rewrite
?
domain
decl_list
gwh
=
List
.
fold_left
(
fun
acc
decl
->
match
decl
with
...
...
src/grew_rule.ml
View file @
ca3d349c
This diff is collapsed.
Click to expand it.
src/grew_rule.mli
View file @
ca3d349c
...
...
@@ -18,40 +18,6 @@ open Grew_edge
open
Grew_fs
open
Grew_ast
(* ================================================================================ *)
module
Instance
:
sig
type
t
=
{
graph
:
G_graph
.
t
;
history
:
Command
.
h
list
;
rules
:
string
list
;
big_step
:
Libgrew_types
.
big_step
option
;
}
val
swap
:
t
->
t
(** [from_graph graph] return a fresh instance based on the input [graph]. *)
val
from_graph
:
G_graph
.
t
->
t
(** [rev_steps t] reverses 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
(** [refresh t] returns a fresh representation of the graph.
Graphs are refreshed after each module. *)
val
refresh
:
t
->
t
(** [to_gr t] returns a string which contains the "gr" code of the current graph *)
val
to_gr
:
t
->
string
(** [to_conll_string t] returns a string which contains the "conll" code of the current graph *)
val
to_conll_string
:
t
->
string
(** [save_dot_png base t] writes a file "base.png" with the dot representation of [t] *)
val
save_dot_png
:
?
filter
:
(
string
->
bool
)
->
?
main_feat
:
string
->
string
->
t
->
unit
end
(* module Instance *)
(* ================================================================================ *)
module
Instance_set
:
Set
.
S
with
type
elt
=
Instance
.
t
(* ================================================================================ *)
module
Rule
:
sig
...
...
@@ -82,18 +48,6 @@ module Rule : sig
[dir] is used for localisation of lp files *)
val
build
:
?
domain
:
Domain
.
t
->
string
->
Ast
.
rule
->
t
(** [normalize domain module_name ?deterministic rule_list instance] returns a set of normal forms *)
(* raise Stop if some command fails to apply *)
val
normalize
:
?
domain
:
Domain
.
t
->
string
->
(* module name *)
?
deterministic
:
bool
->
t
list
->
(* rule list *)
Instance
.
t
->
Instance_set
.
t
val
one_step
:
?
domain
:
Domain
.
t
->
Instance
.
t
->
t
list
->
Instance_set
.
t
val
conf_one_step
:
?
domain
:
Domain
.
t
->
Instance
.
t
->
t
list
->
Instance
.
t
option
(** the type matching encodes the graph morphism from a pattern to a graph *)
(* NB: it was made public for the grep mode *)
...
...
@@ -119,9 +73,6 @@ module Rule : sig
val
apply
:
?
domain
:
Domain
.
t
->
t
->
Instance
.
t
->
Instance_set
.
t
val
det_apply
:
?
domain
:
Domain
.
t
->
t
->
Instance
.
t
->
Instance
.
t
option
val
wrd_apply
:
?
domain
:
Domain
.
t
->
t
->
(
G_graph
.
t
*
Libgrew_types
.
big_step
option
)
->
(
G_graph
.
t
*
Libgrew_types
.
big_step
)
option
val
onf_apply
:
?
domain
:
Domain
.
t
->
t
->
G_graph
.
t
->
G_graph
.
t
option
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment