import collections.abc
import enum
import nanobind
import pydrake.common
from typing import Any, Callable, ClassVar, overload

CalcMonomialBasisOrderUpToOne: nanobind.nb_func
CalcPolynomialWLowerTriangularPart: nanobind.nb_func
DecomposeAffineExpression: nanobind.nb_func
DecomposeAffineExpressions: nanobind.nb_func
DecomposeL2NormExpression: nanobind.nb_func
DecomposeLinearExpressions: nanobind.nb_func
DecomposeLumpedParameters: nanobind.nb_func
DecomposeQuadraticPolynomial: nanobind.nb_func
Evaluate: nanobind.nb_func
EvenDegreeMonomialBasis: nanobind.nb_func
ExtractVariablesFromExpression: nanobind.nb_func
GetVariableVector: nanobind.nb_func
IsAffine: nanobind.nb_func
Jacobian: nanobind.nb_func
MakeMatrixBinaryVariable: nanobind.nb_func
MakeMatrixBooleanVariable: nanobind.nb_func
MakeMatrixContinuousVariable: nanobind.nb_func
MakeMatrixVariable: nanobind.nb_func
MakeVectorBinaryVariable: nanobind.nb_func
MakeVectorBooleanVariable: nanobind.nb_func
MakeVectorContinuousVariable: nanobind.nb_func
MakeVectorVariable: nanobind.nb_func
MonomialBasis: nanobind.nb_func
OddDegreeMonomialBasis: nanobind.nb_func
ReplaceBilinearTerms: nanobind.nb_func
Substitute: nanobind.nb_func
SubstituteStereographicProjection: nanobind.nb_func
TaylorExpand: nanobind.nb_func
ToLatex: nanobind.nb_func
abs: nanobind.nb_func
acos: nanobind.nb_func
arccos: nanobind.nb_func
arcsin: nanobind.nb_func
arctan: nanobind.nb_func
arctan2: nanobind.nb_func
asin: nanobind.nb_func
atan: nanobind.nb_func
atan2: nanobind.nb_func
ceil: nanobind.nb_func
cos: nanobind.nb_func
cosh: nanobind.nb_func
exp: nanobind.nb_func
floor: nanobind.nb_func
forall: nanobind.nb_func
from_sympy: Callable
if_then_else: nanobind.nb_func
intersect: nanobind.nb_func
inv: nanobind.nb_func
isnan: nanobind.nb_func
log: nanobind.nb_func
logical_and: Callable
logical_not: nanobind.nb_func
logical_or: Callable
max: nanobind.nb_func
min: nanobind.nb_func
positive_semidefinite: nanobind.nb_func
pow: nanobind.nb_func
sin: nanobind.nb_func
sinh: nanobind.nb_func
sqrt: nanobind.nb_func
tan: nanobind.nb_func
tanh: nanobind.nb_func
to_sympy: Callable
uninterpreted_function: nanobind.nb_func

