lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/DynamicOperatorParser.java
protected static OpSymbol checkAndResolveToFixity(CandidateOpSymbol candidate, OpSymbol.Fixity... fixities)
        throws SourceCodeException
    {
        OpSymbol result = null;

        for (OpSymbol.Fixity fixity : fixities)
        {
            result = candidate.getPossibleOperators().get(fixity);

            if (result != null)
            {
                break;
            }
        }

        if (result == null)
        {
            throw new SourceCodeException("Operator " + candidate + " must be one of " + Arrays.toString(fixities) +
                ", but does not have the required form.", null, null, null, candidate.getSourceCodePosition());
        }

        return result;
    }
protected static OpSymbol checkAndResolveToFixity(CandidateOpSymbol candidate, OpSymbol.Fixity... fixities)
        throws SourceCodeException
    {
        OpSymbol result = null;

        for (OpSymbol.Fixity fixity : fixities)
        {
            result = candidate.getPossibleOperators().get(fixity);

            if (result != null)
            {
                break;
            }
        }

        if (result == null)
        {
            throw new SourceCodeException("Operator " + candidate + " must be one of " + Arrays.toString(fixities) +
                ", but does not have the required form.", null, null, null, candidate.getSourceCodePosition());
        }

        return result;
    }
Checks if a candidate operator symbol can have one of the specified fixities, and resolve it to an oeprator with
that fixity if so. If it cannot be resolved an exception is raised.

@param  candidate The candidate operator symbol to resolve.
@param  fixities  The possible fixities to resolve the symbol to.

@return The candidate operator resolved to an actual operator.

@throws SourceCodeException If the candidate operator cannot be resolved.