<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _impl(lexer):
 """Return an Implies expression."""

    p = _sumterm(lexer)

    tok = next(lexer)
    # SUMTERM '=>' IMPL
    if isinstance(tok, OP_rarrow):
        q = _impl(lexer)
        return ('implies', p, q)
    # SUMTERM '<=>' IMPL
    elif isinstance(tok, OP_lrarrow):
        q = _impl(lexer)
        return ('equal', p, q)
    # SUMTERM
    else:
        lexer.unpop_token(tok)
        return p