lojix/logic/src/main/com/thesett/aima/logic/fol/Cons.java
private String listToString(VariableAndFunctorInterner interner, boolean isFirst, boolean printVarName,
        boolean printBindings)
    {
        String result = "";

        if (isFirst)
        {
            result += "[";
        }

        result += arguments[0].toString(interner, printVarName, printBindings);

        Term consArgument = arguments[1].getValue();

        if (consArgument instanceof Cons)
        {
            result += ", " + ((Cons) consArgument).listToString(interner, false, printVarName, printBindings);
        }

        if (isFirst)
        {
            result += "]";
        }

        return result;
    }
private String listToString(VariableAndFunctorInterner interner, boolean isFirst, boolean printVarName,
        boolean printBindings)
    {
        String result = "";

        if (isFirst)
        {
            result += "[";
        }

        result += arguments[0].toString(interner, printVarName, printBindings);

        Term consArgument = arguments[1].getValue();

        if (consArgument instanceof Cons)
        {
            result += ", " + ((Cons) consArgument).listToString(interner, false, printVarName, printBindings);
        }

        if (isFirst)
        {
            result += "]";
        }

        return result;
    }
Pretty prints a term relative to the symbol namings provided by the specified interner.

@param  interner      The interner use to provide symbol names.
@param  isFirst       <tt>true</tt> if this is the first cons in a list, <tt>false</tt> otherwise.
@param  printVarName  <tt>true</tt> if the names of bound variables should be printed, <tt>false</tt> if just the
binding without the variable name should be printed.
@param  printBindings <tt>true</tt> if variable binding values should be printed, <tt>false</tt> if just the
variables name without any binding should be printed.

@return A pretty printed string containing the term.