import z3

from common.axioms import semi_linear_weak_order

from . import Node, left, prec, right


def simple_tree() -> z3.BoolRef:
    x, y, z = z3.Consts("x y z", Node)
    return z3.And(
        semi_linear_weak_order(prec),
        z3.ForAll(
            x,
            z3.And(
                x != left(x),
                prec(x, left(x)),
                x != right(x),
                prec(x, right(x)),
                left(x) != right(x),
                z3.Not(prec(left(x), right(x))),
                z3.Not(prec(right(x), left(x))),
            ),
        ),
    )
