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

Formal set membership function #24171

Closed
rwst opened this issue Nov 7, 2017 · 64 comments
Closed

Formal set membership function #24171

rwst opened this issue Nov 7, 2017 · 64 comments

Comments

@rwst
Copy link

rwst commented Nov 7, 2017

To express solution sets from solvers an expression-is-element-of-set relation is needed. For ease of implementation this can be made a formal function element_of.

It depends on sets being made coercible into SR. The present ticket plays safe and only does this for finite sets and a few standard infinite sets: NN, ZZ, QQ, AA; and RealSets.

element_of converts to SymPy's Contains. This is useful in combination with #31931, which adds SymPy conversions to some of the above sets.

Depends on #31877

CC: @videlec

Component: symbolics

Author: Ralf Stephan, Matthias Koeppe

Branch/Commit: a8c94ca

Reviewer: Travis Scrimshaw, Matthias Koeppe

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

@rwst rwst added this to the sage-8.2 milestone Nov 7, 2017
@rwst

This comment has been minimized.

@rwst
Copy link
Author

rwst commented Nov 7, 2017

Branch: u/rws/formal_set_membership_function

@rwst
Copy link
Author

rwst commented Nov 7, 2017

Author: Ralf Stephan

@rwst
Copy link
Author

rwst commented Nov 7, 2017

New commits:

669ea2224171: Formal set membership function

@rwst
Copy link
Author

rwst commented Nov 7, 2017

Commit: 669ea22

@tscrim
Copy link
Collaborator

tscrim commented Nov 7, 2017

comment:4

I can reproduce this error

**********************************************************************
File "src/sage/misc/dev_tools.py", line 438, in sage.misc.dev_tools.import_statements
Failed example:
    load_submodules(sage.sets)
Expected:
    load sage.sets.real_set... succeeded
    load sage.sets.set_from_iterator... succeeded
Got:
    load sage.sets.set_from_iterator... succeeded

I think why this now fails is because real_set is now loaded on startup.

@rwst
Copy link
Author

rwst commented Nov 8, 2017

comment:5

I think it would be good if RealSet answered positive to is_Set, I'm just not sure how to accomplish it correctly. If done it wouldn't need to be loaded at start.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

34c977324171: make RealSet inherit from Set_generic
af8271724171: remove RealSet import; SR set coercion doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2017

Changed commit from 669ea22 to af82717

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

592ce8724171: Py3 fixes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 8, 2017

Changed commit from af82717 to 592ce87

@tscrim
Copy link
Collaborator

tscrim commented Nov 8, 2017

comment:9

LGTM. Thanks.

@tscrim
Copy link
Collaborator

tscrim commented Nov 8, 2017

Reviewer: Travis Scrimshaw

@rwst
Copy link
Author

rwst commented Nov 9, 2017

comment:10

Thanks for the review.

@vbraun
Copy link
Member

vbraun commented Dec 8, 2017

comment:11

Merge conflictw

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 14, 2017

Changed commit from 592ce87 to aa11a3e

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 14, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

aa11a3eMerge branch 'develop' into t/24171/formal_set_membership_function

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

4b09685RealSet: Put it in a suitable subcategory of TopologicalSpaces()
46eed0eRealSet.ambient: Change to a normal method
51c8152Merge branch 't/31877/refine_category_of_realset' into t/24171/set-membership-rebased
5e623bbRealSet.is_finite: Remove, inherited from category

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Changed commit from 72565f2 to 5e623bb

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 9, 2021

Dependencies: #31877

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

7d19916Do not use QQ.completion(oo,oo) - not implemented

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Changed commit from 5e623bb to 7d19916

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Changed commit from 7d19916 to 5310e04

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

9b4e22424176: check set argument of element_of()
5310e04Function_elementof: Remove use of is_Set

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 9, 2021

comment:39

This branch works now as advertised, but a careful review of this design is needed

@tscrim
Copy link
Collaborator

tscrim commented Jun 9, 2021

comment:40

We could add more support for other infinite sets later on (e.g., number fields), but this would be good for most (perhaps all?) use-cases. I think everything else is good except I don't understand why this line is added (see the diff):

oo = infinity

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 9, 2021

comment:41

that's just a leftover, I'll get rid of it

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Changed commit from 5310e04 to 43cabe8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

43cabe8Do not use QQ.completion(oo,oo) - not implemented (fixup)

@tscrim
Copy link
Collaborator

tscrim commented Jun 9, 2021

comment:43

Thank you. Green bot => positive review. Please add yourself whether you think you are an author and/or reviewer.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Changed commit from 43cabe8 to c793fcc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

c793fccFunction_elementof: Remove use of is_Set (fixup)

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 9, 2021

Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Matthias Koeppe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Changed commit from c793fcc to a8c94ca

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 9, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

a8c94caFunction_elementof: Add conversion to sympy

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 9, 2021

Changed author from Ralf Stephan to Ralf Stephan, Matthias Koeppe

@mkoeppe
Copy link
Contributor

mkoeppe commented Jun 9, 2021

comment:49

Thanks!

@vbraun
Copy link
Member

vbraun commented Jul 1, 2021

Changed branch from u/mkoeppe/24171-1 to a8c94ca

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

5 participants