class Expression:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, constant: float) -> None: ...
    @overload
    def __init__(self, var: Variable) -> None: ...
    def Differentiate(self, x: Variable) -> Expression: ...
    def EqualTo(self, arg: Expression) -> bool: ...
    @overload
    def Evaluate(self, env: collections.abc.Mapping[Variable, float] = ..., generator: pydrake.common.RandomGenerator | None = ...) -> float: ...
    @overload
    def Evaluate(self, generator: pydrake.common.RandomGenerator | None) -> float: ...
    def EvaluatePartial(self, env: collections.abc.Mapping[Variable, float]) -> Expression: ...
    def Expand(self) -> Expression: ...
    def GetFreeVariables(self) -> Variables: ...
    def GetVariables(self) -> Variables: ...
    def Jacobian(self, *args, **kwargs): ...
    @overload
    def Substitute(self, var: Variable, e: Expression) -> Expression: ...
    @overload
    def Substitute(self, s: collections.abc.Mapping[Variable, Expression]) -> Expression: ...
    def Unapply(self) -> object: ...
    def abs(self) -> Expression: ...
    def acos(self) -> Expression: ...
    def arccos(self) -> Expression: ...
    def arcsin(self) -> Expression: ...
    def arctan(self) -> Expression: ...
    @overload
    def arctan2(self, x: Expression) -> Expression: ...
    @overload
    def arctan2(self, y, x) -> Any: ...
    def asin(self) -> Expression: ...
    def atan(self) -> Expression: ...
    @overload
    def atan2(self, x: Expression) -> Expression: ...
    @overload
    def atan2(self, y, x) -> Any: ...
    def ceil(self) -> Expression: ...
    def cos(self) -> Expression: ...
    def cosh(self) -> Expression: ...
    def exp(self) -> Expression: ...
    def floor(self) -> Expression: ...
    def get_kind(self) -> ExpressionKind: ...
    def is_polynomial(self) -> bool: ...
    def log(self) -> Expression: ...
    def max(self, arg: Expression) -> Expression: ...
    def min(self, arg: Expression) -> Expression: ...
    def pow(self, arg: float) -> Expression: ...
    def sin(self) -> Expression: ...
    def sinh(self) -> Expression: ...
    def sqrt(self) -> Expression: ...
    def tan(self) -> Expression: ...
    def tanh(self) -> Expression: ...
    def to_string(self) -> str: ...
    def __abs__(self) -> Expression: ...
    def __add__(self, arg: Expression) -> Expression: ...
    def __ceil__(self) -> Expression: ...
    @overload
    def __copy__(self) -> Expression: ...
    @overload
    def __copy__(self) -> Expression: ...
    def __deepcopy__(self, arg: dict) -> Expression: ...
    def __eq__(self, arg: Expression) -> Formula: ...
    def __floor__(self) -> Expression: ...
    def __ge__(self, arg: Expression) -> Formula: ...
    def __gt__(self, arg: Expression) -> Formula: ...
    def __iadd__(self, arg: Expression) -> Expression: ...
    def __imul__(self, arg: Expression) -> Expression: ...
    def __isub__(self, arg: Expression) -> Expression: ...
    def __itruediv__(self, arg: Expression) -> Expression: ...
    def __le__(self, arg: Expression) -> Formula: ...
    def __lt__(self, arg: Expression) -> Formula: ...
    def __mul__(self, arg: Expression) -> Expression: ...
    def __ne__(self, arg: Expression) -> Formula: ...
    def __neg__(self) -> Expression: ...
    def __pos__(self) -> Expression: ...
    def __pow__(self, arg: float) -> Expression: ...
    def __radd__(self, arg: Variable) -> Expression: ...
    def __rmul__(self, arg: Variable) -> Expression: ...
    def __rsub__(self, arg: Variable) -> Expression: ...
    def __rtruediv__(self, arg: Variable) -> Expression: ...
    def __sub__(self, arg: Expression) -> Expression: ...
    def __truediv__(self, arg: Expression) -> Expression: ...

class ExpressionKind(enum.Enum):
    __new__: ClassVar[Callable] = ...
    Abs: ClassVar[ExpressionKind] = ...
    Acos: ClassVar[ExpressionKind] = ...
    Add: ClassVar[ExpressionKind] = ...
    Asin: ClassVar[ExpressionKind] = ...
    Atan: ClassVar[ExpressionKind] = ...
    Atan2: ClassVar[ExpressionKind] = ...
    Ceil: ClassVar[ExpressionKind] = ...
    Constant: ClassVar[ExpressionKind] = ...
    Cos: ClassVar[ExpressionKind] = ...
    Cosh: ClassVar[ExpressionKind] = ...
    Div: ClassVar[ExpressionKind] = ...
    Exp: ClassVar[ExpressionKind] = ...
    Floor: ClassVar[ExpressionKind] = ...
    IfThenElse: ClassVar[ExpressionKind] = ...
    Log: ClassVar[ExpressionKind] = ...
    Max: ClassVar[ExpressionKind] = ...
    Min: ClassVar[ExpressionKind] = ...
    Mul: ClassVar[ExpressionKind] = ...
    NaN: ClassVar[ExpressionKind] = ...
    Pow: ClassVar[ExpressionKind] = ...
    Sin: ClassVar[ExpressionKind] = ...
    Sinh: ClassVar[ExpressionKind] = ...
    Sqrt: ClassVar[ExpressionKind] = ...
    Tan: ClassVar[ExpressionKind] = ...
    Tanh: ClassVar[ExpressionKind] = ...
    UninterpretedFunction: ClassVar[ExpressionKind] = ...
    Var: ClassVar[ExpressionKind] = ...
    _generate_next_value_: ClassVar[Callable] = ...
    _hashable_values_: ClassVar[list] = ...
    _member_map_: ClassVar[dict] = ...
    _member_names_: ClassVar[list] = ...
    _member_type_: ClassVar[type[object]] = ...
    _unhashable_values_: ClassVar[list] = ...
    _unhashable_values_map_: ClassVar[dict] = ...
    _use_args_: ClassVar[bool] = ...
    _value2member_map_: ClassVar[dict] = ...
    _value_repr_: ClassVar[None] = ...
    __nb_enum__: ClassVar[PyCapsule] = ...

