lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/InstructionCompiler.java
private int findMaxArgumentsInClause(Clause clause)
    {
        int result = 0;

        Functor head = clause.getHead();

        if (head != null)
        {
            result = head.getArity();
        }

        Functor[] body = clause.getBody();

        if (body != null)
        {
            for (int i = 0; i < body.length; i++)
            {
                int arity = body[i].getArity();
                result = (arity > result) ? arity : result;
            }
        }

        return result;
    }
private int findMaxArgumentsInClause(Clause clause)
    {
        int result = 0;

        Functor head = clause.getHead();

        if (head != null)
        {
            result = head.getArity();
        }

        Functor[] body = clause.getBody();

        if (body != null)
        {
            for (int i = 0; i < body.length; i++)
            {
                int arity = body[i].getArity();
                result = (arity > result) ? arity : result;
            }
        }

        return result;
    }
Examines all top-level functors within a clause, including any head and body, and determines which functor has
the highest number of arguments.

@param  clause The clause to determine the highest number of arguments within.

@return The highest number of arguments within any top-level functor in the clause.