8000 Add is_algebraic and is_transcendental by rikardn · Pull Request #1819 · symengine/symengine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 2 commits into from
Oct 18, 2021
Merged

Conversation

rikardn
Copy link
Contributor
@rikardn rikardn commented Aug 15, 2021

No description provided.

void bvisit(const Set &x);
void bvisit(const Relational &x);
void bvisit(const Boolean &x);
void bvisit(const Constant &x);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

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;
Copy link
Member
@isuruf isuruf Aug 29, 2021

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@rikardn
Copy link
Contributor Author
rikardn commented Oct 17, 2021

I think further enhancements could go into future PR:s. Could we merge this?

@rikardn
Copy link
Contributor Author
rikardn commented Oct 18, 2021

@isuruf Thanks for reviewing

@rikardn rikardn merged commit 23abf31 into symengine:master Oct 18, 2021
@rikardn rikardn deleted the is_algebraic branch October 18, 2021 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0