ProjetPP / PPP-CAS

Computer Algebra System module for the Projet Pensées Profondes
MIT License
2 stars 3 forks source link

Crash on `D(cos)` #10

Closed progval closed 9 years ago

progval commented 9 years ago

On input D(cos), I get this traceback:

Traceback (most recent call last):
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 97, in on_post
    return self.process_request(request)
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_libmodule/http.py", line 86, in process_request
    answers = self.router_class(request).answer()
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/requesthandler.py", line 28, in answer
    outputString, outputLatex=evaluate(self.tree.value)
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/evaluator.py", line 25, in evaluate
    expr, latex = process(eval_input, inputFormula, timeout=Config().timeout, heap_size=Config().max_heap)
  File "/home/ppp/.local/lib/python3.4/site-packages/ppp_cas/supyprocess.py", line 83, in process
    raise v
ValueError: object of type 'property' has no len()
marc-chevalier commented 9 years ago

Sympy Gamma fail in the same way : http://gamma.sympy.org/input/?i=diff%28cos%29

It is perfectly coherent. Indeed, if we want derive ln, the only correct answer is x \mapsto \frac{1}{x}. So, we need a new variable and a functional notation, so a system which contains lambda-calculus. So we have a problem for higher order function or variadic which are overloaded. For instance, D(log) must be derivated as the function x \mapsto log(x) (decimal logarithm) or as the function (b,x) \mapsto log_b(x). Any initiative would be crappy.

The only thng to do, is to return nothing.

progval commented 9 years ago

I don't understand how this is different to input diff(cos(x)); you still have the domain issue.

Error reported to Sympy Gamma. https://github.com/sympy/sympy_gamma/issues/58

marc-chevalier commented 9 years ago

Because we have a variable 'x'. diff(cos) is a function -> boum; diff(cos(x)) is a variable -> no problem. We do not have to define a functional notation. We do not have ambiguous cases (diff(log(x) cannot be understood as the function (b,x) -> log_b(x)). There are many differences!

Marc CHEVALIER

Le 18/01/2015 21:08, Valentin Lorentz a écrit :

I don't understand how this is different to input |diff(cos(x))|; you still have the domain issue.

Error reported to Sympy Gamma. sympy/sympy_gamma#58 https://github.com/sympy/sympy_gamma/issues/58

— Reply to this email directly or view it on GitHub https://github.com/ProjetPP/PPP-CAS/issues/10#issuecomment-70423455.

progval commented 9 years ago

tan is a function too, and it is not defined on an point of R. So would be diff(cos).

marc-chevalier commented 9 years ago

It is not the problem.

Marc CHEVALIER

Le 18/01/2015 21:14, Valentin Lorentz a écrit :

|tan| is a function too, and it is not defined on an point of R. So would be diff(cos).

— Reply to this email directly or view it on GitHub https://github.com/ProjetPP/PPP-CAS/issues/10#issuecomment-70423682.