Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
menhir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
POTTIER Francois
menhir
Commits
ff8c47d7
Commit
ff8c47d7
authored
10 years ago
by
POTTIER Francois
Browse files
Options
Downloads
Patches
Plain Diff
Modified [E] to use [MySet] instead of [MyMap].
No speed gain, but this allows removing [MyMap].
parent
9fdf7eef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/LRijkstra.ml
+7
-19
7 additions, 19 deletions
src/LRijkstra.ml
with
7 additions
and
19 deletions
src/LRijkstra.ml
+
7
−
19
View file @
ff8c47d7
...
@@ -88,7 +88,6 @@ let foreach_terminal_not_causing_an_error s f =
...
@@ -88,7 +88,6 @@ let foreach_terminal_not_causing_an_error s f =
(* ------------------------------------------------------------------------ *)
(* ------------------------------------------------------------------------ *)
let
id
x
=
x
let
id
x
=
x
let
some
x
=
Some
x
let
update
add
find
none
some
key
m
f
=
let
update
add
find
none
some
key
m
f
=
match
find
key
m
with
match
find
key
m
with
...
@@ -102,12 +101,6 @@ let update add find none some key m f =
...
@@ -102,12 +101,6 @@ let update add find none some key m f =
let
data'
=
f
none
in
let
data'
=
f
none
in
add
key
data'
m
add
key
data'
m
module
MyMap
(
X
:
Map
.
OrderedType
)
=
struct
include
Map
.
Make
(
X
)
let
update
none
some
key
m
f
=
update
add
find
none
some
key
m
f
end
module
W
:
sig
module
W
:
sig
type
word
type
word
...
@@ -375,9 +368,9 @@ end = struct
...
@@ -375,9 +368,9 @@ end = struct
(* For now, we implement a mapping of [s, nt, a, z] to [w]. *)
(* For now, we implement a mapping of [s, nt, a, z] to [w]. *)
module
M
=
module
M
=
My
Map
(
struct
My
Set
.
Make
(
struct
type
t
=
Nonterminal
.
t
*
Terminal
.
t
*
Terminal
.
t
type
t
=
Nonterminal
.
t
*
Terminal
.
t
*
Terminal
.
t
*
W
.
word
let
compare
(
nt1
,
a1
,
z1
)
(
nt2
,
a2
,
z2
)
=
let
compare
(
nt1
,
a1
,
z1
,
_w1
)
(
nt2
,
a2
,
z2
,
_w2
)
=
let
c
=
Nonterminal
.
compare
nt1
nt2
in
let
c
=
Nonterminal
.
compare
nt1
nt2
in
if
c
<>
0
then
c
else
if
c
<>
0
then
c
else
let
c
=
Terminal
.
compare
a1
a2
in
let
c
=
Terminal
.
compare
a1
a2
in
...
@@ -394,13 +387,7 @@ end = struct
...
@@ -394,13 +387,7 @@ end = struct
let
i
=
Lr1
.
number
s
in
let
i
=
Lr1
.
number
s
in
let
m
=
table
.
(
i
)
in
let
m
=
table
.
(
i
)
in
let
a
=
W
.
first
w
z
in
let
a
=
W
.
first
w
z
in
let
m'
=
M
.
update
None
some
(
nt
,
a
,
z
)
m
(
function
let
m'
=
M
.
add
(
nt
,
a
,
z
,
w
)
m
in
|
None
->
w
|
Some
earlier_w
->
earlier_w
)
in
m
!=
m'
&&
begin
m
!=
m'
&&
begin
incr
count
;
incr
count
;
table
.
(
i
)
<-
m'
;
table
.
(
i
)
<-
m'
;
...
@@ -410,8 +397,9 @@ end = struct
...
@@ -410,8 +397,9 @@ end = struct
let
query
s
nt
a
z
f
=
let
query
s
nt
a
z
f
=
let
i
=
Lr1
.
number
s
in
let
i
=
Lr1
.
number
s
in
let
m
=
table
.
(
i
)
in
let
m
=
table
.
(
i
)
in
match
M
.
find
(
nt
,
a
,
z
)
m
with
let
dummy
=
W
.
epsilon
in
|
w
->
f
w
match
M
.
find
(
nt
,
a
,
z
,
dummy
)
m
with
|
(
_
,
_
,
_
,
w
)
->
f
w
|
exception
Not_found
->
()
|
exception
Not_found
->
()
let
stats
()
=
let
stats
()
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment