Пример #1
0
def zero_canon(expr, real_args, imag_args, real2imag):
    if imag_args[0] is None:
        return [expr.copy(real_args)], None

    imag_cons = [Zero(imag_args[0], constr_id=real2imag[expr.id])]
    if real_args[0] is None:
        return None, imag_cons
    else:
        return [expr.copy(real_args)], imag_cons
Пример #2
0
def lower_equality(equality):
    lhs = equality.args[0]
    rhs = equality.args[1]
    return Zero(lhs - rhs, constr_id=equality.constr_id)
Пример #3
0
def zero_constr_canon(expr, args):
    assert len(args) == 2
    return Zero(args[0] - args[1], constr_id=expr.id), []