from collections.abc import Generator
from typing import Any, Callable

from sympy import Basic
from sympy.unify.core import Compound, CondVariable, Variable

basic_new_legal = ...
eval_false_legal = ...
illegal = ...

def sympy_associative(op) -> bool: ...
def sympy_commutative(op) -> bool: ...
def is_associative(x) -> bool: ...
def is_commutative(x) -> bool | None: ...
def mk_matchtype(typ) -> Callable[..., bool]: ...
def deconstruct(s, variables=...) -> Variable | CondVariable | Basic | Compound: ...
def construct(t) -> Any: ...
def rebuild(s) -> Any | Basic: ...
def unify(x, y, s=..., variables=..., **kwargs) -> Generator[dict[Any, Any], Any, None]: ...
