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
abaa00b1
Commit
abaa00b1
authored
2 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
test: change the state scan/parse conventions so that it is compatible
with the dot output of --global-init-search
parent
e5a41b8a
No related branches found
No related tags found
No related merge requests found
Pipeline
#137911
failed
1 year ago
Stage: build
Stage: release
Stage: deploy
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/k-clustering/fig52_kcl.dot
+9
-10
9 additions, 10 deletions
test/k-clustering/fig52_kcl.dot
test/k-clustering/p.ml
+9
-9
9 additions, 9 deletions
test/k-clustering/p.ml
test/k-clustering/state.ml
+6
-10
6 additions, 10 deletions
test/k-clustering/state.ml
with
24 additions
and
29 deletions
test/k-clustering/fig52_kcl.dot
+
9
−
10
View file @
abaa00b1
graph
fig52
{
graph
fig52
{
Root
[
algo
=
"p.ml"
init
=
"{is_root=1 ; alpha=0; par=-1}"
]
p2
[
algo
=
"p.ml"
init
=
"{is_root=0 ; alpha=0; par=0}"
]
p3
[
algo
=
"p.ml"
init
=
"{is_root=0 ; alpha=0; par=0}"
]
p4
[
algo
=
"p.ml"
init
=
"{is_root=0 ; alpha=0; par=0}"
]
p5
[
algo
=
"p.ml"
init
=
"{is_root=0 ; alpha=0; par=0}"
]
p6
[
algo
=
"p.ml"
init
=
"{is_root=0 ; alpha=0; par=0}"
]
p7
[
algo
=
"p.ml"
init
=
"{is_root=0 ; alpha=0; par=0}"
]
Root
--
p2
--
p3
--
p4
--
p5
--
p6
Root
[
algo
=
"p.ml"
init
=
"isRoot=true alpha=0 par=-1"
]
p2
[
algo
=
"p.ml"
init
=
"isRoot=false alpha=0 par=0"
]
p3
[
algo
=
"p.ml"
init
=
"isRoot=false alpha=0 par=0"
]
p4
[
algo
=
"p.ml"
init
=
"isRoot=false alpha=0 par=0"
]
p5
[
algo
=
"p.ml"
init
=
"isRoot=false alpha=0 par=0"
]
p6
[
algo
=
"p.ml"
init
=
"isRoot=false alpha=0 par=0"
]
p7
[
algo
=
"p.ml"
init
=
"isRoot=false alpha=0 par=0"
]
Root
--
p2
--
p3
--
p4
--
p5
--
p6
p5
--
p7
p5
--
p7
}
}
This diff is collapsed.
Click to expand it.
test/k-clustering/p.ml
+
9
−
9
View file @
abaa00b1
(*
(*
Algorithm 1 of:
Algorithm 1 of:
A Framework for Certified Self-Stabilization
A Framework for Certified Self-Stabilization
Case Study: Silent Self-Stabilizing k-Dominating Set on a Tree
Case Study: Silent Self-Stabilizing k-Dominating Set on a Tree
https://hal.archives-ouvertes.fr/hal-01272158/document
https://hal.archives-ouvertes.fr/hal-01272158/document
...
@@ -15,12 +15,12 @@ Encoded by Hugo Hannot
...
@@ -15,12 +15,12 @@ Encoded by Hugo Hannot
open
Algo
open
Algo
open
State
open
State
type
s
=
State
.
t
type
s
=
State
.
t
type
sl
=
s
list
type
sl
=
s
list
type
n
=
State
.
t
neighbor
type
n
=
State
.
t
neighbor
type
nl
=
n
list
type
nl
=
n
list
let
isRoot
p
=
(
state
p
)
.
isRoot
let
isRoot
p
=
(
state
p
)
.
isRoot
let
(
isShort
:
n
->
bool
)
=
let
(
isShort
:
n
->
bool
)
=
...
@@ -30,13 +30,13 @@ let (isTall: n -> bool) =
...
@@ -30,13 +30,13 @@ let (isTall: n -> bool) =
fun
p
->
(
state
p
)
.
alpha
>=
k
fun
p
->
(
state
p
)
.
alpha
>=
k
(* Actually unused *)
(* Actually unused *)
let
(
_kDominator
:
'
v
->
bool
)
=
let
(
_kDominator
:
'
v
->
bool
)
=
fun
p
->
((
state
p
)
.
alpha
=
k
)
||
((
isShort
p
)
&&
(
isRoot
p
))
fun
p
->
((
state
p
)
.
alpha
=
k
)
||
((
isShort
p
)
&&
(
isRoot
p
))
let
(
children
:
s
->
nl
->
nl
)
=
let
(
children
:
s
->
nl
->
nl
)
=
fun
_p
nl
->
fun
_p
nl
->
List
.
filter
(
fun
q
->
(
state
q
)
.
par
=
reply
q
)
nl
List
.
filter
(
fun
q
->
(
state
q
)
.
par
=
reply
q
)
nl
let
(
shortChildren
:
s
->
nl
->
nl
)
=
let
(
shortChildren
:
s
->
nl
->
nl
)
=
fun
p
nl
->
fun
p
nl
->
List
.
filter
isShort
(
children
p
nl
)
List
.
filter
isShort
(
children
p
nl
)
...
@@ -60,7 +60,7 @@ let rec (min: nl -> int -> int) =
...
@@ -60,7 +60,7 @@ let rec (min: nl -> int -> int) =
|
n
::
tail
->
|
n
::
tail
->
let
s
=
state
n
in
let
s
=
state
n
in
if
(
s
.
alpha
)
<
cur
then
min
tail
(
s
.
alpha
)
else
min
tail
cur
if
(
s
.
alpha
)
<
cur
then
min
tail
(
s
.
alpha
)
else
min
tail
cur
let
(
maxAShort
:
s
->
nl
->
int
)
=
let
(
maxAShort
:
s
->
nl
->
int
)
=
fun
p
nl
->
max
(
shortChildren
p
nl
)
(
-
1
)
fun
p
nl
->
max
(
shortChildren
p
nl
)
(
-
1
)
...
@@ -83,8 +83,8 @@ let (init_state: int -> string -> s) =
...
@@ -83,8 +83,8 @@ let (init_state: int -> string -> s) =
isRoot
=
pid
=
"Root"
;
(* ZZZ: The root of the tree should be named "Root"! *)
isRoot
=
pid
=
"Root"
;
(* ZZZ: The root of the tree should be named "Root"! *)
alpha
=
Random
.
int
(
2
*
k
+
1
);
alpha
=
Random
.
int
(
2
*
k
+
1
);
par
=
if
pid
=
"Root"
then
-
1
else
0
(* the input tree should be sorted alphabetically (wrt a bf traversal) *)
par
=
if
pid
=
"Root"
then
-
1
else
0
(* the input tree should be sorted alphabetically (wrt a bf traversal) *)
}
}
let
(
enable_f
:
s
->
nl
->
action
list
)
=
let
(
enable_f
:
s
->
nl
->
action
list
)
=
fun
p
nl
->
if
(
p
.
alpha
<>
(
newAlpha
p
nl
))
then
[
"change_alpha"
]
else
[]
fun
p
nl
->
if
(
p
.
alpha
<>
(
newAlpha
p
nl
))
then
[
"change_alpha"
]
else
[]
...
...
This diff is collapsed.
Click to expand it.
test/k-clustering/state.ml
+
6
−
10
View file @
abaa00b1
(* Time-stamp: <
2022-07-12 11:01:25 emile
> *)
(* Time-stamp: <
modified the 12/02/2023 (at 22:18) by Erwan Jahier
> *)
open
Algo
open
Algo
let
d
=
max_degree
()
let
d
=
max_degree
()
type
t
=
{
type
t
=
{
isRoot
:
bool
;
isRoot
:
bool
;
...
@@ -10,20 +10,16 @@ type t = {
...
@@ -10,20 +10,16 @@ type t = {
par
:
int
par
:
int
}
}
(*let boolVint (b:bool):int =
if b then 1 else 0*)
let
(
to_string
:
(
t
->
string
))
=
let
(
to_string
:
(
t
->
string
))
=
fun
s
->
fun
s
->
Printf
.
sprintf
"isRoot=%b alpha=%d par=%d"
s
.
isRoot
s
.
alpha
s
.
par
Printf
.
sprintf
"isRoot=%b alpha=%d par=%d"
s
.
isRoot
s
.
alpha
s
.
par
let
(
of_string
:
(
string
->
t
)
option
)
=
let
(
of_string
:
(
string
->
t
)
option
)
=
Some
(
fun
s
->
Some
(
fun
s
->
Scanf
.
sscanf
s
"
{
is
_r
oot=%
d ;
alpha=%d
;
par=%d
}
"
Scanf
.
sscanf
s
"is
R
oot=%
B
alpha=%d par=%d"
(
fun
i
alpha
p
->
{
isRoot
=
(
i
=
1
)
;
alpha
=
alpha
;
par
=
p
}))
(
fun
b
alpha
p
->
{
isRoot
=
b
;
alpha
=
alpha
;
par
=
p
}))
let
(
copy
:
(
'
v
->
'
v
))
=
fun
x
->
x
let
(
copy
:
(
'
v
->
'
v
))
=
fun
x
->
x
let
actions
=
[
"change_alpha"
]
let
actions
=
[
"change_alpha"
]
let
k
=
2
let
k
=
2
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