lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/PrologParser.java
public Clause clause() throws SourceCodeException
    {
        // Each new sentence provides a new scope in which to make variables unique.
        variableContext.clear();

        Term term = term();

        Clause clause = TermUtils.convertToClause(term, interner);

        if (clause == null)
        {
            throw new SourceCodeException("Only queries and clauses are valid sentences in Prolog, not " + term + ".",
                null, null, null, term.getSourceCodePosition());
        }

        return clause;
    }
public Clause clause() throws SourceCodeException
    {
        // Each new sentence provides a new scope in which to make variables unique.
        variableContext.clear();

        Term term = term();

        Clause clause = TermUtils.convertToClause(term, interner);

        if (clause == null)
        {
            throw new SourceCodeException("Only queries and clauses are valid sentences in Prolog, not " + term + ".",
                null, null, null, term.getSourceCodePosition());
        }

        return clause;
    }
Parses a single sentence in first order logic. A sentence consists of a term followed by a full stop.

@return A sentence in first order logic.

@throws SourceCodeException If the token sequence does not parse into a valid sentence.