def eq_assoc(u, v, eq=core.eq, n=None):
    """ Goal for associative equality

    >>> from logpy import run, var, fact
    >>> from logpy.assoccomm import eq_assoc as eq

    >>> fact(commutative, 'add')    # declare that 'add' is commutative
    >>> fact(associative, 'add')    # declare that 'add' is associative

    >>> x = var()
    >>> run(0, x, eq(('add', 1, 2, 3), ('add', 1, x)))
    (('add', 2, 3),)
    """
    uop, uargs = op_args(u)
    vop, vargs = op_args(v)
    if uop or vop:
        return conde([(core.eq, u, v)],
                     [(eq, uop, vop), (associative, uop),
                      lambda s: assocunify(u, v, s, eq, n)])

    if uop or vop:
        if vop:
            uop, vop = vop, uop
            uargs, vargs = vargs, uargs
            v, u = u, v
        return conde([(core.eq, u, v)],
                     [(associative, uop),
                      lambda s: assocunify(u, v, s, eq, n)])

    return (core.eq, u, v)
dataset/ETHPy150Open logpy/logpy/logpy/assoccomm.py/eq_assoc/operator `and` -> `or`