Opened 4 years ago

Closed 4 years ago

#18832 closed defect (fixed)

non-numeric non-symbolic BuiltinFunction arguments

Reported by: rws Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: symbolics Keywords:
Cc: jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #20312 Stopgaps:

Description (last modified by rws)

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'

Change History (7)

comment:1 Changed 4 years ago by rws

  • Description modified (diff)

comment:2 Changed 4 years ago by rws

  • Description modified (diff)

comment:3 Changed 4 years ago by rws

  • Dependencies set to #20312

comment:4 Changed 4 years ago by rws

The example is not the best.

comment:5 Changed 4 years ago by rws

  • Milestone changed from sage-6.8 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

comment:6 Changed 4 years ago by rws

  • Status changed from needs_review to positive_review

comment:7 Changed 4 years ago by vbraun

  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.