class Formula:
    False_: ClassVar[nanobind.nb_func] = ...
    True_: ClassVar[nanobind.nb_func] = ...
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, value: bool) -> None: ...
    @overload
    def __init__(self, var: Variable) -> None: ...
    def EqualTo(self, arg: Formula) -> bool: ...
    def Evaluate(self, env: collections.abc.Mapping[Variable, float] = ...) -> bool: ...
    def GetFreeVariables(self) -> Variables: ...
    @overload
    def Substitute(self, var: Variable, e: Expression) -> Formula: ...
    @overload
    def Substitute(self, var: Variable, e: Variable) -> Formula: ...
    @overload
    def Substitute(self, var: Variable, e: float) -> Formula: ...
    @overload
    def Substitute(self, s: collections.abc.Mapping[Variable, Expression]) -> Formula: ...
    def Unapply(self) -> object: ...
    def get_kind(self) -> FormulaKind: ...
    def to_string(self) -> str: ...
    def __bool__(self) -> bool: ...
    def __eq__(self, arg: Formula) -> bool: ...
    def __hash__(self) -> int: ...
    def __ne__(self, arg: Formula) -> bool: ...
    def __nonzero__(self) -> None: ...

class FormulaKind(enum.Enum):
    __new__: ClassVar[Callable] = ...
    And: ClassVar[FormulaKind] = ...
    Eq: ClassVar[FormulaKind] = ...
    False_: ClassVar[FormulaKind] = ...
    Forall: ClassVar[FormulaKind] = ...
    Geq: ClassVar[FormulaKind] = ...
    Gt: ClassVar[FormulaKind] = ...
    Isnan: ClassVar[FormulaKind] = ...
    Leq: ClassVar[FormulaKind] = ...
    Lt: ClassVar[FormulaKind] = ...
    Neq: ClassVar[FormulaKind] = ...
    Not: ClassVar[FormulaKind] = ...
    Or: ClassVar[FormulaKind] = ...
    PositiveSemidefinite: ClassVar[FormulaKind] = ...
    True_: ClassVar[FormulaKind] = ...
    Var: ClassVar[FormulaKind] = ...
    _generate_next_value_: ClassVar[Callable] = ...
    _hashable_values_: ClassVar[list] = ...
    _member_map_: ClassVar[dict] = ...
    _member_names_: ClassVar[list] = ...
    _member_type_: ClassVar[type[object]] = ...
    _unhashable_values_: ClassVar[list] = ...
    _unhashable_values_map_: ClassVar[dict] = ...
    _use_args_: ClassVar[bool] = ...
    _value2member_map_: ClassVar[dict] = ...
    _value_repr_: ClassVar[None] = ...
    __nb_enum__: ClassVar[PyCapsule] = ...

