Examples of Clause


Examples of aima.core.logic.fol.kb.data.Clause

    // Ensure reflexivity axiom is added to usable if using paramodulation.
    if (isUseParamodulation()) {
      // Reflexivity Axiom: x = x
      TermEquality reflexivityAxiom = new TermEquality(new Variable("x"),
          new Variable("x"));
      Clause reflexivityClause = new Clause();
      reflexivityClause.addLiteral(new Literal(reflexivityAxiom));
      reflexivityClause = KB.standardizeApart(reflexivityClause);
      reflexivityClause.setStandardizedApartCheckNotRequired();
      usable.add(reflexivityClause);
    }

    Sentence notAlpha = new NotSentence(alpha);
    // Want to use an answer literal to pull
    // query variables where necessary
    Literal answerLiteral = KB.createAnswerLiteral(notAlpha);
    Set<Variable> answerLiteralVariables = KB
        .collectAllVariables(answerLiteral.getAtomicSentence());
    Clause answerClause = new Clause();

    if (answerLiteralVariables.size() > 0) {
      Sentence notAlphaWithAnswer = new ConnectedSentence(Connectors.OR,
          notAlpha, answerLiteral.getAtomicSentence());
      for (Clause c : KB.convertToClauses(notAlphaWithAnswer)) {
        c = KB.standardizeApart(c);
        c.setProofStep(new ProofStepGoal(c));
        c.setStandardizedApartCheckNotRequired();
        sos.addAll(c.getFactors());
      }

      answerClause.addLiteral(answerLiteral);
    } else {
      for (Clause c : KB.convertToClauses(notAlpha)) {
        c = KB.standardizeApart(c);
        c.setProofStep(new ProofStepGoal(c));
        c.setStandardizedApartCheckNotRequired();
View Full Code Here

Examples of br.com.visualmidia.business.Clause

      addClause("18", "A CONTRATANTE poder� transferir sua vaga a uma pessoa id�nea que dever� assinar um novo contrato junto a CONTRATADA. Neste caso, a CONTRATANTE ser� isenta da multa estipulada por rescis�o descrita neste CONTRATO, obrigando-se a quitar as parcelas vencidas at� a transfer�ncia.", true, true);
      addClause("19", "As diverg�ncias oriundas do presente contrato ser�o dirimidas pelas partes perante o Ju�zo da Comarca de <Localiza��o>.", true, false);
  }

  private void addClause(String id, String clause, boolean isActive, boolean canBeRemoved) {
    Clause clausePersistence = new Clause(id, clause, isActive, canBeRemoved);
    system.execute(new AddClause(clausePersistence));
  }
View Full Code Here

Examples of com.atlassian.query.clause.Clause

        SearchContext searchContext)
    {
        if(query != null && query.getWhereClause() != null)
        {
            boolean result = true;
            Clause whereClause = query.getWhereClause();
            SimpleNavigatorCollectorVisitor collector = new SimpleNavigatorCollectorVisitor(getCustomField().getClauseNames().getJqlFieldNames());
            whereClause.accept(collector);

            List<TerminalClause> clauseList = collector.getClauses();
            for(TerminalClause clause : clauseList)
            {
                if(!hasValidSimpleOperators(clause.getOperator()) || !hasValidSimpleOperand(clause.getOperand()))
View Full Code Here

Examples of com.datastax.driver.core.querybuilder.Clause

            }

            if (list != null)
                list.beforeFetchingNextBatch();
            try {
                Clause inClause = QueryBuilder.in("id", keyStrings);
                //change the batchsize
                Query query = QueryBuilder.select().all().from(keys, cf.getColumnFamily()).where(inClause).limit(100);
                resultSet = session.execute(query);
            } catch (Exception e) {
                System.out.println(" Exception:" + e.getMessage());
View Full Code Here

Examples of com.j256.ormlite.stmt.query.Clause

   * <b>NOTE:</b> I couldn't remove the code warning associated with this method when used with more than 2 arguments.
   * </p>
   */
  public Where<T, ID> and(Where<T, ID> first, Where<T, ID> second, Where<T, ID>... others) {
    Clause[] clauses = buildClauseArray(others, "AND");
    Clause secondClause = pop("AND");
    Clause firstClause = pop("AND");
    addClause(new ManyClause(firstClause, secondClause, clauses, ManyClause.AND_OPERATION));
    return this;
  }
View Full Code Here

Examples of com.j256.ormlite.stmt.query.Clause

   * <b>NOTE:</b> I can't remove the code warning associated with this method. Use the iterator method below.
   * </p>
   */
  public Where<T, ID> or(Where<T, ID> left, Where<T, ID> right, Where<T, ID>... others) {
    Clause[] clauses = buildClauseArray(others, "OR");
    Clause secondClause = pop("OR");
    Clause firstClause = pop("OR");
    addClause(new ManyClause(firstClause, secondClause, clauses, ManyClause.OR_OPERATION));
    return this;
  }
View Full Code Here

Examples of com.j256.ormlite.stmt.query.Clause

  @Override
  public String toString() {
    if (clauseStackLevel == 0) {
      return "empty where clause";
    } else {
      Clause clause = peek();
      return "where clause: " + clause;
    }
  }
View Full Code Here

Examples of com.j256.ormlite.stmt.query.Clause

  private Clause pop(String label) {
    if (clauseStackLevel == 0) {
      throw new IllegalStateException("Expecting there to be a clause already defined for '" + label
          + "' operation");
    }
    Clause clause = clauseStack[--clauseStackLevel];
    // to help gc
    clauseStack[clauseStackLevel] = null;
    return clause;
  }
View Full Code Here

Examples of kodkod.engine.satlab.Clause

        final IntSet varReachable = new IntBitSet(var+1);
        varReachable.add(var);
        hits.put(var, varReachable);
      }
      for(Iterator<Clause> clauseItr = trace.reverseIterator(trace.axioms()); clauseItr.hasNext();) {
        final Clause clause = clauseItr.next();
        final int maxVar = clause.maxVariable();
        for(IntSet reachableVars : hits.values()) {
          if (reachableVars.contains(maxVar)) {
            for(IntIterator lits = clause.literals(); lits.hasNext(); ) {
              reachableVars.add(StrictMath.abs(lits.next()));
            }
          }
        }
      }
    }
   
    final long[] counts = new long[hits.size()];
   
    for(Iterator<Clause> clauseItr = trace.iterator(trace.core()); clauseItr.hasNext(); ) {
      final Clause clause = clauseItr.next();
      final int maxVar = clause.maxVariable();
      int i = 0;
      for(IntSet reachableVars : hits.values()) {
        if (reachableVars.contains(maxVar)) {
          counts[i]++;
        }
View Full Code Here

Examples of net.nutch.searcher.Query.Clause

    throws QueryException {
   
    // examine each clause in the Nutch query
    Clause[] clauses = input.getClauses();
    for (int i = 0; i < clauses.length; i++) {
      Clause c = clauses[i];

      // skip non-matching clauses
      if (!c.getField().equals(field))
        continue;

      // optimize phrase clause
      if (c.isPhrase()) {
        String[] opt = CommonGrams.optimizePhrase(c.getPhrase(), field);
        if (opt.length==1) {
          c = new Clause(new Query.Term(opt[0]),
                         c.isRequired(), c.isProhibited());
        } else {
          c = new Clause(new Phrase(opt), c.isRequired(), c.isProhibited());
        }
      }

      // construct appropriate Lucene clause
      org.apache.lucene.search.Query luceneClause;
      if (c.isPhrase()) {
        Phrase nutchPhrase = c.getPhrase();
        Query.Term[] terms = nutchPhrase.getTerms();
        PhraseQuery lucenePhrase = new PhraseQuery();
        for (int j = 0; j < terms.length; j++) {
          lucenePhrase.add(new Term(field, terms[j].toString()));
        }
        luceneClause = lucenePhrase;
      } else {
        luceneClause = new TermQuery(new Term(field, c.getTerm().toString()));
      }

      // set boost
      luceneClause.setBoost(boost);
      // add it as specified in query
      output.add(luceneClause, c.isRequired(), c.isProhibited());
    }
   
    // return the modified Lucene query
    return output;
  }
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.