Opened 16 months ago

Last modified 10 months ago

#30234 new enhancement

Refactor SR through a wrapper class for symbolic equations, inequalities

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-wishlist
Component: symbolics Keywords:
Cc: gh-mjungmath, egourgoulhon, gh-DaveWitteMorris Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mkoeppe)

We create a "subring" of the Symbolic "Ring" that only includes value objects and has eager evaluation of relational operators.

Compare:

sage: s = SR('x') == 1                                                                                                                                                           
sage: s                                                                                                                                                                          
x == 1
sage: s in SR                                                                                                                                                                    
True

with:

sage: SymbolicValuesRing(SR('x'))
x
sage: SymbolicValuesRing(SR('x') >= 1)
error - cannot convert
sage: SymbolicValuesRing('x') >= 1
error - cannot decide
sage: assume(x >= 2)
sage: SymbolicValuesRing('x') >= 1
True

Approach 1 to implement this is to wrap elements of SR in some wrapper class.

Approach 2 is to implement it through refactoring:

  • We refactor the Symbolic Ring so that there is a convenient parent class for symbolic expressions with normal Python comparison semantics instead of creating relations.
  • The magic behavior of comparison operators for SR elements, creating relations, will be implemented in a wrapper class.

Ideally, this will be unified with the separate implementation of this functionality in sage.numerical.linear_functions.

Change History (2)

comment:1 Changed 13 months ago by mkoeppe

  • Cc gh-mjungmath added
  • Description modified (diff)
  • Summary changed from Wrapper class for symbolic equations, inequalities to Refactor SR through a wrapper class for symbolic equations, inequalities

comment:2 Changed 10 months ago by mkoeppe

  • Cc egourgoulhon gh-DaveWitteMorris added
  • Description modified (diff)
Note: See TracTickets for help on using tickets.