GSOC 2016: Assumptions

303 views
Skip to first unread message

Anish Shah

unread,
Feb 12, 2016, 1:28:24 PM2/12/16
to sympy
Hello Sympy communities,

My name is Anish Shah. I've a good amount of experience in Python. Since last few weeks, I have been contributing to Sympy and I'm loving it. 
For GSOC 2016, I'm interesting in assumptions module.

I have some questions regarding it:

1. The ideas page for assumption seems to be updated. The blog link mentioned in that post is not working anymore. Is there any alternate link?
2. Also, the pull request is merged. So, is the new assumption module done? Are there any new features/improvements that the community is expected in the assumption module?
3. There are many issues related to assumptions on Github. I will try solving some of them. Some of those issues are already solved, but they are not closed. Is there any particular reason? I will try to comment on those issues as I come across them. 
4. There's one more idea about porting assumptions to C++. I have a fair amount of knowledge regarding C/C++ and I think I can work on that. Are there any guides regarding porting Python code to C++?

Thank you for your time,
Anish Shah

Aaron Meurer

unread,
Feb 12, 2016, 1:39:22 PM2/12/16
to sy...@googlegroups.com
The ideas page on assumptions needs to be updated. There was a project last year which did a lot of work on it (but there is still plenty of work to do). 

The assumptions in SymPy are a bit of a complex topic. A good way to get up to speed on them would be to start by reading my post at https://groups.google.com/forum/#!msg/sympy/PHR136kdxc4/C2qs5obPGoMJ. This was the state of things last year, before Sudhanshu's GSoC project. Then look through Sudhanshu's merged pull requests on GitHub to see what has changed since then https://github.com/sympy/sympy/pulls?q=is%3Apr+author%3Adebugger22+is%3Aclosed (this is also summarized in the release notes https://github.com/sympy/sympy/wiki/Release-Notes-for-1.0).

Regarding C++, you would have to ask Ondrej if he wants to implement them in SymEngine.

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/f972482b-4f09-4116-8911-5f6fa9cea237%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sudhanshu Mishra

unread,
Feb 12, 2016, 2:25:19 PM2/12/16
to sy...@googlegroups.com
Thanks for the reply Aaron.

Anish, Feel free to mail/Gitter me if you want to know anything regarding my code.

Sudhanshu Mishra


For more options, visit https://groups.google.com/d/optout.

Ralf Stephan

unread,
Feb 13, 2016, 3:01:11 AM2/13/16
to sympy
On Friday, February 12, 2016 at 7:39:22 PM UTC+1, Aaron Meurer wrote:
Regarding C++, you would have to ask Ondrej if he wants to implement them in SymEngine.

Anish Shah

unread,
Feb 13, 2016, 4:22:44 AM2/13/16
to sympy
Thanks for your help guys. I will start right away. :)

@Ralf Stephen Yes, I saw that entry. Do you have any guides regarding porting Python code to C++?

Ralf Stephan

unread,
Feb 13, 2016, 11:21:30 AM2/13/16
to sympy
On Saturday, February 13, 2016 at 10:22:44 AM UTC+1, Anish Shah wrote:
 Do you have any guides regarding porting Python code to C++?

Anish Shah

unread,
Mar 1, 2016, 6:17:40 AM3/1/16
to sympy
Hi Aaron and Sudhanshu,

Since I last posted on this thread I have tackled some issues related to assumptions. I also read Aaron's post on the mailing list explaining the need for new assumptions and I went through Sudhanshu's work last summer. After some discussion on SymPy Gitter, I have a much more clear picture of the state of assumptions right now.

Aaron, you said that there's still a lot of work need to be done on assumptions. I have listed down a list of tasks that I think are still pending in assumptions. Please add to it if you think I'm still missing something. It will help me to include the list of tasks in my proposal.

1. Inconsistencies between old assumptions and new assumptions: I think this is one of the biggest roadblocks for assumptions. (extended_real/real)

In [5]: ask(Q.real(oo))
Out[5]: False


In [6]: oo.is_real
Out[6]: True


2. Improve refine: Currently, refine is very slow. Issue 9714

3. Old assumptions should call new assumptions internally.
Currently, old assumptions (for eg. `x.is_real`) are evaluated using `_eval_is_real` method. Instead, we need to use new assumptions. This is not done yet, I think. So, I think this can be included under GSOC 2016.

4. New assumptions
    - for matrices/matrix symbol: Issue 8803, Issue 10265
    - for functions: Issue 8760

Please let me know yours thoughts on this. Thank you.
Anish Shah

Sudhanshu Mishra

