def check_ltl(menv: msat_env, enc: LTLEncoder) -> (Iterable, msat_term, msat_term, msat_term):
    assert menv
    assert isinstance(menv, msat_env)
    assert enc
    assert isinstance(enc, LTLEncoder)
    int_type = msat_get_integer_type(menv)
    real_type = msat_get_rational_type(menv)
    (r2s, x_r2s) = decl_consts(menv, 'r2s', int_type)
    (s2r, x_s2r) = decl_consts(menv, 's2r', int_type)
    (delta, x_delta) = decl_consts(menv, delta_name, real_type)
    sender = Sender('s', menv, enc, r2s, x_r2s, s2r, x_s2r, delta)
    receiver = Receiver('r', menv, enc, s2r, x_s2r, r2s, x_r2s, delta)
    curr2next = {r2s: x_r2s, s2r: x_s2r, delta: x_delta}
    for comp in [sender, receiver]:
        for (s, x_s) in comp.symb2next.items():
            curr2next[s] = x_s
    zero = msat_make_number(menv, '0')
    init = msat_make_and(menv, receiver.init, sender.init)
    trans = msat_make_and(menv, receiver.trans, sender.trans)
    init = msat_make_and(menv, init, msat_make_geq(menv, delta, zero))
    trans = msat_make_and(menv, trans, msat_make_geq(menv, x_delta, zero))
    lhs = msat_make_gt(menv, delta, zero)
    rhs = msat_make_and(menv, msat_make_equal(menv, x_r2s, r2s), msat_make_equal(menv, x_s2r, s2r))
    trans = msat_make_and(menv, trans, msat_make_impl(menv, lhs, rhs))
    lhs = enc.make_G(enc.make_F(msat_make_not(menv, sender.stutter)))
    rhs = enc.make_G(msat_make_impl(menv, sender.wait_ack, enc.make_F(sender.send)))
    ltl = msat_make_impl(menv, lhs, rhs)
    return (TermMap(curr2next), init, trans, ltl)
def check_ltl(menv: msat_env, enc: LTLEncoder) -> (Iterable, msat_term, msat_term, msat_term):
    assert menv
    assert isinstance(menv, msat_env)
    assert enc
    assert isinstance(enc, LTLEncoder)
    int_type = msat_get_integer_type(menv)
    real_type = msat_get_rational_type(menv)
    (r2s, x_r2s) = decl_consts(menv, 'r2s', int_type)
    (s2r, x_s2r) = decl_consts(menv, 's2r', int_type)
    (delta, x_delta) = decl_consts(menv, delta_name, real_type)
    sender = Sender('s', menv, enc, r2s, x_r2s, s2r, x_s2r, delta)
    receiver = Receiver('r', menv, enc, s2r, x_s2r, r2s, x_r2s, delta)
    curr2next = {r2s: x_r2s, s2r: x_s2r, delta: x_delta}
    for comp in [sender, receiver]:
        for (s, x_s) in comp.symb2next.items():
            curr2next[s] = x_s
    zero = msat_make_number(menv, '0')
    init = msat_make_and(menv, receiver.init, sender.init)
    trans = msat_make_and(menv, receiver.trans, sender.trans)
    init = msat_make_and(menv, init, msat_make_geq(menv, delta, zero))
    trans = msat_make_and(menv, trans, msat_make_geq(menv, x_delta, zero))
    lhs = msat_make_gt(menv, delta, zero)
    rhs = msat_make_and(menv, msat_make_equal(menv, x_r2s, r2s), msat_make_equal(menv, x_s2r, s2r))
    trans = msat_make_and(menv, trans, msat_make_impl(menv, lhs, rhs))
    lhs = enc.make_G(enc.make_F(msat_make_not(menv, sender.stutter)))
    rhs = enc.make_G(msat_make_impl(menv, sender.wait_ack, enc.make_F(sender.send)))
    ltl = msat_make_impl(menv, lhs, rhs)
    return (TermMap(curr2next), init, trans, ltl)