Examples of Negation


Examples of ca.ucalgary.ispia.rebac.Negation

    }
   

    else if(policy instanceof Negation){

      Negation temp = (Negation) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Conjunction){

      Conjunction temp = (Conjunction) policy;

     

      Set temp_setA = findFreeVars(temp.getPolicyA(), new HashSet<Object>());

      Set temp_setB = findFreeVars(temp.getPolicyB(), new HashSet<Object>());

      free_vars.addAll(temp_setA);

      free_vars.addAll(temp_setB);

    }

   

    else if (policy instanceof Disjunction){

      Disjunction temp = (Disjunction) policy;

     

      Set temp_setA = findFreeVars(temp.getPolicyA(), new HashSet<Object>());

      Set temp_setB = findFreeVars(temp.getPolicyB(), new HashSet<Object>());

      free_vars.addAll(temp_setA);

      free_vars.addAll(temp_setB);

    }

   

    else if (policy instanceof Box){

      Box temp = (Box) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Diamond){

      Diamond temp = (Diamond) policy;

      free_vars = findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Bind){

      Bind temp = (Bind) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.remove(temp.getVariable());

    }

   

    else if (policy instanceof At){

      At temp = (At) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.add(temp.getVariable());

    }

    return free_vars;
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.expr.Negation

        }
        boolean empty = nm.selectNode(node, RelationalOperators.DUMMY).equals(NodeMaker.EMPTY);
        logger.debug("result " + new Boolean(empty));
        if (!empty) {
          if (node.isURI())
            expression.push(new Negation(vm.valueExpression(node.getURI())));
          else if (node.isLiteral()) {
            if (XSD.isSupported(node.getLiteralDatatype()))
              expression.push(new Negation(vm.valueExpression(constant.value())));
            else // type = boolean or an unknown type
              conversionFailed("cannot compare values of type " + node.getLiteralDatatypeURI(), expr);
          } else
            conversionFailed(expr); // TODO blank nodes?
          return;
        } else {
          expression.push(Expression.TRUE);
          return;
        }
      }
    } else if (e1 instanceof ConstantEx && e2 instanceof ConstantEx) {
      logger.debug("isNotEqual(" + e1 + ", " + e2 + ")");
      Node c1 = ((ConstantEx) e1).getNode();
      Node c2 = ((ConstantEx) e2).getNode();
      boolean equals;
      if (XSD.isNumeric(c1) && XSD.isNumeric(c2)) {
        RDFDatatype datatype = XSD.getNumericType(c1.getLiteralDatatype(), c2.getLiteralDatatype());
        equals = XSD.cast(c1, datatype).equals(XSD.cast(c2, datatype));
      } else if (isSimpleLiteral(c1) && isSimpleLiteral(c2)) {
        equals = c1.getLiteralValue().equals(c2.getLiteralValue());
      } else if (XSD.isString(c1) && XSD.isString(c2)) {
        equals = c1.getLiteralValue().equals(c2.getLiteralValue());
      } else {
        try {
          equals = NodeFunctions.rdfTermEquals(c1, c2);
        } catch (ExprEvalException e) {
          equals = false;
        }
      }
      logger.debug("constants equal? " + new Boolean(equals));
      expression.push(equals ? Expression.FALSE : Expression.TRUE);
      return;
    } else if (e1 instanceof AttributeExprEx && e2 instanceof AttributeExprEx) {
      logger.debug("isNotEqual(" + e1 + ", " + e2 + ")");
      AttributeExprEx variable1 = (AttributeExprEx) e1;
      AttributeExprEx variable2 = (AttributeExprEx) e2;
     
      NodeMaker nm1 = variable1.getNodeMaker();
      NodeMaker nm2 = variable2.getNodeMaker();
     
      DetermineNodeType filter1 = new DetermineNodeType();
      nm1.describeSelf(filter1);
      RDFDatatype datatype1 = filter1.getDatatype();
     
      DetermineNodeType filter2 = new DetermineNodeType();
      nm2.describeSelf(filter2);
      RDFDatatype datatype2 = filter2.getDatatype();
     
      if (datatype1 != null && XSD.isNumeric(datatype1) && datatype2 != null && XSD.isNumeric(datatype2)) {
        RDFDatatype numericType = XSD.getNumericType(filter1.getDatatype(), filter2.getDatatype());
        nm1 = cast(nm1, numericType);
        nm2 = cast(nm2, numericType);
      }
     
      NodeSetConstraintBuilder nodeSet = new NodeSetConstraintBuilder();
      nm1.describeSelf(nodeSet);
      nm2.describeSelf(nodeSet);
     
      if (nodeSet.isEmpty()) {
        logger.debug("nodes " + nm1 + " " + nm2 + " incompatible");
        expression.push(Expression.TRUE);
        return;
      }
    }
   
    expression.push(new Negation(Equality.create(e1, e2)));
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.expr.Negation

    expr.getArg().visit(this);
    Expression e1 = expression.pop();
    if (e1 instanceof Negation)
      expression.push(((Negation) e1).getBase());
    else
      expression.push(new Negation(e1));
  }
