lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java
protected void leaveClause(Clause clause)
    {
        // Remove the set of constants appearing in argument positions, from the set of all constants, to derive
        // the set of constants that appear in non-argument positions only.
        constants.keySet().removeAll(argumentConstants);

        // Set the nonArgPosition flag on all symbol keys for all constants that only appear in non-arg positions.
        for (List<SymbolKey> symbolKeys : constants.values())
        {
            for (SymbolKey symbolKey : symbolKeys)
            {
                symbolTable.put(symbolKey, SymbolTableKeys.SYMKEY_FUNCTOR_NON_ARG, true);
            }
        }
    }
protected void leaveClause(Clause clause)
    {
        // Remove the set of constants appearing in argument positions, from the set of all constants, to derive
        // the set of constants that appear in non-argument positions only.
        constants.keySet().removeAll(argumentConstants);

        // Set the nonArgPosition flag on all symbol keys for all constants that only appear in non-arg positions.
        for (List<SymbolKey> symbolKeys : constants.values())
        {
            for (SymbolKey symbolKey : symbolKeys)
            {
                symbolTable.put(symbolKey, SymbolTableKeys.SYMKEY_FUNCTOR_NON_ARG, true);
            }
        }
    }
Upon leaving the clause, sets the nonArgPosition flag on any constants that need it.

@param clause The clause being left.