Skip to content
Snippets Groups Projects
Commit c1a08c36 authored by Thorsten Wißmann's avatar Thorsten Wißmann :guitar:
Browse files

CL: create enough rule 2 applications

The previous optimization in the rule 2 applications of coalition logic
left out some rule applications. Now, do enough but still do not
generate unnecessarily many rule applications.
parent 9944c81b
No related branches found
No related tags found
No related merge requests found
...@@ -262,10 +262,13 @@ let mkRule_CL sort bs sl : stateExpander = ...@@ -262,10 +262,13 @@ let mkRule_CL sort bs sl : stateExpander =
in in
let rules = bsetFold getRule2 dCands [] in let rules = bsetFold getRule2 dCands [] in
let getRule2ForFullAgents acc = let getRule2ForFullAgents acc =
(* if there are N-diamonds but no diamonds with a proper subset of the agents, (* So far, we only applied rule 2 for D a proper subset of N.
then we need an explicit rule 2 We still need rule 2 for D=N and b=c_j for some j. (Or equivalently we
apply rule2 without the <d> b).
If there are not N formulas, we don't need to do this because the
created rule 2 applications are just the rule 1 applications.
*) *)
if not !nCandsEmpty && !dCandsEmpty then begin if not !nCandsEmpty then begin
(* create rule 2 once for all the diamonds with a full agent set *) (* create rule 2 once for all the diamonds with a full agent set *)
let maxdisj = maxDisjoints sort boxes in let maxdisj = maxDisjoints sort boxes in
let createSingleRule acc coalitions = let createSingleRule acc coalitions =
......
...@@ -79,6 +79,14 @@ let cl_testcases : testcase_section = ...@@ -79,6 +79,14 @@ let cl_testcases : testcase_section =
; sat "([{1 3}] C) & ([{ 2 3 }] ~C )" ; sat "([{1 3}] C) & ([{ 2 3 }] ~C )"
] ]
let cl_testcases_2agents : testcase_section =
use_functor "CL" (fun () -> CoolUtils.cl_set_agents [|1;2|])
[ unsat "[{1}] C & [{ 2 }] ~C"
; unsat "<{ 1 2 }> C & <{ 1 2 }> ~C"
; unsat "[{1}](p3 | ~p5) & ([{1}](p3 | p5) | [{1 2}](p1 | p3)) & ~[{1}](p5 | ~p4) & ([{}](~(p1 | ~p2)) | [{}](~(p1 | ~p4))) & [{}](~(p3 | ~p4)) & (~[{1}](p1 | ~p2) | ~[{1}](p1 | ~p5))"
; unsat "[{1}](p3 | ~p5) & ([{1}](p3 | p5) | [{1 2}](p1 | p3)) & ~[{1}](p5 | ~p4) & (~[{1 2 }]((p1 | ~p2)) | ~[{1 2}]((p1 | ~p4))) & ~[{1 2}]((p3 | ~p4)) & (~[{1}](p1 | ~p2) | ~[{1}](p1 | ~p5))"
]
let kAndKd_testcases : testcase_section = let kAndKd_testcases : testcase_section =
use_functor "K * KD" __ use_functor "K * KD" __
[ sat "[pi1]True" [ sat "[pi1]True"
...@@ -122,6 +130,7 @@ let testcases = ...@@ -122,6 +130,7 @@ let testcases =
; c "Nominals" nominal_testcases ; c "Nominals" nominal_testcases
; c "KD" kd_testcases ; c "KD" kd_testcases
; cl_testcases ; cl_testcases
; cl_testcases_2agents
; kAndKd_testcases ; kAndKd_testcases
; kAndK_testcases ; kAndK_testcases
; c "K+KD" kOrKd_testcases ; c "K+KD" kOrKd_testcases
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment