lojix/prolog/src/main/com/thesett/aima/logic/fol/prolog/builtins/Unifies.java
public boolean proofStep(ResolutionState state)
    {
        Functor goalTerm = state.getGoalStack().poll().getFunctor();

        Term leftArg = goalTerm.getArgument(0);
        Term rightArg = goalTerm.getArgument(1);

        // This is used to record variables bound during the unification, so that they may be undone if the resolution
        // state is backtracked over.
        List<Variable> boundVariables = new LinkedList<Variable>();

        // Unify the current query goal with the possibly matching clause, creating variable bindings.
        boolean matched = state.getUnifier().unifyInternal(leftArg, rightArg, boundVariables, boundVariables);

        if (matched)
        {
            if (TRACE)
            {
                /*trace.fine(state.getTraceIndenter().generateTraceIndent() + "Unify " +
                    leftArg.toString(state.getInterner(), true, true) + " against " +
                    rightArg.toString(state.getInterner(), true, true) + ", ok.");*/
            }

            for (Variable binding : boundVariables)
            {
                state.getVariableBindings().offer(binding);
            }
        }

        return matched;
    }
public boolean proofStep(ResolutionState state)
    {
        Functor goalTerm = state.getGoalStack().poll().getFunctor();

        Term leftArg = goalTerm.getArgument(0);
        Term rightArg = goalTerm.getArgument(1);

        // This is used to record variables bound during the unification, so that they may be undone if the resolution
        // state is backtracked over.
        List<Variable> boundVariables = new LinkedList<Variable>();

        // Unify the current query goal with the possibly matching clause, creating variable bindings.
        boolean matched = state.getUnifier().unifyInternal(leftArg, rightArg, boundVariables, boundVariables);

        if (matched)
        {
            if (TRACE)
            {
                /*trace.fine(state.getTraceIndenter().generateTraceIndent() + "Unify " +
                    leftArg.toString(state.getInterner(), true, true) + " against " +
                    rightArg.toString(state.getInterner(), true, true) + ", ok.");*/
            }

            for (Variable binding : boundVariables)
            {
                state.getVariableBindings().offer(binding);
            }
        }

        return matched;
    }
{@inheritDoc}