lojix/prolog/src/main/com/thesett/aima/logic/fol/prolog/PrologResolver.java
public Set<Variable> resolve()
    {
        // Find all free variables in the query.
        Set<Variable> freeVars = TermUtils.findFreeNonAnonymousVariables(currentQuery);

        // Used to collect the results in.
        Set<Variable> results = null;

        // Search for the next available solution.
        SearchNode solution;

        try
        {
            solution = findGoalPath();
        }
        catch (SearchNotExhaustiveException e)
        {
            // The search may fail if the maximum number of search steps is reached. This limit is not turned on by
            // default. If this happens, null is returned, indicating that no solution was found.
            // Exception ignored as empty search results are noted and dealt with by returning null.
            e = null;
            solution = null;
            results = null;
        }

        // Check that a solution was found and return the variable bindings from it if so. Only the variable bindings
        // that were free and non-anonymous in the original query are returned.
        if (solution != null)
        {
            results = new HashSet<Variable>(freeVars);
        }

        return results;
    }
public Set<Variable> resolve()
    {
        // Find all free variables in the query.
        Set<Variable> freeVars = TermUtils.findFreeNonAnonymousVariables(currentQuery);

        // Used to collect the results in.
        Set<Variable> results = null;

        // Search for the next available solution.
        SearchNode solution;

        try
        {
            solution = findGoalPath();
        }
        catch (SearchNotExhaustiveException e)
        {
            // The search may fail if the maximum number of search steps is reached. This limit is not turned on by
            // default. If this happens, null is returned, indicating that no solution was found.
            // Exception ignored as empty search results are noted and dealt with by returning null.
            e = null;
            solution = null;
            results = null;
        }

        // Check that a solution was found and return the variable bindings from it if so. Only the variable bindings
        // that were free and non-anonymous in the original query are returned.
        if (solution != null)
        {
            results = new HashSet<Variable>(freeVars);
        }

        return results;
    }
{@inheritDoc}