#19040: defuse bool(x!=0) performance bomb
-------------------------+-------------------------------------------------
       Reporter:  rws    |        Owner:
           Type:         |       Status:  new
  enhancement            |    Milestone:  sage-6.9
       Priority:  major  |   Resolution:
      Component:         |    Merged in:
  symbolics              |    Reviewers:
       Keywords:         |  Work issues:
        Authors:  Ralf   |       Commit:
  Stephan                |  800ec56b0b930eb8a5b966c5871dc5e76724acb0
Report Upstream:  N/A    |     Stopgaps:
         Branch:         |
  u/rws/19040            |
   Dependencies:         |
-------------------------+-------------------------------------------------
Description changed by rws:

Old description:

> Symbolics may be part of type-neutral computations, e.g. matrices, rings.
> Developers do not expect proof machinery to crank up when writing `if
> x!=0`, so `bool(x1!=x2)` should mean `not (x1-x2).is_trivial_zero()` for
> symbolic `x`. We should provide a different interface for cases requiring
> simplification/proof:
>  * `bool(rel)` equivalent to `(not)(LHS-RHS).is_trivial_zero()` for ==,!=
> ; and an exception with maybe hint to the following for <,>,<=,>=
>  * `satisfiable(rel)` returning
> `(Yes,example)/No/Undecidable/NotImplemented`
>  * `truth(rel, (x,S1), (y,S1)...)` equivalent to `satisfiable(rel)` for
> all `x,y...` in `S1,S2,...`
>  * `solve(rel)` in case of `satisfiable=Yes` returning the full solution
> set
>  * `prove(rel)` showing more or less steps of simplification (which is
> out of reach for the moment)
>
> This ticket will implement the new behaviour of `bool(rel)` and put all
> other functionality of `ex.__nonzero__()` into `ex.satisfiable()`.
>
> See also #19162.

New description:

 Symbolics may be part of type-neutral computations, e.g. matrices, rings.
 Developers do not expect proof machinery to crank up when writing `if
 x!=0`, so `bool(x1!=x2)` should mean `not (x1-x2).is_trivial_zero()` for
 symbolic `x`. We should provide a different interface for cases requiring
 simplification/proof:
  * `bool(rel)` equivalent to `(not)(LHS-RHS).is_trivial_zero()` for ==,!=
 ; and an exception with maybe hint to the following for <,>,<=,>=
  * `satisfiable(rel)` returning
 `(Yes,example)/No/Undecidable/NotImplemented`
  * `holds(rel, (x,S1), (y,S1)...)` equivalent to `satisfiable(rel)` for
 all `x,y...` in `S1,S2,...`
  * `solve(rel)` in case of `satisfiable=Yes` returning the full solution
 set
  * `prove(rel)` showing more or less steps of simplification (which is out
 of reach for the moment)

 This ticket will implement the new behaviour of `bool(rel)` and put all
 other functionality of `ex.__nonzero__()` into `ex.satisfiable()`.

 See also #19162.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/19040#comment:17>
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