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
F
fix
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
POTTIER Francois
fix
Commits
ecbab0ba
Commit
ecbab0ba
authored
Nov 29, 2018
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more local modules.
parent
96b7dc56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
demos/brz/Brzozowski.ml
demos/brz/Brzozowski.ml
+4
-7
No files found.
demos/brz/Brzozowski.ml
View file @
ecbab0ba
...
...
@@ -270,10 +270,8 @@ let neg (e : regexp) : regexp =
(* We memoize this function. (This is optional.) *)
module
M
=
Memoize
.
ForHashedType
(
R
)
let
nullable
:
regexp
->
bool
=
let
module
M
=
Memoize
.
ForHashedType
(
R
)
in
M
.
fix
(
fun
nullable
e
->
match
skeleton
e
with
|
EChar
_
->
...
...
@@ -303,12 +301,10 @@ let nullable : regexp -> bool =
star.) More precisely, for every character [a], [delta a] is a function of
type [regexp -> regexp]: we memoize every function [delta a] separately. *)
(* A tabulator for functions of type [char -> _] is used for this purpose. *)
module
T
=
Tabulate
.
ForHashedType
(
Char
)(
Char
)
let
delta
:
Char
.
t
->
regexp
->
regexp
=
let
module
T
=
Tabulate
.
ForHashedType
(
Char
)(
Char
)
in
let
module
M
=
Memoize
.
ForHashedType
(
R
)
in
T
.
tabulate
(
fun
a
->
M
.
fix
(
fun
delta
e
->
match
skeleton
e
with
...
...
@@ -430,6 +426,7 @@ let dfa (e : regexp) : dfa =
(* There remains to tabulate the transition function. *)
let
transition
=
let
module
Q
=
Tabulate
.
ForIntSegment
(
N
)
in
let
module
T
=
Tabulate
.
ForHashedType
(
Char
)(
Char
)
in
Q
.
tabulate
(
fun
q
->
T
.
tabulate
(
fun
a
->
encode
(
delta
a
(
decode
q
))
))
...
...
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