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
0a1620d6
Commit
0a1620d6
authored
3 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
play with -is on the toy-example-a5sf (something seems wrong)
parent
3b643c06
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/toy-example-a5sf/config.ml
+18
-4
18 additions, 4 deletions
test/toy-example-a5sf/config.ml
test/toy-example-a5sf/state.ml
+11
-2
11 additions, 2 deletions
test/toy-example-a5sf/state.ml
test/toy-example-a5sf/te_bug.dot
+20
-0
20 additions, 0 deletions
test/toy-example-a5sf/te_bug.dot
with
49 additions
and
6 deletions
test/toy-example-a5sf/config.ml
+
18
−
4
View file @
0a1620d6
...
...
@@ -15,8 +15,10 @@ let (isEnabledR: pid -> (pid -> ('a * 'a neighbor list)) -> bool) =
let
(
loc_pot
:
pid
->
pid
list
->
(
pid
->
(
'
a
*
'
a
neighbor
list
))
->
int
)
=
fun
p
pidl
get
->
if
isEnabledS
p
get
then
1
+
vn
*
(
vn
-
1
)
+
int_of_string
(
String
.
sub
p
1
((
String
.
length
p
)
-
1
))
else
if
isEnabledR
p
get
then
1
+
(
vn
-
(
int_of_string
(
String
.
sub
p
1
((
String
.
length
p
)
-
1
))))
if
isEnabledS
p
get
then
1
+
vn
*
(
vn
-
1
)
+
int_of_string
(
String
.
sub
p
1
((
String
.
length
p
)
-
1
))
else
if
isEnabledR
p
get
then
1
+
(
vn
-
(
int_of_string
(
String
.
sub
p
1
((
String
.
length
p
)
-
1
))))
else
0
let
rec
(
sum_loc_pots
:
pid
list
->
pid
list
->
(
pid
->
(
'
a
*
'
a
neighbor
list
))
->
int
)
=
...
...
@@ -38,5 +40,17 @@ let potential = Some pf
let
legitimate
=
None
(* None => only silent configuration are legitimate *)
let
fault
=
None
(* None => the simulation stop once a legitimate configuration is reached *)
let
init_search_utils
=
None
let
fault
=
None
let
mini
=
0
let
maxi
=
max_degree
()
let
s2n
s
=
[
I
(
mini
,
s
.
input
,
100
);
I
(
mini
,
s
.
par
,
maxi
);
I
(
mini
,
s
.
sub
,
100
);
I
(
mini
,
s
.
res
,
100
)]
let
n2s
nl
s
=
match
nl
with
|
[
I
(
_
,
input
,
_
);
I
(
_
,
par
,
_
);
I
(
_
,
sub
,
_
);
I
(
_
,
res
,
_
)]
->
{
s
with
input
;
par
;
sub
;
res
}
|
_
->
assert
false
let
init_search_utils
=
Some
(
s2n
,
n2s
)
This diff is collapsed.
Click to expand it.
test/toy-example-a5sf/state.ml
+
11
−
2
View file @
0a1620d6
...
...
@@ -12,15 +12,24 @@ type t = {
res
:
int
}
let
(
to_string
:
(
t
->
string
))
=
let
(
to_string
_for_rif
:
(
t
->
string
))
=
fun
s
->
Printf
.
sprintf
"input=%d sub=%d res=%d"
s
.
input
s
.
sub
s
.
res
(* sasa --init-search uses to_string for generating the .dot file *)
let
(
_to_string_for_dot
:
(
t
->
string
))
=
fun
s
->
Printf
.
sprintf
"{pid=%s ; input=%d ; par=%d ; sub=%d ; res=%d}"
s
.
pid
s
.
input
s
.
par
s
.
sub
s
.
res
let
to_string
=
to_string_for_rif
let
(
of_string
:
(
string
->
t
)
option
)
=
Some
(
fun
s
->
try
Scanf
.
sscanf
s
"{pid=%s ; input=%d ; par=%d ; sub=%d ; res=%d}"
(
fun
pid
input
par
sub
res
->
{
pid
=
pid
;
input
=
input
;
par
=
par
;
sub
=
sub
;
res
=
res
})
(
fun
pid
input
par
sub
res
->
{
pid
;
input
;
par
;
sub
;
res
})
with
_
->
assert
false
)
...
...
This diff is collapsed.
Click to expand it.
test/toy-example-a5sf/te_bug.dot
0 → 100644
+
20
−
0
View file @
0a1620d6
// the potential does not always decrease using this initial conf
graph
g
{
p1
[
algo
=
"p.ml"
init
=
"{pid=p1 ; input=1 ; par=-1 ; sub=2 ; res=2}"
]
p2
[
algo
=
"p.ml"
init
=
"{pid=p2 ; input=1 ; par=1 ; sub=1 ; res=2}"
]
p3
[
algo
=
"p.ml"
init
=
"{pid=p3 ; input=1 ; par=1 ; sub=0 ; res=1}"
]
p4
[
algo
=
"p.ml"
init
=
"{pid=p4 ; input=1 ; par=1 ; sub=2 ; res=0}"
]
p5
[
algo
=
"p.ml"
init
=
"{pid=p5 ; input=1 ; par=0 ; sub=0 ; res=0}"
]
p6
[
algo
=
"p.ml"
init
=
"{pid=p6 ; input=1 ; par=1 ; sub=4 ; res=0}"
]
p7
[
algo
=
"p.ml"
init
=
"{pid=p7 ; input=1 ; par=0 ; sub=0 ; res=0}"
]
p1
--
p2
p2
--
p3
p3
--
p4
p4
--
p5
p5
--
p6
p6
--
p7
}
\ No newline at end of file
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