Esempio n. 1
0
 public void updateListNewCons(Collection<Clause> newCsq) {
   try {
     if (newConsAsAxiom) {
       // remove old csq submused by new ones
       CNF updatedList;
       updatedList = pruneWith(listCsq, newCsq);
       // prune receivedCl
       receivedCl = pruneWith(receivedCl, newCsq);
       // add new cons
       updatedList.addAll(newCsq);
       // store update
       listCsq = updatedList;
     } else {
       // remove old csq submused by new ones
       CNF updatedList = pruneWith(listCsq, newCsq);
       // add new cons
       updatedList.addAll(newCsq);
       // store update while pruning with receivedCl
       listCsq = updatedList;
       // pruneWith(updatedList, receivedCl);
     }
   } catch (ParseException e) {
     // never happens
     e.printStackTrace();
   }
   if (verbose) {
     System.out.println(this + ": updated receivedCl " + receivedCl);
     System.out.println("updated lstCsq " + listCsq);
   }
 }
Esempio n. 2
0
 public boolean isPossibleOutput(Clause cl) {
   boolean out = false;
   try {
     out = IndepPField.belongsTo(getEnv(), theory.getPField(), cl);
   } catch (ParseException e) {
     // Never happens
     e.printStackTrace();
   }
   return out;
 }
Esempio n. 3
0
 public boolean canResolve(CanalComm target, Clause cl) {
   PField pf = inputLanguages.get(target);
   boolean out = false;
   try {
     out = IndepPField.partlyBelongsTo(getEnv(), pf, cl);
   } catch (ParseException e) {
     // Never happens
     e.printStackTrace();
   }
   return out;
 }
Esempio n. 4
0
 /**
  * Compares its two arguments for order.
  *
  * @param sig1 the first object to be compared.
  * @param sig2 the second object to be compared.
  * @return a negative integer, zero, or a positive integer as the first argument is less than,
  *     equal to, or greater than the second.
  */
 public int compare(IndepClause cl1, IndepClause cl2) {
   double comp;
   try {
     double w1 = computeWeight(cl1);
     double w2 = computeWeight(cl2);
     comp = w2 - w1;
     return (int) Math.signum(comp);
   } catch (ParseException e) {
     e.printStackTrace();
     return 100;
   }
 }