Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cool
Manage
Activity
Members
Labels
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hans-Peter Deifel
cool
Commits
26e21f07
Commit
26e21f07
authored
11 years ago
by
Thorsten Wißmann
Browse files
Options
Downloads
Patches
Plain Diff
Add coalition list printing
parent
ca99d0c6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib/CoAlgLogicUtils.ml
+19
-1
19 additions, 1 deletion
src/lib/CoAlgLogicUtils.ml
src/lib/CoAlgLogicUtils.mli
+2
-0
2 additions, 0 deletions
src/lib/CoAlgLogicUtils.mli
with
21 additions
and
1 deletion
src/lib/CoAlgLogicUtils.ml
+
19
−
1
View file @
26e21f07
...
@@ -68,8 +68,26 @@ let maxDisjoints sort (a: bset) : bset list =
...
@@ -68,8 +68,26 @@ let maxDisjoints sort (a: bset) : bset list =
let
tmpf
:
bset
->
int
->
bset
=
let
tmpf
:
bset
->
int
->
bset
=
(
fun
bs
f
->
bsetAdd
bs
(
lfFromInt
f
)
;
bs
)
(
fun
bs
f
->
bsetAdd
bs
(
lfFromInt
f
)
;
bs
)
in
in
List
.
map
(
List
.
fold_left
tmpf
(
bsetMake
()
))
List
.
map
(
List
.
fold_left
tmpf
(
bsetMake
RealEmpty
()
))
(
List
.
map
S
.
elements
intlist
)
(
List
.
map
S
.
elements
intlist
)
let
string_of_coalition
sort
bs
=
let
modlist
=
bsetFold
(
fun
x
l
->
x
::
l
)
bs
[]
in
let
show
modality
=
let
(
o
,
c
)
=
(* open/close brackets *)
match
lfGetType
sort
modality
with
|
EnforcesF
->
(
"["
,
"]"
)
|
AllowsF
->
(
"{"
,
"}"
)
|
_
->
(
"¿"
,
"?"
)
in
let
agents
=
(
Array
.
to_list
(
lfGetDestAg
sort
modality
))
in
let
agents
=
List
.
map
string_of_int
agents
in
o
^
(
String
.
concat
", "
agents
)
^
c
in
let
modlist
=
List
.
map
show
modlist
in
"{ "
^
(
String
.
concat
", "
modlist
)
^
" }"
let
string_of_coalition_list
sort
bs_list
=
String
.
concat
"
\n
"
(
List
.
map
(
string_of_coalition
sort
)
bs_list
)
This diff is collapsed.
Click to expand it.
src/lib/CoAlgLogicUtils.mli
+
2
−
0
View file @
26e21f07
...
@@ -10,6 +10,8 @@ open CoolUtils
...
@@ -10,6 +10,8 @@ open CoolUtils
val
disjointAgents
:
sort
->
localFormula
->
localFormula
->
bool
val
disjointAgents
:
sort
->
localFormula
->
localFormula
->
bool
val
maxDisjoints
:
sort
->
bset
->
bset
list
val
maxDisjoints
:
sort
->
bset
->
bset
list
val
string_of_coalition
:
sort
->
bset
->
string
val
string_of_coalition_list
:
sort
->
bset
list
->
string
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