return new UncertainTrue(getMinCertainty());
else
return new UncertainTrue(getMaxCertainty());
}else{
float formulaCertainty = 0;
Value attributeValue = wm.getAttributeValue(at);
//For simple attributes just return the certainty value of an attribute
if(attributeValue instanceof SimpleSymbolic || attributeValue instanceof SimpleNumeric){
formulaCertainty = attributeValue.getCertaintyFactor();
formulaCertainty = (logicalValue==true ? formulaCertainty : -formulaCertainty );
}else{
if(op.equals(Formulae.OP_SIM)) {
if( logicalValue == true){
formulaCertainty = sim(at, v, wm);
}else{
formulaCertainty = -sim(at,getComplement(at, v, wm),wm);
}
}else if(op.equals(Formulae.OP_NOTSIM)){
if(logicalValue == true){
sim(at,getComplement(at, v, wm),wm);
}else{
formulaCertainty = -sim(at, v,wm);
}
}else if(op.equals(Formulae.OP_EQ)){
if(logicalValue == true){
formulaCertainty = getMinCF(((SetValue)attributeValue).getValues());
}
else{
SetValue diff = getDifference(at, v, wm);
formulaCertainty = -sim(at,diff, wm);
}
}else if(op.equals(Formulae.OP_NEQ)){
if(logicalValue == true){
SetValue diff = getDifference(at, v, wm);
formulaCertainty = sim(at,diff, wm);
}
else{
formulaCertainty = -getMinCF(((SetValue)attributeValue).getValues());
}
}else if(op.equals(Formulae.OP_SUPSET)){
if(logicalValue == true){
//return the weakest chain element that makes it superset
SetValue intersection = (SetValue) attributeValue.intersect( v,at.getType());
formulaCertainty = getMinCF(intersection.getValues());
}else{
SetValue comp = getComplement(at, v, wm);
SetValue intersect = (SetValue) attributeValue.intersect( comp,at.getType());
// return how the {Domain\value} is similar to the attribute value
formulaCertainty = -sim(at,intersect, wm);
}
}else if(op.equals(Formulae.OP_SUBSET)){
if(logicalValue == true){
formulaCertainty = getMinCF(((SetValue)attributeValue).getValues());
}else{
SetValue comp = getComplement(at, v, wm);
SetValue intersect = (SetValue) attributeValue.intersect( comp,at.getType());
// return how the {Domain\value} is similar to the attribute value
formulaCertainty = -sim(at,intersect, wm);
}
}