View Full Code Here

Examples of eas.users.lukas.tnt.propositionalCalculus.Negation

   
    @SuppressWarnings(value = { "all" })
    public static void main(String[] args) throws CloneNotSupportedException {
        Variable a = new Variable(0), b = new Variable(1), c = new Variable(2);
        Variable d = new Variable(3), e = new Variable(4), f = new Variable(5);
        Statement s1 = new Negation(new Exists(new Exists(new Exists(new Equality(new Multiplication(new Multiplication(a, a), a), new Addition(new Multiplication(new Multiplication(new Addition(b, new Number(1)), new Addition(b, new Number(1))), new Addition(b, new Number(1))), new Multiplication(new Multiplication(new Addition(c, new Number(1)), new Addition(c, new Number(1))), new Addition(c, new Number(1))))), c), b), a));
        Statement s2 = s1.clone();
        s1 = new Disjunction(new Conjunction(s1.clone(), s1.clone()), s1.clone());
        Statement s3 = s2.clone();
        renameVarConsistently(s3, a.clone(), d.clone());
        renameVarConsistently(s3, b.clone(), e.clone());
        renameVarConsistently(s3, c.clone(), f.clone());
        s2 = new Disjunction(new Conjunction(s2.clone(), s3.clone()), s3.clone());
View Full Code Here

Examples of er.neo4jadaptor.query.expression.sentence.Negation

     
      return new BinaryJoined(BinaryOperator.OR, components);
    } else if (q instanceof EONotQualifier) {
      Sentence component = convert(((EONotQualifier) q).qualifier());
     
      return new Negation(component);
    } else if (q instanceof EOKeyValueQualifier) {
      return convertComparison((EOKeyValueQualifier) q);
    } else {
      throw new IllegalArgumentException();
    }
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

                return new Abs(f).matches(expr);
            }

            @Override
            public Expression apply() {
                return new Negation(f.hit());
            }
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

               
                rp = r.get(p);
                bi = b.coeffs.get(i);
               
                rp = rp != null ? new Subtraction(rp, new Multiplication(c, bi)).evaluate()
                        : new Negation(new Multiplication(c, bi)).evaluate();

                if (rp instanceof ANumber && ((ANumber) rp).isZero() && !p.isZero()) {
                    r.remove(p);
                } else {
                    r.put(p, rp);
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

            minuend = coeffs.get(n);
           
            if (minuend != null) {
                c = new Subtraction(minuend, subtrahend.coeffs.get(n)).evaluate();
            } else {
                c = new Negation(subtrahend.coeffs.get(n)).evaluate();
            }
           
            if (c instanceof ANumber && ((ANumber) c).isZero()) {
                map.remove(n);
            } else {
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

            c = coeffs.get(n);
           
            if (c instanceof ANumber) {
                map.put(n, ((ANumber) c).negate());
            } else {
                map.put(n, new Negation(c));
            }
        }
       
        return new Polynomial(map, x);
    }
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

                } else if (!((ANumber) c).isNegative()) {
                    return new EmptySet();
                }
            }
           
            Expression x1 = new Sqrt(new Division(new Negation(c), a));
            Expression x2 = new Negation(x1);
           
            ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 1), x1));
            ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 2), x2));
           
            x1 = x1.evaluate();
            x2 = x2.evaluate();
           
            ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 1), x1));
            ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 2), x2));
           
            return new FiniteSet(x1, x2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.