code: public int buildProtoNetwork(final ProtoNetwork pn, final Term term) {
          int ti = pn.getTermTable().addTerm(term);
  
          List<Integer> pvals = new ArrayList<Integer>();
          List<Parameter> ps = term.getAllParametersLeftToRight();
  
          for (Parameter p : ps) {
              pvals.add(handleParameter(pn, p));
          }
  
          TermParameterMapTable tpmt = pn.getTermParameterMapTable();
          if (!tpmt.getTermParameterIndex().containsKey(ti)) {
              tpmt.addTermParameterMapping(ti, pvals);
          }
  
          return ti;
      }
docs: Builds the {@link ProtoNetwork} at the {@link Term} level. The found
  parameters are handled via
  {@link #handleParameter(ProtoNetwork, Parameter)} and indexed against the
  term.
  
  @param pn {@link ProtoNetwork}, the proto network
  @param term {@link Term}, the term to evaluate
  @return {@code int}, the term index in the {@link TermTable}