-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboundcond.cpp
More file actions
54 lines (41 loc) · 1.79 KB
/
boundcond.cpp
File metadata and controls
54 lines (41 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "boundcond.h"
/**
* @brief modify O,I based on two conditions
* @param gamma the AF in which we are operating
* @param SCC [in] SetArguments S[i] in pref
* @param e [in] SetArguments e in pref
* @param O [out] SetArguments O in pref
* @param I [out] SetArguments I in pref
*/
void boundcond(AF gamma, SetArguments SCC, SetArguments e, SetArguments *O, SetArguments *I){
SetArguments SCC_except_O,gamma_except_SCC,A,B1,B2, gamma_except_SCC_U_e, SCC_U_e;
//O is the subset of Arguments of S[i] which are attacked by Arguments in e;
*O=get_attacked_from(SCC,e);
//cout << "boundcond: O"<<*O<<endl;
//I is the subset of Arguments of S[i]\O which: condition (A) or condition (B)
//(A) Are not attacked by Arguments in gamma extern of S[i]
SCC.setminus(O,&SCC_except_O); //S[i]\O
(gamma.get_arguments())->setminus(&SCC,&gamma_except_SCC);
A=get_not_attacked_nodes(SCC_except_O,gamma_except_SCC);
//(B) are possibly attacked only by arguments which: condition (i) (ii)
SCC.setunion(&e,&SCC_U_e);
(gamma.get_arguments())->setminus(&SCC_U_e,&gamma_except_SCC_U_e);
//(i) are in gamma but non in (S[i] joint e)
B1=get_attacked_from(SCC_except_O,gamma_except_SCC_U_e);
//(ii) are attacked by Arguments in e
SetArguments B=SetArguments();
SetArguments * intersect = new SetArguments();
SetArguments * it_attackers;
for(SetArgumentsIterator it = B1.begin(); it != B1.end(); it++){
it_attackers=(*it)->get_attackers();
SetArguments * attackers_union = new SetArguments();
for(SetArgumentsIterator jt = it_attackers->begin(); jt != it_attackers->end(); jt++){
attackers_union->setunion((*jt)->get_attackers(),attackers_union);
}
attackers_union->intersect(&e, intersect);
if(!intersect->empty())
B.add_Argument(*it);
}
//final Boundcond in I
A.setunion(&B,I);
}