'Deduces type primarily from ``symbol``, secondarily from ``value``.
Examples
>>> from sympy import Symbol
>>> from sympy.codegen.ast import Declaration, real, integer
>>> x = Symbol(\'x\', real=True)
>>> decl = Declaration.deduced(x)
>>> decl.variable.type == real
True
>>> decl.value is None
True
>>> n = Symbol(\'n\', integer=True)
>>> Declaration.deduced(n).variable
Variable(n, EmptySet(), IntBaseType(name=\'integer\'))'

@classmethod
def deduced(cls, symbol, value=None, attrs=FiniteSet(), **kwargs):

    try:
        type_ = Type.from_expr(symbol)
    except ValueError:
        type_ = Type.from_expr(value)
    var = Variable(symbol, attrs, type_)
    return cls(var, value, **kwargs)