class Monomial:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, var: Variable) -> None: ...
    @overload
    def __init__(self, var: Variable, exponent: int) -> None: ...
    @overload
    def __init__(self, powers: collections.abc.Mapping[Variable, int]) -> None: ...
    @overload
    def __init__(self, vars, exponents) -> None: ...
    def EqualTo(self, arg: Monomial) -> bool: ...
    def Evaluate(self, env: collections.abc.Mapping[Variable, float]) -> float: ...
    def EvaluatePartial(self, env: collections.abc.Mapping[Variable, float]) -> tuple[float, Monomial]: ...
    def GetVariables(self) -> Variables: ...
    def ToExpression(self) -> Expression: ...
    def degree(self, v: Variable) -> int: ...
    def get_powers(self) -> dict[Variable, int]: ...
    def pow_in_place(self, p: int) -> Monomial: ...
    def total_degree(self) -> int: ...
    def __add__(self, arg: Expression) -> Expression: ...
    def __eq__(self, arg: Monomial) -> bool: ...
    def __hash__(self) -> int: ...
    def __imul__(self, arg: Monomial) -> Monomial: ...
    def __mul__(self, arg: Monomial) -> Monomial: ...
    def __ne__(self, arg: Monomial) -> bool: ...
    def __pow__(self, arg: int) -> Monomial: ...
    def __radd__(self, arg: Expression) -> Expression: ...
    def __rmul__(self, arg: float) -> Polynomial: ...
    def __rsub__(self, arg: Expression) -> Expression: ...
    def __rtruediv__(self, arg: Expression) -> Expression: ...
    def __sub__(self, arg: Expression) -> Expression: ...
    def __truediv__(self, arg: Expression) -> Expression: ...

class Polynomial:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, map: collections.abc.Mapping[Monomial, Expression]) -> None: ...
    @overload
    def __init__(self, m: Monomial) -> None: ...
    @overload
    def __init__(self, e: Expression) -> None: ...
    @overload
    def __init__(self, e: Expression, indeterminates: Variables) -> None: ...
    @overload
    def __init__(self, e: Expression, indeterminates) -> None: ...
    def AddProduct(self, coeff: Expression, m: Monomial) -> Polynomial: ...
    def CoefficientsAlmostEqual(self, p: Polynomial, tolerance: float) -> bool: ...
    def Degree(self, v: Variable) -> int: ...
    def Differentiate(self, x: Variable) -> Polynomial: ...
    def EqualTo(self, arg: Polynomial) -> bool: ...
    def Evaluate(self, env: collections.abc.Mapping[Variable, float]) -> float: ...
    def EvaluateIndeterminates(self, *args, **kwargs): ...
    @overload
    def EvaluatePartial(self, env: collections.abc.Mapping[Variable, float]) -> Polynomial: ...
    @overload
    def EvaluatePartial(self, var: Variable, c: float) -> Polynomial: ...
    def EvaluateWithAffineCoefficients(self, *args, **kwargs): ...
    def Expand(self) -> Polynomial: ...
    @overload
    def Integrate(self, x: Variable) -> Polynomial: ...
    @overload
    def Integrate(self, x: Variable, a: float, b: float) -> Polynomial: ...
    def IsEven(self) -> bool: ...
    def IsOdd(self) -> bool: ...
    def Jacobian(self, *args, **kwargs): ...
    def RemoveTermsWithSmallCoefficients(self, coefficient_tol: float) -> Polynomial: ...
    def Roots(self, *args, **kwargs): ...
    def SetIndeterminates(self, new_indeterminates: Variables) -> None: ...
    def SubstituteAndExpand(self, indeterminate_substitution: collections.abc.Mapping[Variable, Polynomial], substitutions_cached_data: SubstituteAndExpandCacheData | None = ...) -> Polynomial: ...
    def ToExpression(self) -> Expression: ...
    def TotalDegree(self) -> int: ...
    def decision_variables(self) -> Variables: ...
    def indeterminates(self) -> Variables: ...
    @overload
    def monomial_to_coefficient_map(self) -> dict[Monomial, Expression]: ...
    @overload
    def monomial_to_coefficient_map(self) -> Any: ...
    def __add__(self, arg: Polynomial) -> Polynomial: ...
    def __eq__(self, arg: Polynomial) -> Formula: ...
    def __hash__(self) -> int: ...
    def __mul__(self, arg: Polynomial) -> Polynomial: ...
    def __ne__(self, arg: Polynomial) -> Formula: ...
    def __neg__(self) -> Polynomial: ...
    def __pow__(self, arg: int) -> Polynomial: ...
    def __radd__(self, arg: Monomial) -> Polynomial: ...
    def __rmul__(self, arg: Monomial) -> Polynomial: ...
    def __rsub__(self, arg: Monomial) -> Polynomial: ...
    def __rtruediv__(self, arg: float) -> Expression: ...
    def __sub__(self, arg: Polynomial) -> Polynomial: ...
    def __truediv__(self, arg: float) -> Polynomial: ...

