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
845adfba
Commit
845adfba
authored
11 years ago
by
Thorsten Wißmann
Browse files
Options
Downloads
Patches
Plain Diff
Make agent list configurable via --agents
parent
2cef7a7c
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
CoAlgLogics.ml
+5
-2
5 additions, 2 deletions
CoAlgLogics.ml
CoAlgLogics.mli
+3
-1
3 additions, 1 deletion
CoAlgLogics.mli
coalg.ml
+31
-3
31 additions, 3 deletions
coalg.ml
with
39 additions
and
6 deletions
CoAlgLogics.ml
+
5
−
2
View file @
845adfba
...
@@ -194,7 +194,10 @@ let compatible sort (a: bset) formula1 =
...
@@ -194,7 +194,10 @@ let compatible sort (a: bset) formula1 =
/\ n /\ m all C_i ⊆ D
/\ n /\ m all C_i ⊆ D
/ \i=1 a_i /\ b / \j=1 c_j
/ \i=1 a_i /\ b / \j=1 c_j
*)
*)
let
agents
=
[
|
1
;
2
;
3
;
4
;
5
;
6
;
7
;
8
;
9
;
10
|
]
let
agents
=
ref
([
|
1
;
2
;
3
;
4
;
5
;
6
;
7
;
8
;
9
;
10
|
])
let
cl_get_agents
()
=
!
agents
let
cl_set_agents
arr
=
ignore
(
agents
:=
arr
)
let
mkRule_CL
sort
bs
sl
=
let
mkRule_CL
sort
bs
sl
=
assert
(
List
.
length
sl
=
1
);
(* TODO: Why? *)
assert
(
List
.
length
sl
=
1
);
(* TODO: Why? *)
...
@@ -205,7 +208,7 @@ let mkRule_CL sort bs sl =
...
@@ -205,7 +208,7 @@ let mkRule_CL sort bs sl =
let
nCands
=
bsetMakeRealEmpty
()
in
(* all N-diamonds *)
let
nCands
=
bsetMakeRealEmpty
()
in
(* all N-diamonds *)
let
hasFullAgentList
formula
=
let
hasFullAgentList
formula
=
let
aglist
=
lfGetDestAg
sort
formula
in
let
aglist
=
lfGetDestAg
sort
formula
in
let
value
=
TArray
.
all
(
fun
x
->
TArray
.
elem
x
aglist
)
agents
in
let
value
=
TArray
.
all
(
fun
x
->
TArray
.
elem
x
aglist
)
!
agents
in
if
(
value
)
then
bsetAdd
nCands
formula
else
()
;
if
(
value
)
then
bsetAdd
nCands
formula
else
()
;
value
value
in
in
...
...
This diff is collapsed.
Click to expand it.
CoAlgLogics.mli
+
3
−
1
View file @
845adfba
...
@@ -6,5 +6,7 @@
...
@@ -6,5 +6,7 @@
open
CoAlgMisc
open
CoAlgMisc
val
agents
:
int
array
val
cl_get_agents
:
unit
->
int
array
val
cl_set_agents
:
int
array
->
unit
val
getExpandingFunctionProducer
:
functors
->
sort
->
bset
->
sort
list
->
stateExpander
val
getExpandingFunctionProducer
:
functors
->
sort
->
bset
->
sort
list
->
stateExpander
This diff is collapsed.
Click to expand it.
coalg.ml
+
31
−
3
View file @
845adfba
...
@@ -35,11 +35,17 @@ let _ = Gc.set { (Gc.get()) with Gc.minor_heap_size = 4194304; major_heap_increm
...
@@ -35,11 +35,17 @@ let _ = Gc.set { (Gc.get()) with Gc.minor_heap_size = 4194304; major_heap_increm
let
printUsage
()
=
let
printUsage
()
=
print_endline
"Usage:
\"
alc <task> <functor> [<
verbose
>]
\"
where"
;
print_endline
"Usage:
\"
alc <task> <functor> [<
flags
>]
\"
where"
;
print_endline
" <task> in { sat print }"
;
print_endline
" <task> in { sat print }"
;
print_endline
" <functor> in { MultiModalK MultiModalKD CoalitionLogic GML"
;
print_endline
" <functor> in { MultiModalK MultiModalKD CoalitionLogic GML"
;
print_endline
" (or: K) (or: KD) (or: CL) }"
;
print_endline
" (or: K) (or: KD) (or: CL) }"
;
print_endline
" <verbose> = any (second) argument"
;
print_endline
" <flags> = a list of the following items"
;
print_endline
" --agents AGLIST"
;
print_endline
" expects the next argument AGLIST to be a list of integers"
;
print_endline
" which is treaten as the set of agents for CL formulas"
;
print_endline
" it defaults to 1,2,3,4,5,6,7,8,9,10"
;
print_endline
" --verbose"
;
print_endline
" print verbose output for sat task"
;
print_endline
""
;
print_endline
""
;
print_endline
"Examples:"
;
print_endline
"Examples:"
;
print_endline
" OCAMLRUNPARAM=b ./coalg sat K <<< '[R] False'"
;
print_endline
" OCAMLRUNPARAM=b ./coalg sat K <<< '[R] False'"
;
...
@@ -48,6 +54,7 @@ let printUsage () =
...
@@ -48,6 +54,7 @@ let printUsage () =
exit
1
exit
1
let
counter
=
ref
0
let
counter
=
ref
0
let
verbose
=
ref
false
let
parseFunctor
str
=
let
parseFunctor
str
=
match
str
with
match
str
with
...
@@ -61,7 +68,7 @@ let parseFunctor str =
...
@@ -61,7 +68,7 @@ let parseFunctor str =
|
_
->
raise
(
CoAlgFormula
.
CoAlgException
(
"Unknown Functor name »"
^
str
^
"«"
))
|
_
->
raise
(
CoAlgFormula
.
CoAlgException
(
"Unknown Functor name »"
^
str
^
"«"
))
let
choiceSat
()
=
let
choiceSat
()
=
let
verb
=
Array
.
length
Sys
.
argv
>
3
in
let
verb
=
!
verbose
in
let
sorts
=
[
|
(
parseFunctor
Sys
.
argv
.
(
2
)
,
[
0
])
|
]
in
let
sorts
=
[
|
(
parseFunctor
Sys
.
argv
.
(
2
)
,
[
0
])
|
]
in
let
printRes
sat
=
let
printRes
sat
=
if
not
verb
then
if
not
verb
then
...
@@ -95,11 +102,32 @@ let choicePrint () =
...
@@ -95,11 +102,32 @@ let choicePrint () =
done
done
with
End_of_file
->
()
with
End_of_file
->
()
let
rec
parseFlags
arr
offs
:
unit
=
let
offs
=
ref
(
offs
)
in
let
getParam
()
=
if
((
!
offs
+
1
)
>=
Array
.
length
arr
)
then
raise
(
CoAlgFormula
.
CoAlgException
(
"Parameter missing for flag »"
^
(
arr
.
(
!
offs
))
^
"«"
))
else
offs
:=
!
offs
+
1
;
arr
.
(
!
offs
)
in
if
(
!
offs
>=
Array
.
length
arr
)
then
()
else
(
ignore
(
match
arr
.
(
!
offs
)
with
|
"--verbose"
->
verbose
:=
true
|
"--agents"
->
let
strAglist
=
getParam
()
in
let
aglist
=
List
.
map
int_of_string
(
Str
.
split
(
Str
.
regexp
","
)
strAglist
)
in
CoAlgLogics
.
cl_set_agents
(
Array
.
of_list
aglist
)
|
_
->
raise
(
CoAlgFormula
.
CoAlgException
(
"Unknown flag »"
^
(
arr
.
(
!
offs
))
^
"«"
))
)
;
parseFlags
arr
(
!
offs
+
1
)
)
let
_
=
let
_
=
if
Array
.
length
Sys
.
argv
<
3
then
printUsage
()
if
Array
.
length
Sys
.
argv
<
3
then
printUsage
()
else
else
let
choice
=
Sys
.
argv
.
(
1
)
in
let
choice
=
Sys
.
argv
.
(
1
)
in
parseFlags
Sys
.
argv
3
;
match
choice
with
match
choice
with
|
"sat"
->
choiceSat
()
|
"sat"
->
choiceSat
()
|
"print"
->
choicePrint
()
|
"print"
->
choicePrint
()
...
...
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