-
Notifications
You must be signed in to change notification settings - Fork 294
Add is_algebraic and is_transcendental #1819
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
Conversation
void bvisit(const Set &x); | ||
void bvisit(const Relational &x); | ||
void bvisit(const Boolean &x); | ||
void bvisit(const Constant &x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be implementing things like Add, Mul, Pow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand there are no general rules known for these. We'd have to create special cases for what is know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
algebraic + algebraic = algebraic, right? For Pow, we'll have to have special cases like https://github.com/sympy/symp 8000 y/blob/ef3d570ac8f9b76855351bb712f8dbe2f1b2c69a/sympy/core/power.py#L1383
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grepping _eval_is_algebraic
in sympy will give you all the rules that sympy implements.
for (const auto &arg : x.get_args()) { | ||
arg->accept(*this); | ||
if (not is_true(is_algebraic_)) { | ||
is_algebraic_ = tribool::indeterminate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes indeterminate only if there are two numbers which are not algebraic. If there's only one number that is not algebraic, it's false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! algebraic + transcendental = transcendental
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
should be good now
I think further enhancements could go into future PR:s. Could we merge this? |
@isuruf Thanks for reviewing |
No description provided.