class RationalFunction:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, numerator: Polynomial, denominator: Polynomial) -> None: ...
    @overload
    def __init__(self, p: Polynomial) -> None: ...
    @overload
    def __init__(self, m: Monomial) -> None: ...
    @overload
    def __init__(self, c: float) -> None: ...
    @overload
    def __init__(self) -> None: ...
    def EqualTo(self, f: RationalFunction) -> bool: ...
    def Evaluate(self, env: collections.abc.Mapping[Variable, float]) -> float: ...
    def SetIndeterminates(self, new_indeterminates: Variables) -> None: ...
    def ToExpression(self) -> Expression: ...
    def denominator(self) -> Polynomial: ...
    def numerator(self) -> Polynomial: ...
    def __add__(self, arg: RationalFunction) -> RationalFunction: ...
    def __eq__(self, arg: RationalFunction) -> Formula: ...
    def __mul__(self, arg: RationalFunction) -> RationalFunction: ...
    def __ne__(self, arg: RationalFunction) -> Formula: ...
    def __neg__(self) -> RationalFunction: ...
    def __radd__(self, arg: float) -> RationalFunction: ...
    def __rmul__(self, arg: float) -> RationalFunction: ...
    def __rsub__(self, arg: float) -> RationalFunction: ...
    def __rtruediv__(self, arg: float) -> RationalFunction: ...
    def __sub__(self, arg: RationalFunction) -> RationalFunction: ...
    def __truediv__(self, arg: RationalFunction) -> RationalFunction: ...

class SinCos:
    c: Variable
    s: Variable
    type: SinCosSubstitutionType
    def __init__(self, s: Variable, c: Variable, type: SinCosSubstitutionType = ...) -> None: ...

class SinCosSubstitutionType(enum.Enum):
    __new__: ClassVar[Callable] = ...
    _generate_next_value_: ClassVar[Callable] = ...
    _hashable_values_: ClassVar[list] = ...
    _member_map_: ClassVar[dict] = ...
    _member_names_: ClassVar[list] = ...
    _member_type_: ClassVar[type[object]] = ...
    _unhashable_values_: ClassVar[list] = ...
    _unhashable_values_map_: ClassVar[dict] = ...
    _use_args_: ClassVar[bool] = ...
    _value2member_map_: ClassVar[dict] = ...
    _value_repr_: ClassVar[None] = ...
    kAngle: ClassVar[SinCosSubstitutionType] = ...
    kHalfAnglePreferCos: ClassVar[SinCosSubstitutionType] = ...
    kHalfAnglePreferSin: ClassVar[SinCosSubstitutionType] = ...
    __nb_enum__: ClassVar[PyCapsule] = ...

class SubstituteAndExpandCacheData:
    def __init__(self) -> None: ...
    def get_data(self) -> dict[Monomial, Polynomial]: ...

