Determine which parameters are contained in this expression.

    :param Expression expression: expression involving parameters
    :return: set of parameters contained in this expression
    :rtype: set

def _contained_parameters(expression):
    """
    Determine which parameters are contained in this expression.

    :param Expression expression: expression involving parameters
    :return: set of parameters contained in this expression
    :rtype: set
    """
    if isinstance(expression, BinaryExp):
        return _contained_parameters(expression.op1) | _contained_parameters(expression.op2)
    elif isinstance(expression, Function):
        return _contained_parameters(expression.expression)
    elif isinstance(expression, Parameter):
        return {expression}
    else:
        return set()