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

propagate the variable domain to the assumptions database #18695

Closed
rwst opened this issue Jun 13, 2015 · 18 comments
Closed

propagate the variable domain to the assumptions database #18695

rwst opened this issue Jun 13, 2015 · 18 comments

Comments

@rwst
Copy link

rwst commented Jun 13, 2015

While this works as expected:

sage: n = var('n')
sage: assume(n, 'integer')
sage: solve([n^2 == 3],n)
[]

this does not:

sage: forget()
sage: n = var('n', domain='integer')
sage: solve([n^2 == 3],n)
[n == -sqrt(3), n == sqrt(3)]

So, either solve should also look at the variable domain, or better, let's propagate domain settings to the assumption list.
Also:

sage: _ = var('n', domain='integer')
sage: n.is_integer()
False

Creating a non-complex var will invoke Maxima with this. I think this is acceptable for now. Alternatively, examine if assumptions can be done lazily, i.e., before any call to Maxima.

Depends on #18877

Component: symbolics

Author: Ralf Stephan

Branch/Commit: c142a5f

Reviewer: Vincent Delecroix

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

@rwst rwst added this to the sage-6.8 milestone Jun 13, 2015
@rwst
Copy link
Author

rwst commented Jun 20, 2015

@rwst
Copy link
Author

rwst commented Jun 20, 2015

Author: Ralf Stephan

@rwst
Copy link
Author

rwst commented Jun 20, 2015

New commits:

e7fe81a18695: propagate the variable domain to the assumptions database

@rwst
Copy link
Author

rwst commented Jun 20, 2015

Commit: e7fe81a

@rwst rwst changed the title setting domain=integer on var has no effect with solve propagate the variable domain to the assumptions database Jun 20, 2015
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

Changed commit from e7fe81a to 95f63a6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

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

95f63a618695: fix first attempt; enable exception for wrong domain

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

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

e103b5618695: fix indentation

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2015

Changed commit from 95f63a6 to e103b56

@rwst

This comment has been minimized.

@rwst
Copy link
Author

rwst commented Jul 11, 2015

comment:7

Together with #18877 this should be able to doctest:

sage: _ = var('n', domain='integer')
sage: n.is_integer()
True

@rwst
Copy link
Author

rwst commented Jul 11, 2015

Dependencies: #18877

@rwst

This comment has been minimized.

@rwst
Copy link
Author

rwst commented Aug 13, 2015

comment:9

Replying to @rwst:

Together with #18877 this should be able to doctest:

sage: _ = var('n', domain='integer')
sage: n.is_integer()
True

No, this would actually need #18921 and is included there.

@rwst rwst modified the milestones: sage-6.8, sage-6.9 Aug 13, 2015
@videlec
Copy link
Contributor

videlec commented Aug 13, 2015

Reviewer: Vincent Delecroix

@videlec
Copy link
Contributor

videlec commented Aug 13, 2015

comment:11

Hello,

It looks good. Though I found confusing that the functions sage_domain_to_ginac and sage_domain_to_maxima have the same name. The first one return something (and does nothing) while the second one is communicating with maxima.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 13, 2015

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

d3bf439Merge branch 'develop' into t/18695/setting_domain_integer_on_var_has_no_effect_with_solve
c142a5f18695: clearer names for helpers

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 13, 2015

Changed commit from e103b56 to c142a5f

@vbraun
Copy link
Member

vbraun commented Aug 13, 2015

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

3 participants