unread,
Mar 1, 2016, 6:28:22 AM3/1/16
to sy...@googlegroups.com
I don't remember the inconsistency between old and new assumptions but are you sure this is the only one left? Perhaps there was something to change which "needed decision". I'll try to go through my work and get back to you.

Anish Shah

unread,
Mar 1, 2016, 8:20:18 AM3/1/16
to sy...@googlegroups.com
Sorry, I didn't mean that this is the only one left. I meant, there are many inconsistencies.

On Tue, Mar 1, 2016 at 4:58 PM, Sudhanshu Mishra <mrs...@gmail.com> wrote:
I don't remember the inconsistency between old and new assumptions but are you sure this is the only one left? Perhaps there was something to change which "needed decision". I'll try to go through my work and get back to you.

--
You received this message because you are subscribed to a topic in the Google Groups "sympy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sympy/s71d4FW1Mnk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sympy+un...@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.

Aaron Meurer

unread,
Mar 1, 2016, 11:22:43 AM3/1/16
to sy...@googlegroups.com
Your list looks spot on. The speed of refine is a very important issue.

Regarding the inconsistencies, I think the one you mention is the main
one left. If there are any others they are relatively minor.

Aarn Meurer
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAOqj4aVrQTpEo7n3oWg87KMf_1Ev0%2BR3%3D%3DNBQEF2%3D%3DbvZgWHyw%40mail.gmail.com.

Anish Shah

unread,
Mar 3, 2016, 7:26:53 AM3/3/16
to sympy


On Tuesday, March 1, 2016 at 9:52:43 PM UTC+5:30, Aaron Meurer wrote:
Your list looks spot on. The speed of refine is a very important issue.

Regarding the inconsistencies, I think the one you mention is the main
one left. If there are any others they are relatively minor.

Thank you, Aaron! I will start working on the above issues.

Anish Shah

unread,
Mar 9, 2016, 12:56:22 PM3/9/16
to sympy
Hi Aaron and Sudhanshu,


Past few days I have been reading the source code related to refine, logic, sat handlers and all the pull requests (2508).  
In issue 9714, you said that currently `to_cnf` uses a very naive algorithm. Should I try to implement efficient algorithms for to_cnf (if there are any) or we should try SymEngine?

Also, it would be great if any of you could review my PRs related to assumptions: 10736, 10704 and 10652. It would be great so that I can include it in my proposal. Sorry for disturbing again. 

Thanks,
Anish Shah  

Anish Shah

unread,
Mar 10, 2016, 3:41:05 PM3/10/16
to sympy
ping

Aaron Meurer

unread,
Mar 10, 2016, 3:49:11 PM3/10/16
to sy...@googlegroups.com
On Wed, Mar 9, 2016 at 12:56 PM, Anish Shah <shah.a...@gmail.com> wrote:
> Hi Aaron and Sudhanshu,
>
>
> Past few days I have been reading the source code related to refine, logic,
> sat handlers and all the pull requests (2508).
> In issue 9714, you said that currently `to_cnf` uses a very naive algorithm.
> Should I try to implement efficient algorithms for to_cnf (if there are any)
> or we should try SymEngine?

There are some open pull requests to the logic module. I don't
remember if any address this issue, but you might look at them first
to see what's there.

Aaron Meurer

>
> Also, it would be great if any of you could review my PRs related to
> assumptions: 10736, 10704 and 10652. It would be great so that I can include
> it in my proposal. Sorry for disturbing again.
>
> Thanks,
> Anish Shah
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ec88ba54-3969-48d8-86cd-9ed16a6680e5%40googlegroups.com.

Anish Shah

unread,
Mar 21, 2016, 1:41:10 PM3/21/16
to sympy
I was going through assumptions issues and I found this issue:- https://github.com/sympy/sympy/issues/9384
I wanted to know whether assumption should support inequalities? There is some work done on the above issue but it is not merged yet and no work has been done on it.
Should I include it in my assumptions?

Anish Shah

unread,
Mar 21, 2016, 1:41:37 PM3/21/16
to sympy
Sorry, I meant, Should I include it in my proposal? 

Aaron Meurer

unread,
Mar 21, 2016, 3:26:57 PM3/21/16
to sy...@googlegroups.com
If you have thoughts on how to do it, yes, include it in your proposal.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ba389834-9bb1-46b3-b5d5-bcc145a50cfc%40googlegroups.com.

Sumit Srivastava

unread,
Mar 31, 2017, 9:46:14 AM3/31/17
to sympy

"but there is still plenty of work to do" 
Can you please elaborate on what work is left to be done? I'd really like to implement changes in Assumption module.
Reply all
Reply to author
Forward
0 new messages