/**
  * Check if a choice point exists in the store. As a side effect, removes choice points which have
  * been already used and are now empty.
  *
  * @return
  */
 protected boolean existChoicePoint() {
   if (pointer == null) return false;
   ClauseStore clauses;
   do {
     clauses = pointer.compatibleGoals;
     if (clauses.existCompatibleClause()) return true;
     pointer = pointer.prevChoicePointContext;
   } while (pointer != null);
   return false;
 }
Esempio n. 2
0
 /**
  * Load a clause family.
  *
  * @param familyClauses
  */
 public static ClauseStore build(Term goal, List<Var> vars, List<ClauseInfo> familyClauses) {
   ClauseStore clauseStore = new ClauseStore(goal, vars);
   clauseStore.clauses = OneWayList.transform(familyClauses);
   if (clauseStore.clauses == null || !clauseStore.existCompatibleClause()) return null;
   return clauseStore;
 }