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
56208143
Commit
56208143
authored
11 years ago
by
Thorsten Wißmann
Browse files
Options
Downloads
Patches
Plain Diff
Implement rule for CL
parent
5e185dd3
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
CoAlgLogicUtils.ml
+1
-0
1 addition, 0 deletions
CoAlgLogicUtils.ml
CoAlgLogicUtils.mli
+1
-0
1 addition, 0 deletions
CoAlgLogicUtils.mli
CoAlgLogics.ml
+47
-2
47 additions, 2 deletions
CoAlgLogics.ml
with
49 additions
and
2 deletions
CoAlgLogicUtils.ml
+
1
−
0
View file @
56208143
...
@@ -14,6 +14,7 @@ module TArray = struct
...
@@ -14,6 +14,7 @@ module TArray = struct
let
all
f
=
any
(
fun
x
->
not
(
f
x
))
let
all
f
=
any
(
fun
x
->
not
(
f
x
))
let
elem
(
x
:
'
a
)
(
arr
:
'
a
array
)
=
let
elem
(
x
:
'
a
)
(
arr
:
'
a
array
)
=
any
(
fun
y
->
x
==
y
)
arr
any
(
fun
y
->
x
==
y
)
arr
let
included
sub
sup
=
all
(
fun
x
->
elem
x
sup
)
sub
end
end
let
disjointAgents
sort
a
b
=
let
disjointAgents
sort
a
b
=
...
...
This diff is collapsed.
Click to expand it.
CoAlgLogicUtils.mli
+
1
−
0
View file @
56208143
...
@@ -10,6 +10,7 @@ module TArray : sig
...
@@ -10,6 +10,7 @@ module TArray : sig
val
all
:
(
'
a
->
bool
)
->
'
a
array
->
bool
val
all
:
(
'
a
->
bool
)
->
'
a
array
->
bool
val
any
:
(
'
a
->
bool
)
->
'
a
array
->
bool
val
any
:
(
'
a
->
bool
)
->
'
a
array
->
bool
val
elem
:
'
a
->
'
a
array
->
bool
val
elem
:
'
a
->
'
a
array
->
bool
val
included
:
'
a
array
->
'
a
array
->
bool
end
end
val
disjointAgents
:
sort
->
localFormula
->
localFormula
->
bool
val
disjointAgents
:
sort
->
localFormula
->
localFormula
->
bool
...
...
This diff is collapsed.
Click to expand it.
CoAlgLogics.ml
+
47
−
2
View file @
56208143
...
@@ -210,6 +210,45 @@ let mkRule_CL sort bs sl =
...
@@ -210,6 +210,45 @@ let mkRule_CL sort bs sl =
in
in
(* Candidates for D in Rule 2 *)
(* Candidates for D in Rule 2 *)
let
dCands
=
bsetFilter
diamonds
(
fun
f
->
not
(
hasFullAgentList
f
))
in
let
dCands
=
bsetFilter
diamonds
(
fun
f
->
not
(
hasFullAgentList
f
))
in
let
c_j
:
localFormula
list
=
bsetFold
(
fun
f
a
->
(
lfGetDest1
sort
f
)
::
a
)
nCands
[]
in
let
getRule2
diamDb
acc
=
(* diamDb = <D> b *)
let
d
=
lfGetDestAg
sort
diamDb
in
(* the agent list *)
let
b
=
lfGetDest1
sort
diamDb
in
let
hasAppropriateAglist
f
=
let
aglist
=
lfGetDestAg
sort
f
in
TArray
.
included
aglist
d
in
let
maxdisj
=
maxDisjoints
sort
(
bsetFilter
boxes
hasAppropriateAglist
)
in
let
createSingleRule
acc
coalitions
=
let
a_i
:
localFormula
list
=
bsetFold
(
fun
f
a
->
(
lfGetDest1
sort
f
)
::
a
)
coalitions
[]
in
(* now do rule 2:
coalitions /\ <d> b /\ nCands
————————————————————————————————
a_i /\ b /\ c_j
*)
let
children
=
bsetMake
()
in
List
.
iter
(
bsetAdd
children
)
(
b
::
c_j
)
;
List
.
iter
(
bsetAdd
children
)
(
a_i
)
;
((
fun
bs1
->
bs
)
,
[(
s1
,
children
)])
::
acc
in
List
.
fold_left
createSingleRule
acc
maxdisj
in
let
rules
=
bsetFold
getRule2
dCands
[]
in
let
getRule1
acc
coalitions
=
(* do rule 1:
coalitions
————————————
a_i
*)
let
a_i
:
bset
=
bsetMake
()
in
bsetIter
(
fun
f
->
bsetAdd
a_i
(
lfGetDest1
sort
f
))
coalitions
;
((
fun
bs1
->
bs
)
,
[(
s1
,
a_i
)])
::
acc
in
let
rules
=
List
.
fold_left
getRule1
rules
disjoints
in
(*
(*
mkRule_CL sort bs [s1]
mkRule_CL sort bs [s1]
= { (λ[bs1]. bs, [(s1, { a_i | i∈I })])
= { (λ[bs1]. bs, [(s1, { a_i | i∈I })])
...
@@ -217,8 +256,14 @@ let mkRule_CL sort bs sl =
...
@@ -217,8 +256,14 @@ let mkRule_CL sort bs sl =
C_i pairwise disjoint and I maximal
C_i pairwise disjoint and I maximal
}
}
*)
*)
(* just do this to let it compile... *)
(* standard return procedure *)
mkRule_MultiModalK
sort
bs
sl
let
res
=
ref
(
Some
rules
)
in
fun
()
->
match
!
res
with
|
None
->
NoMoreRules
|
Some
rules
->
res
:=
None
;
AllInOne
rules
let
mkRule_Choice
sort
bs
sl
=
let
mkRule_Choice
sort
bs
sl
=
assert
(
List
.
length
sl
=
2
);
assert
(
List
.
length
sl
=
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