#18832: non-numeric non-symbolic BuiltinFunction arguments
-----------------------------+------------------------
       Reporter:  rws        |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-6.8
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+------------------------
Description changed by rws:

Old description:

> Symbolic expressions can be seen as programs for applying functions to
> numerics and symbolics. Non-numeric non-symbolics (NNNS, most of the rest
> of Sage) are usually not handled by symbolic functions, although they
> often allow the same operations and many of the functions. The manual
> workaround is to evaluate the expression "on `x`" and then to substitute
> `x` with the respective NNNS. We propose that `BuiltinFunction` automates
> this process.
>
> Part of this is already duplicated in `rings.arith` but the need arises
> with symbolic functions returning polynomials, e.g. #16813. At the moment
> `BuiltinFunction` simply converts the NNNS argument, losing the type
> information.
>
> Practically, `BuiltinFunction` should eval with `x`, try substitution,
> and throw an error if the substitution leads to unknown methods of the
> NNNS. I.e.
> {{{
> sage: elliptic_f (x, 1)
> log(tan(1/4*pi + 1/2*x))
> sage: elliptic_f (polygen(CC), 1)
> ...
> AttributeError: 'Polynomial_generic_dense_field' object has no attribute
> 'log'
> }}}

New description:

 Symbolic expressions can be seen as programs for applying functions to
 numerics and symbolics. Non-numeric non-symbolics (NNNS, most of the rest
 of Sage) are usually not handled by symbolic functions, although they
 often allow the same operations and many of the functions. The manual
 workaround is to evaluate the expression "on `x`" and then to substitute
 `x` with the respective NNNS. We propose that `BuiltinFunction` automates
 this process.

 Part of this is already duplicated in `rings.arith` but the need arises
 with symbolic functions returning polynomials, e.g. #16813. At the moment
 `BuiltinFunction` simply converts the NNNS argument, losing the type
 information.

 Practically, `BuiltinFunction` should eval with `x`, try substitution, and
 throw an error if the substitution leads to unknown methods of the NNNS.
 I.e.
 {{{
 sage: elliptic_f (x, 1)
 log(tan(1/4*pi + 1/2*x))
 sage: elliptic_f (polygen(CC), 1)
 ...
 AttributeError: cannot apply function to argument x: argument does not
 know how to do log
 (coming from this exception)
 AttributeError: 'Polynomial_generic_dense_field' object has no attribute
 'log'
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18832#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to