Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
verimag
synchrone
sasa
Commits
873ce7c1
Commit
873ce7c1
authored
4 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
test: Add some comments in ml file
parent
60dd15a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/dijkstra-ring/config.ml
+8
-2
8 additions, 2 deletions
test/dijkstra-ring/config.ml
with
8 additions
and
2 deletions
test/dijkstra-ring/config.ml
+
8
−
2
View file @
873ce7c1
open
Algo
open
State
let
potential
=
None
let
fault
=
None
(* For the Dijkstra ring, a configuration is legitimate iff there is
exactly one token.
nb: there are as many tokens as enabled nodes. So let's count enable nodes!
*)
let
(
legitimate
:
pid
list
->
(
pid
->
t
*
(
t
neighbor
*
pid
)
list
)
->
bool
)
=
fun
pidl
get
->
(*
only one node
is enabled *)
(*
increment the token number i if pid
is enabled *)
let
incr_token
i
pid
=
let
s
,
nl
=
get
pid
in
let
nl
=
List
.
map
fst
nl
in
let
have_token
=
(
if
s
.
root
then
Root
.
enable_f
s
nl
else
P
.
enable_f
s
nl
)
<>
[]
in
if
have_token
then
i
+
1
else
i
in
(* Now let's iterate on all the nodes starting from |tokens|=0 *)
let
token_nb
=
List
.
fold_left
incr_token
0
pidl
in
(* if there is 1 token, returns true *)
token_nb
=
1
let
legitimate
=
Some
legitimate
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