* @return ExprList - every entry of the exprlist is in conjunctive normalform
*/
public static ExprList translateFilterExpressionsToCNF(final OpFilter opFilter)
{
ExprList exprList, newExprList;
OpFilter copiedOpFilter;
newExprList = new ExprList(); // contains the translated expressions
exprList = opFilter.getExprs();
// workaround to avoid deep copy from the expressions
// because deep copy is not available in Q_UnaryNot.java
copiedOpFilter = (OpFilter) OpFilter.filter(exprList, opFilter.getSubOp());
exprList = copiedOpFilter.getExprs();
// for every expression of the filter, apply first DeMorgan-law and then Distributive-law
for (Expr expr: exprList) {
if (expr instanceof ExprNode) { // only SPARQL expressions are handled (e.g. no RDQL SimpleNode)
expr = applyDeMorganLaw(expr); // !(a || b) will become !a && !b