while(e.hasNext()){
list.add((Feature)e.next());
while(!list.isEmpty()){
Iterator i = null;
FeatureRelation r = null;
AtomedFeature startAtomedFeature = null,
endAtomedFeature = null,
fatherAtomedFeature = null;
Feature father = list.getFirst();
list.removeFirst();
fatherAtomedFeature = allAtomedFeatures.get(father);
i = include.keySet().iterator();
while(i.hasNext()){
Object key = (Object)i.next();
r = (FeatureRelation)include.get(key);
// ��������ϵ��������������������Ϊend��
// ��������ϵ�б���������Ϊstart��ȡ���ǵ�ԭ�Ӽ�
startAtomedFeature = allAtomedFeatures.get(r.getStartFeature());
endAtomedFeature = allAtomedFeatures.get(r.getEndFeature());
// ֻ��start��father��ͬһԭ�Ӽ��ڣ�
// ��end��start����ͬһԭ�Ӽ��ڣ�
// ��˵�����������ϵ����Ч��
if ( startAtomedFeature.atomSetNum == fatherAtomedFeature.atomSetNum
&&
startAtomedFeature.atomSetNum != endAtomedFeature.atomSetNum){
int temp = bdd.ref(
bdd.imp(endAtomedFeature.BddVar
,startAtomedFeature.BddVar)
);
bdd.bddRoot = bdd.andTo(bdd.bddRoot, temp);
bdd.deref(temp);
/* System.out.println( endAtomedFeature.feature.getName() + " "+
"-> " +
startAtomedFeature.feature.getName() + ": "+
endAtomedFeature.atomSetNum + " " +
"-> " +
startAtomedFeature.atomSetNum + "�� "+
endAtomedFeature.BddVar + " " +
"-> " +
startAtomedFeature.BddVar);*/
i.remove();
include.remove(key);
list.addLast(endAtomedFeature.feature);
}//end if
else if(startAtomedFeature.atomSetNum == endAtomedFeature.atomSetNum){
i.remove();
require.remove(key);
}
}//end while
i = dimensionValue.keySet().iterator();
while(i.hasNext()){
Object key = (Object)i.next();
r = (FeatureRelation)dimensionValue.get(key);
// ��������ϵ��������������������Ϊend��
// ��������ϵ�б���������Ϊstart��ȡ���ǵ�ԭ�Ӽ�
startAtomedFeature = allAtomedFeatures.get(r.getStartFeature());
endAtomedFeature = allAtomedFeatures.get(r.getEndFeature());
// ֻ��start��father��ͬһԭ�Ӽ��ڣ�
// ��end��start����ͬһԭ�Ӽ��ڣ�
// ��˵�����������ϵ����Ч��
if ( startAtomedFeature.atomSetNum == fatherAtomedFeature.atomSetNum
&&
startAtomedFeature.atomSetNum != endAtomedFeature.atomSetNum){
//list.addLast(r.getEndFeature());
int temp = bdd.ref(
bdd.imp(endAtomedFeature.BddVar
,startAtomedFeature.BddVar)
);
bdd.bddRoot = bdd.andTo(bdd.bddRoot, temp);
bdd.deref(temp);
/* System.out.println( endAtomedFeature.feature.getName() + " "+
"-> " +
startAtomedFeature.feature.getName() + ": "+
endAtomedFeature.atomSetNum + " " +
"-> " +
startAtomedFeature.atomSetNum + "�� "+
endAtomedFeature.BddVar + " " +
"-> " +
startAtomedFeature.BddVar);*/
i.remove();
dimensionValue.remove(key);
list.addLast(endAtomedFeature.feature);
}//end if
else if(startAtomedFeature.atomSetNum == endAtomedFeature.atomSetNum){
i.remove();
require.remove(key);
}
}//end while
//!!!!!!!!!!!require��dimensionValue��include��ͬ���ر�Ҫע�⣺
//require��start->end
//dimensionValue��include��end->start
i = require.keySet().iterator();
while(i.hasNext()){
Object key = (Object)i.next();
r = (FeatureRelation)require.get(key);
// ��������ϵ��������������������Ϊstart��
// ��������ϵ�б���������Ϊend��ȡ���ǵ�ԭ�Ӽ�
startAtomedFeature = allAtomedFeatures.get(r.getStartFeature());
endAtomedFeature = allAtomedFeatures.get(r.getEndFeature());
// ֻ��start��father��ͬһԭ�Ӽ��ڣ�
// ��end��start����ͬһԭ�Ӽ��ڣ�
// ��˵�����������ϵ����Ч��
if ( startAtomedFeature.atomSetNum == fatherAtomedFeature.atomSetNum
&&
startAtomedFeature.atomSetNum != endAtomedFeature.atomSetNum){
//list.addLast(r.getEndFeature());
int temp = bdd.ref(
bdd.imp(startAtomedFeature.BddVar
,endAtomedFeature.BddVar)
);
bdd.bddRoot = bdd.andTo(bdd.bddRoot, temp);
bdd.deref(temp);
/* System.out.println( startAtomedFeature.feature.getName() + " "+
"-> " +
endAtomedFeature.feature.getName() + ": "+
startAtomedFeature.atomSetNum + " " +
"-> " +
endAtomedFeature.atomSetNum + "�� "+
startAtomedFeature.BddVar + " " +
"-> " +
endAtomedFeature.BddVar);*/
i.remove();
require.remove(key);
list.addLast(startAtomedFeature.feature);
}//end if
else if(startAtomedFeature.atomSetNum == endAtomedFeature.atomSetNum){
i.remove();
require.remove(key);
}
}//end while
}//end while
}//end while
/* System.out.println("\nRestrict_building completed***********************\n");
if(!include.isEmpty() || !dimensionValue.isEmpty() || !require.isEmpty())
System.out.println("FATAL!!/n/n");
else
System.out.println("PASS/n/n");*/
x = mutex.keySet().iterator();
while(x.hasNext()){
FeatureRelation r = (FeatureRelation)mutex.get(x.next());
// ��������ϵ��������������������Ϊstart��
// ��������ϵ�б���������Ϊend��ȡ���ǵ�ԭ�Ӽ�
AtomedFeature startAtomedFeature = allAtomedFeatures.get(r.getStartFeature());
AtomedFeature endAtomedFeature = allAtomedFeatures.get(r.getEndFeature());
if (startAtomedFeature.atomSetNum != endAtomedFeature.atomSetNum){
//list.addLast(r.getEndFeature());
int temp = bdd.ref(
bdd.or(bdd.not(startAtomedFeature.BddVar)
, bdd.not(endAtomedFeature.BddVar))