Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-numeric non-symbolic BuiltinFunction arguments #18832

Closed
rwst opened this issue Jul 1, 2015 · 4 comments
Closed

non-numeric non-symbolic BuiltinFunction arguments #18832

rwst opened this issue Jul 1, 2015 · 4 comments

Comments

@rwst
Copy link

rwst commented Jul 1, 2015

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'

Depends on #20312

CC: @jdemeyer

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/18832

@rwst rwst added this to the sage-6.8 milestone Jul 1, 2015
@rwst

This comment has been minimized.

@rwst

This comment has been minimized.

@rwst
Copy link
Author

rwst commented Mar 29, 2016

Dependencies: #20312

@rwst
Copy link
Author

rwst commented Apr 21, 2016

comment:4

The example is not the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants