lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/TermWalkers.java
public static TermWalker goalWalker(UnaryPredicate<Term> unaryPredicate, TermVisitor visitor)
    {
        TermWalker walker = simpleWalker(visitor);
        walker.setGoalPredicate(unaryPredicate);

        return walker;
    }
public static TermWalker goalWalker(UnaryPredicate<Term> unaryPredicate, TermVisitor visitor)
    {
        TermWalker walker = simpleWalker(visitor);
        walker.setGoalPredicate(unaryPredicate);

        return walker;
    }
public static TermWalker goalWalker ( UnaryPredicate < Term > unaryPredicate , TermVisitor visitor ) { TermWalker walker = simpleWalker ( visitor ) ; walker . setGoalPredicate ( unaryPredicate ) ; return walker ; }
Provides a depth first walk over a term, visiting only when a goal predicate matches.

@param  unaryPredicate The goal predicate.
@param  visitor        The visitor to apply to each term.

@return A depth first walk over a term, visiting only when a goal predicate matches.
Provides a depth first walk over a term visiting only when a goal predicate matches .