code: private void encodeRecursive() {
      boolean isExactlyOne = false;
      while (this.currentLiterals.size() > this.k) {
        this.literals.clear();
        this.nextLiterals.clear();
        for (int i = 0; i < this.currentLiterals.size(); i++) {
          this.literals.push(this.currentLiterals.get(i));
          if (i % this.k == this.k - 1 || i == this.currentLiterals.size() - 1) {
            this.encodeNonRecursive(this.literals);
            this.literals.push(this.result.newVariable());
            this.nextLiterals.push(this.literals.back().negate());
            if (isExactlyOne && this.literals.size() > 0)
              this.result.addClause(this.literals);
            for (int j = 0; j < this.literals.size() - 1; j++)
              this.result.addClause(this.literals.back().negate(), this.literals.get(j).negate());
            this.literals.clear();
          }
        }
        this.currentLiterals.replaceInplace(this.nextLiterals);
        isExactlyOne = true;
      }
      this.encodeNonRecursive(this.currentLiterals);
      if (isExactlyOne && this.currentLiterals.size() > 0)
        this.result.addClause(this.currentLiterals);
    }
docs: Internal recursive encoding.