public QryResult evaluateBoolean (RetrievalModel r) throws IOException {

    //  Initialization

    allocDaaTPtrs (r);
    QryResult result = new QryResult ();

    //  Sort the arguments so that the shortest lists are first.  This
    //  improves the efficiency of exact-match AND without changing
    //  the result.

    for (int i=0; i<(this.daatPtrs.size()-1); i++) {
    	for (int j=i+1; j<this.daatPtrs.size(); j++) {
    		if (this.daatPtrs.get(i).scoreList.scores.size() > this.daatPtrs.get(j).scoreList.scores.size()) {
		    ScoreList tmpScoreList = this.daatPtrs.get(i).scoreList;
		    this.daatPtrs.get(i).scoreList = this.daatPtrs.get(j).scoreList;
		    this.daatPtrs.get(j).scoreList = tmpScoreList;
	}
      }
    }

    //  Exact-match AND requires that ALL scoreLists contain a
    //  document id.  Use the first (shortest) list to control the
    //  search for matches.

    //  Named loops are a little ugly.  However, they make it easy
    //  to terminate an outer loop from within an inner loop.
    //  Otherwise it is necessary to use flags, which is also ugly.

    DaaTPtr ptr0 = this.daatPtrs.get(0);

    EVALUATEDOCUMENTS:
    for ( ; ptr0.nextDoc < ptr0.scoreList.scores.size(); ptr0.nextDoc ++) {

      int ptr0Docid = ptr0.scoreList.getDocid (ptr0.nextDoc);
      double docScore = 1.0;

      //  Do the other query arguments have the ptr0Docid?

      for (int j=1; j<this.daatPtrs.size(); j++) {

    	  DaaTPtr ptrj = this.daatPtrs.get(j);

			while (true) {
			  if (ptrj.nextDoc >= ptrj.scoreList.scores.size())
			    break EVALUATEDOCUMENTS;		// No more docs can match
			  else
			    if (ptrj.scoreList.getDocid (ptrj.nextDoc) > ptr0Docid)
			      continue EVALUATEDOCUMENTS;	// The ptr0docid can't match.
			  else
			    if (ptrj.scoreList.getDocid (ptrj.nextDoc) < ptr0Docid)
			      ptrj.nextDoc ++;			// Not yet at the right doc.
			  else
			      break;				// ptrj matches ptr0Docid
			}
      }

      //  The ptr0Docid matched all query arguments, so save it.

      result.docScores.add (ptr0Docid, docScore);
    }

    freeDaaTPtrs ();

    return result;
  }