Opened 6 years ago
Last modified 6 years ago
#18695 closed defect
propagate the variable domain to the assumptions database — at Version 7
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage6.9 
Component:  symbolics  Keywords:  
Cc:  Merged in:  
Authors:  Ralf Stephan  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/rws/setting_domain_integer_on_var_has_no_effect_with_solve (Commits, GitHub, GitLab)  Commit:  e103b5682b8de062309ce2a1283984f6adc94a78 
Dependencies:  #18877  Stopgaps: 
Description (last modified by )
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
Change History (7)
comment:1 Changed 6 years ago by
 Branch set to u/rws/setting_domain_integer_on_var_has_no_effect_with_solve
comment:2 Changed 6 years ago by
 Commit set to e7fe81a1486be193005eb4243e337cb5a4847f12
 Status changed from new to needs_review
 Summary changed from setting domain=integer on var has no effect with solve to propagate the variable domain to the assumptions database
comment:3 Changed 6 years ago by
 Status changed from needs_review to needs_work
comment:4 Changed 6 years ago by
 Commit changed from e7fe81a1486be193005eb4243e337cb5a4847f12 to 95f63a61be8893a622e42418b738eaa5fc1968a1
Branch pushed to git repo; I updated commit sha1. New commits:
95f63a6  18695: fix first attempt; enable exception for wrong domain

comment:5 Changed 6 years ago by
 Status changed from needs_work to needs_review
comment:6 Changed 6 years ago by
 Commit changed from 95f63a61be8893a622e42418b738eaa5fc1968a1 to e103b5682b8de062309ce2a1283984f6adc94a78
Branch pushed to git repo; I updated commit sha1. New commits:
e103b56  18695: fix indentation

comment:7 Changed 6 years ago by
 Dependencies set to #18877
 Description modified (diff)
 Status changed from needs_review to needs_work
Together with #18877 this should be able to doctest:
sage: _ = var('n', domain='integer') sage: n.is_integer() True
Note: See
TracTickets for help on using
tickets.
New commits:
18695: propagate the variable domain to the assumptions database