Package lupos.rif.model

Examples of lupos.rif.model.Disjunction


        conj.addExpr((IExpression) node.accept(this, conj));
      return conj;
    case 1:
      final NodeListOptional orFormulas = (NodeListOptional) ((List<INode>) n.f0.choice
          .accept(this, argu)).get(2);
      final Disjunction disj = new Disjunction();
      disj.setParent(argu);
      for (final INode node : (List<INode>) orFormulas.accept(this, disj))
        disj.addExpr((IExpression) node.accept(this, disj));
      return disj;
    case 2:
      final List<INode> existINodes = (List<INode>) n.f0.choice.accept(
          this, argu);
      final ExistExpression exists = new ExistExpression();
View Full Code Here


      result.exprs.add((IExpression) expr.accept(this, result));
    return result;
  }

  public IRuleNode visit(Disjunction obj, IRuleNode arg) throws RIFException {
    final Disjunction result = new Disjunction();
    result.setParent(arg);
    List<IExpression> exprs = new ArrayList<IExpression>(obj.exprs);
    for (IExpression expr : exprs)
      result.exprs.add((IExpression) expr.accept(this, result));
    return result;
  }
View Full Code Here

      IExpression conjunct = conjuncts.get(i);

      if (j < conjuncts.size()) {
        // And(F1 F2 ... Fi Or(G1, ..., Gm) Fi+2 Fi+3 ... Fn)
        if (conjuncts.get(j) instanceof Disjunction) {
          Disjunction orConjunct = (Disjunction) conjuncts.get(j);

          List<IExpression> andFormulas = new ArrayList<IExpression>();

          // And(Fi G1) ... And(Fi Gm)
          for (IExpression disjunct : orConjunct.exprs) {
            List<IExpression> formulas = new ArrayList<IExpression>();
            // TODO: Parent
            formulas.add((IExpression) conjunct.accept(this, null));
            formulas.add((IExpression) disjunct.accept(this, null));

            Conjunction temp = new Conjunction();
            temp.exprs.addAll(formulas);
            andFormulas.add(temp);
          }

          // Or(And(Fi G1) ... And(Fi Gm))
          Disjunction orFormula = new Disjunction();
          orFormula.exprs.addAll(andFormulas);

          // normalize(Or(And(Fi G1) ... And(Fi Gm)))
          // TODO: Parent
          newConjuncts
              .add((IExpression) orFormula.accept(this, null));

          hasChanged = true;

          i++;
        } else {
View Full Code Here

TOP

Related Classes of lupos.rif.model.Disjunction

Copyright © 2018 www.massapicom. 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.