Examples of Negation


Examples of jmathexpr.arithmetic.op.Negation

                ANumber d = (ANumber) dd;
               
                if (d.isNegative()) {
                    return new EmptySet();
                } else if (d.isZero()) {
                    return new FiniteSet(new Division(new Negation(b),
                            new Multiplication(two, a)).evaluate());
                }
            }
           
            Expression sd = new Sqrt(dd);
            Expression x1 = new Division(
                    new Addition(new Negation(b), sd),
                    new Multiplication(two, a));
            Expression x2 = new Division(
                    new Subtraction(new Negation(b), sd),
                    new Multiplication(two, a));
           
            ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 1), x1));
            ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 2), x2));
           
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

            return n.matches(Naturals.zero());
        } else if (matchesPower(expr)) { // P = x or x^n
            return coeff.matches(Naturals.one());
        } else if (expr instanceof Negation) { // P = -(Q)
            if (matches(((Negation) expr).getChild())) {
                return coeff.matches(new Negation(coeff.hit()).evaluate());
            }
        } else {
            FunctionPattern f = new FunctionPattern(x);
            Negation nf = new Negation(f);
           
            if (nf.matches(expr) && matchesPower(f.hit())) {
                return coeff.matches(Integers.getInstance().create(-1));
            }
           
            Multiplication ax = new Multiplication(coeff, f);
           
View Full Code Here

Examples of jmathexpr.arithmetic.op.Negation

        Expression arg = stack.pop();
       
        if (arg instanceof ANumber) {
            stack.push(((ANumber) arg).negate());
        } else {
            stack.push(new Negation(arg));
        }
    }
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.Negation

        while (tokens.matchesAnyOf("+", "-")) {
            if (tokens.canConsume("-")) negative = true;
            tokens.canConsume("+");
        }
        Component result = parseUnionExpr(tokens);
        return negative ? new Negation(result) : result;
    }
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.Negation

        while (tokens.matchesAnyOf("+", "-")) {
            if (tokens.canConsume("-")) negative = true;
            tokens.canConsume("+");
        }
        Component result = parseUnionExpr(tokens);
        return negative ? new Negation(result) : result;
    }
View Full Code Here

Examples of stanfordlogic.prover.Negation

        // First: check to see if this is a logical operator, i.e. one of not/or/and
       
        if ( relName == parser_.TOK_NOT_OP )
        {
            // The next element must be a sentence
            return new Negation( examineRelation(relation.getElement(1) ) );
        }
           
        else if ( relName == parser_.TOK_OR_OP )
        {
            // all the rest of the elements are relations (sentences), not terms.
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.