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
a6c0ea42
Commit
a6c0ea42
authored
6 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
Fix: force generated lutin demon to activate at least one action
parent
7105bae2
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
lib/sasacore/genLutin.ml
+13
-8
13 additions, 8 deletions
lib/sasacore/genLutin.ml
with
13 additions
and
8 deletions
lib/sasacore/genLutin.ml
+
13
−
8
View file @
a6c0ea42
(* Time-stamp: <modified the 2
0
/03/2019 (at 1
5:13
) by Erwan Jahier> *)
(* Time-stamp: <modified the 2
1
/03/2019 (at 1
7:40
) by Erwan Jahier> *)
open
Process
open
Process
...
@@ -7,7 +7,10 @@ let (gen_atmost_macro : int -> string) =
...
@@ -7,7 +7,10 @@ let (gen_atmost_macro : int -> string) =
let
xs
=
List
.
init
n
(
fun
i
->
Printf
.
sprintf
"x%d"
(
i
+
1
))
in
let
xs
=
List
.
init
n
(
fun
i
->
Printf
.
sprintf
"x%d"
(
i
+
1
))
in
let
notxs
=
List
.
map
(
fun
x
->
Printf
.
sprintf
"not(%s)"
x
)
xs
in
let
notxs
=
List
.
map
(
fun
x
->
Printf
.
sprintf
"not(%s)"
x
)
xs
in
let
x
=
String
.
concat
","
xs
in
let
x
=
String
.
concat
","
xs
in
let
str
=
ref
(
Printf
.
sprintf
"let at_most_1_of_%d(%s:bool):bool =
\n\t\t
("
n
x
)
in
let
str
=
ref
(
Printf
.
sprintf
"let at_most_1_of_%d(%s:bool):bool =
\n\t\t
("
n
x
)
in
str
:=
!
str
^
(
String
.
concat
" and "
notxs
)
^
") or
\n\t\t
("
;
str
:=
!
str
^
(
String
.
concat
" and "
notxs
)
^
") or
\n\t\t
("
;
for
i
=
1
to
n
do
for
i
=
1
to
n
do
for
j
=
1
to
n
do
for
j
=
1
to
n
do
...
@@ -52,14 +55,16 @@ let (f: Process.t list -> string) =
...
@@ -52,14 +55,16 @@ let (f: Process.t list -> string) =
let
one_per_process
=
if
one_per_process
=
""
then
""
else
let
one_per_process
=
if
one_per_process
=
""
then
""
else
" and
\n\t\t
"
^
one_per_process
" and
\n\t\t
"
^
one_per_process
in
in
let
atmost_macro
=
let
nl
=
List
.
map
(
fun
al
->
List
.
length
al
)
all
in
let
n
=
List
.
length
(
List
.
hd
all
)
in
let
nl
=
List
.
sort_uniq
compare
nl
in
if
n
<
1
then
""
else
gen_atmost_macro
n
let
nl
=
List
.
filter
(
fun
n
->
n
>
1
)
nl
in
in
let
atmost_macro_l
=
List
.
map
gen_atmost_macro
nl
in
let
atmost_macro
=
String
.
concat
"
\n
"
atmost_macro_l
in
let
atleastone
=
"("
^
(
String
.
concat
" or "
al
)
^
") and "
in
let
macro
=
Printf
.
sprintf
" (* Genarated by sasa *)
let
macro
=
Printf
.
sprintf
" (* Genarated by sasa *)
%s
%s
let demon_prop(%s,
\n\t
%s:bool):bool =
\n\t\t
%s%s"
let demon_prop(%s,
\n\t
%s:bool):bool =
\n\t\t
%s
\n\t\t
%s
%s"
atmost_macro
(
ins
"
\n\t
"
)
(
outs
"
\n\t
"
)
acti_if_enab
one_per_process
atmost_macro
(
ins
"
\n\t
"
)
(
outs
"
\n\t
"
)
atleastone
acti_if_enab
one_per_process
in
in
let
distributed
=
Printf
.
sprintf
let
distributed
=
Printf
.
sprintf
...
...
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