class Variable:
    class Type(enum.Enum):
        __new__: ClassVar[Callable] = ...
        BINARY: ClassVar[Variable.Type] = ...
        BOOLEAN: ClassVar[Variable.Type] = ...
        CONTINUOUS: ClassVar[Variable.Type] = ...
        INTEGER: ClassVar[Variable.Type] = ...
        RANDOM_EXPONENTIAL: ClassVar[Variable.Type] = ...
        RANDOM_GAUSSIAN: ClassVar[Variable.Type] = ...
        RANDOM_UNIFORM: ClassVar[Variable.Type] = ...
        _generate_next_value_: ClassVar[Callable] = ...
        _hashable_values_: ClassVar[list] = ...
        _member_map_: ClassVar[dict] = ...
        _member_names_: ClassVar[list] = ...
        _member_type_: ClassVar[type[object]] = ...
        _unhashable_values_: ClassVar[list] = ...
        _unhashable_values_map_: ClassVar[dict] = ...
        _use_args_: ClassVar[bool] = ...
        _value2member_map_: ClassVar[dict] = ...
        _value_repr_: ClassVar[None] = ...
        __nb_enum__: ClassVar[PyCapsule] = ...
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, name: str, type: Variable.Type = ...) -> None: ...
    def EqualTo(self, arg: Variable) -> bool: ...
    def abs(self) -> Expression: ...
    def acos(self) -> Expression: ...
    def arccos(self) -> Expression: ...
    def arcsin(self) -> Expression: ...
    def arctan(self) -> Expression: ...
    @overload
    def arctan2(self, x: Variable) -> Expression: ...
    @overload
    def arctan2(self, y, x) -> Any: ...
    def asin(self) -> Expression: ...
    def atan(self) -> Expression: ...
    @overload
    def atan2(self, x: Variable) -> Expression: ...
    @overload
    def atan2(self, y, x) -> Any: ...
    def ceil(self) -> Expression: ...
    def cos(self) -> Expression: ...
    def cosh(self) -> Expression: ...
    def exp(self) -> Expression: ...
    def floor(self) -> Expression: ...
    def get_id(self) -> int: ...
    def get_name(self) -> str: ...
    def get_type(self) -> Variable.Type: ...
    def is_dummy(self) -> bool: ...
    def log(self) -> Expression: ...
    def max(self, arg: Variable) -> Expression: ...
    def min(self, arg: Variable) -> Expression: ...
    def pow(self, arg: float) -> Expression: ...
    def sin(self) -> Expression: ...
    def sinh(self) -> Expression: ...
    def sqrt(self) -> Expression: ...
    def tan(self) -> Expression: ...
    def tanh(self) -> Expression: ...
    def __abs__(self) -> Expression: ...
    def __add__(self, arg: Variable) -> Expression: ...
    def __ceil__(self) -> Expression: ...
    def __copy__(self) -> Variable: ...
    def __deepcopy__(self, arg: dict) -> Variable: ...
    def __eq__(self, arg: Expression) -> Formula: ...
    def __floor__(self) -> Expression: ...
    def __ge__(self, arg: Expression) -> Formula: ...
    def __gt__(self, arg: Expression) -> Formula: ...
    def __hash__(self) -> int: ...
    def __le__(self, arg: Expression) -> Formula: ...
    def __lt__(self, arg: Expression) -> Formula: ...
    def __mul__(self, arg: Variable) -> Expression: ...
    def __ne__(self, arg: Expression) -> Formula: ...
    def __neg__(self) -> Expression: ...
    def __pos__(self) -> Expression: ...
    def __pow__(self, arg: float) -> Expression: ...
    def __radd__(self, arg: float) -> Expression: ...
    def __rmul__(self, arg: float) -> Expression: ...
    def __rsub__(self, arg: float) -> Expression: ...
    def __rtruediv__(self, arg: float) -> Expression: ...
    def __sub__(self, arg: Variable) -> Expression: ...
    def __truediv__(self, arg: Variable) -> Expression: ...

class Variables:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, arg) -> None: ...
    def EqualTo(self, arg: Variables) -> bool: ...
    def IsStrictSubsetOf(self, vars: Variables) -> bool: ...
    def IsStrictSupersetOf(self, vars: Variables) -> bool: ...
    def IsSubsetOf(self, vars: Variables) -> bool: ...
    def IsSupersetOf(self, vars: Variables) -> bool: ...
    def empty(self) -> bool: ...
    @overload
    def erase(self, key: Variable) -> int: ...
    @overload
    def erase(self, vars: Variables) -> int: ...
    def include(self, key: Variable) -> bool: ...
    @overload
    def insert(self, var: Variable) -> None: ...
    @overload
    def insert(self, vars: Variables) -> None: ...
    def size(self) -> int: ...
    def to_string(self) -> str: ...
    def __add__(self, arg: Variables) -> Variables: ...
    def __contains__(self, arg: Variable) -> bool: ...
    def __eq__(self, arg: Variables) -> bool: ...
    def __hash__(self) -> int: ...
    def __iter__(self) -> collections.abc.Iterator[Variable]: ...
    def __len__(self) -> int: ...
    def __lt__(self, arg: Variables) -> bool: ...
    def __radd__(self, arg: Variable) -> Variables: ...
    def __sub__(self, arg: Variables) -> Variables: ...
