[sage-devel] Re: enhancement proposal for comparisons and containment

2021-03-27 Thread Nils Bruin

While I don't have a particular objection against the notion of 
"intersection" of parents, I don't think it belongs in the coercion system, 
because I think its only uses run counter to what I think the coercion 
system is/should be designed for.

The most complicated part of the coercion system deals with figuring out 
(hopefully consistent) domain/codomain choices for binary operations: given 
two parents A and B and a binary operation f, find an appropriate parent C 
so that the map f: A x B -> C works as expected. In many cases, this means 
finding a common overparent together with coercion maps A->C, B->C so that 
we can just use the preexisting f: C x C -> C. but in the case of actions 
(or scalar multiplications), it's a little different: in those cases there 
is usually a map, say f: R x B -> B and the search for meaning is limited 
to finding a suitable coercion A->R (automatic base extension of vector 
spaces upon scalar multiplication is not something we're currently doing; 
probably because it will often hide/defer errors rather than be a 
convenience)

The important part here is that the resulting map f: A x B -> C is actually 
a map; not a partial one. I have trouble seeing how "intersecting" parents 
would ever be  useful in that setting.

It seems to me that intersection(A,B) should be relative to a common 
overparent A->C, B->C (perhaps one that can be discovered, but note that 
the C the coercion system computes is also a function of the operation) and 
then is a "maximal" D that coerces into A,B such that D->A->C and D->B->C 
agree. For that to be useful for anything, there should then also be a 
partial conversion maps A->D, B->D that are inverses to the coercions.

As far as #4621 goes: Just as with  "==", I don't think a "False" from "in" 
should be taken as: "definitely does not lie in" but more as "system cannot 
figure out if it does". Transitivity already breaks for us for "==", for 
fairly fundamental reasons, so I think it's acceptable with the same being 
true for "in". Our equality test should really be tri-valued and be guided 
by the coercion framework: if there's a common parent for testing "==" then 
we can do it there; otherwise we answer "don't know". That obviously 
doesn't map onto the python requirements of "==".


On Saturday, March 27, 2021 at 10:58:19 AM UTC-7 vdelecroix wrote:

> Dear all,
>
> This is a proposal to implement a new operation somewhere in our
> coercion model: intersection of parents. The motivation is to
> enhance
>
> 1. comparison: x == y would work as expected when x and y belongs to
> the intersection of their parents (see [#4621] for a use case)
>
> 2. conversion: P(x) would work when the intersection of P and the
> parent of x contains x.
>
> By default, the intersection of two parents A and B would be None.
> Otherwise it would return a parent that has an injective coercion
> in both A and B with the requirement that intersection(A, B) is the
> same thing as intersection(B, A).
>
> Does it make sense?
>
> [#4621] https://trac.sagemath.org/ticket/4621
>
> Best
> Vincent
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/22f586ef-e007-484a-8025-7341d32b63f8n%40googlegroups.com.


[sage-devel] Re: Running MathicsSession inside Sage

2021-03-27 Thread seb....@gmail.com
Thanks to everyone who helped here somewhere along the way!

rocky.b...@gmail.com schrieb am Freitag, 26. März 2021 um 23:52:54 UTC+1:

> I asked about this in the mpmath group and the solution there I think is 
> good and only requires a change (or rather simplification) to the Mathics 
> code.
>
> So as far as I am concerned no changes are needed to sage or mpmath. See 
> https://groups.google.com/g/mpmath/c/qzA5gs57Qm8/m/_eg4GHisAAAJ
>
> On Friday, March 26, 2021 at 6:47:32 PM UTC-4 dim...@gmail.com wrote:
>
>> On Thursday, March 25, 2021 at 2:24:43 PM UTC seb@gmail.com wrote:
>>
>>> Hi,
>>>
>>> Did anyone try this before? At the moment this stucks at the following 
>>> issue:
>>>
>>> sage: import mpmath
>>> sage: mpmath.ctx_mp_python.mpf
>>>
>>> ---
>>> AttributeErrorTraceback (most recent call 
>>> last)
>>>  in 
>>> > 1 mpmath.ctx_mp_python.mpf
>>>
>>> AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
>>>
>>
>> this is apparently easy to fix, as this is due to
>>
>> https://github.com/fredrik-johansson/mpmath/blob/bd6715df41f2034f4438a77acc9bb05d03564942/mpmath/ctx_mp.py#L54
>> which makes the import of mpf conditional on BACKEND not being 'sage'
>>
>> Making it unconditional does not seem to break anything in Sage.
>>
>>  
>>
>>>
>>>
>>> whereas
>>>
>>> ~/devel/sage$ ./local/bin/python3
>>> Python 3.9.2 (default, Mar 19 2021, 22:23:28)
>>> [GCC 7.4.0] on linux
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import mpmath
>>> >>> mpmath.ctx_mp_python.mpf
>>> 
>>>
>>>
>>> Any ideas what is the reason for this?
>>>
>>> For the background of this question see Mathics issue 1169 
>>>   especially this 
>>> comment 
>>> .
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/7ec21d2a-801a-4bc9-8c92-8be4e2bd112an%40googlegroups.com.


[sage-devel] enhancement proposal for comparisons and containment

2021-03-27 Thread Vincent Delecroix

Dear all,

This is a proposal to implement a new operation somewhere in our
coercion model: intersection of parents. The motivation is to
enhance

1. comparison: x == y would work as expected when x and y belongs to
   the intersection of their parents (see [#4621] for a use case)

2. conversion: P(x) would work when the intersection of P and the
   parent of x contains x.

By default, the intersection of two parents A and B would be None.
Otherwise it would return a parent that has an injective coercion
in both A and B with the requirement that intersection(A, B) is the
same thing as intersection(B, A).

Does it make sense?

[#4621] https://trac.sagemath.org/ticket/4621

Best
Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d6103902-9dcf-b6b2-bd57-b79514c6bffa%40gmail.com.


Re: [sage-devel] How to install Cryptominisat-5.0.1 version in Sage-8.7 Inbox

2021-03-27 Thread Thierry
Hi,

On Sat, Mar 27, 2021 at 04:16:42AM -0700, Dheeraj Sharma wrote:
> 
> Sir,
> 
> It has been required by the reviewer. I have submitted article in April 
> 2019.
> Reviewer does require to work in cryptominisat-5.0.1 specifically.
> 
> Please, tell the procedure.


This sound more like a question for ask.sagemath.org than sage-devel.

Anyway, if you want your reviewer to run Sage with cryptominisat-5.0.1,
you can suggest to use the live USB key Sage Debian Live 8.6 on which
cryptominisat-5.0.1 is installed, see

https://www.sagemath.org/download-liveusb.html
https://sagedebianlive.metelu.net/

Note that this Sage version runs Python 2.

Ciao,
Thierry



> On Saturday, 27 March 2021 at 14:04:06 UTC+5:30 dim...@gmail.com wrote:
> 
> > this is certainly not recommended for "normal" use. 
> >
> > If you are trying to reproduce computations done years ago, perhaps try 
> > installing a standalone version of cryptominisat, generate the input, and 
> > feed it into the solver.
> >
> >
> >
> > On Sat, 27 Mar 2021, 06:57 Dheeraj Sharma,  wrote:
> >
> >> Dear Sir,
> >>
> >> I have to specifically work on cryptominisat-5.0.1 version. I have tried 
> >> to install it by running command "./sage -p cryptominisat-5.0.1" on 
> >> terminal window (that is opened in Sage folder). But it is showing the 
> >> following statements:
> >>
> >> dheeraj@dheeraj-Latitude-5490:~/sage/sage_installation/sage-8.7$ ./sage 
> >> -p cryptominisat-5.0.1
> >> Attempting to download package cryptominisat-5.0.1
> >> >>> Checking online list of optional packages.
> >> >>> Checking online list of experimental packages.
> >> >>> Checking online list of huge packages.
> >> Error: could not find a package matching cryptominisat-5.0.1
> >>Try 'sage --package list' to see the available packages
> >>There is no package similar to cryptominisat-5.0.1
> >> You can find further packages at http://files.sagemath.org/spkg/
> >>
> >>
> >> I have further opened the web link provided in it. I have found that 
> >> cryptominsat-5.0.1 is available on following link.
> >> http://files.sagemath.org/spkg/upstream/cryptominisat/index.html
> >>
> >> Please, tell me the procedure to install cryptominisat-5.0.1.
> >>
> >> I am working on following operating system.
> >> Distributor ID: Ubuntu
> >> Description: Ubuntu 14.04.6 LTS
> >> Release: 14.04
> >> Codename: trusty
> >>
> >> With Regards,
> >> Dr. Dheeraj Kumar Sharma
> >> Assistant Professor
> >> Department of Electronics & Comm. Engg.
> >> National Institute of Technology, Kurukshetra
> >> Mob. No. +91-7206435934 <+91%2072064%2035934>,
> >>   +91-9897715970 <+91%2098977%2015970>
> >>   
> >>   
> >>
> >> -- 
> >> You received this message because you are subscribed to the Google Groups 
> >> "sage-devel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to sage-devel+...@googlegroups.com.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/sage-devel/CAMTmor4-ZCztGPcEWv9wgeGuHUbz7eeT3qyHJGFJxnKE81mbgA%40mail.gmail.com
> >>  
> >> 
> >> .
> >>
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/044716c5-15f5-4f65-abaa-20c1c5d5351dn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/20210327140654.g7enxvrzoprxb533%40metelu.net.


Re: [sage-devel] How to install Cryptominisat-5.0.1 version in Sage-8.7 Inbox

2021-03-27 Thread Dima Pasechnik
On Sat, Mar 27, 2021 at 11:16 AM Dheeraj Sharma
 wrote:

> It has been required by the reviewer. I have submitted article in April 2019.
> Reviewer does require to work in cryptominisat-5.0.1 specifically.

2 years is a long time. But the reviewer is right, if your paper
relies on computations, you should be
able to reproduce them. However, I don't think it is fair to require a
particular old version - which
has been superseded.

Would it be easier to redo these computations with state of the art
software, put it on e.g.
GitHub?

It would also make it good to compare with the old results, if they still stand.

>
> Please, tell the procedure.

What makes you think that cryprominisat 5.0.1 will work with Sage 8.7?
(it won't, out if the box, but see below)
The latter was released with cryprominisat 5.6.6, cf
https://github.com/sagemath/sage/blob/8.7/build/pkgs/cryptominisat/package-version.txt

To get 5.0.1 you need to go back to 8.6:
https://github.com/sagemath/sage/blob/8.6/build/pkgs/cryptominisat/package-version.txt

Installing Sage 8.6 from source should give you cryptominisat
(you'd need to install it as an extra step, as it was experimental
package back then,
by doing ./sage -i cryptominisat)

If you really must must use Sage 8.7 then you'd need to undo the changes in
https://trac.sagemath.org/ticket/25480
in order to get it installed.

HTH
Dima






> On Saturday, 27 March 2021 at 14:04:06 UTC+5:30 dim...@gmail.com wrote:
>>
>> this is certainly not recommended for "normal" use.
>>
>> If you are trying to reproduce computations done years ago, perhaps try 
>> installing a standalone version of cryptominisat, generate the input, and 
>> feed it into the solver.
>>
>>
>>
>> On Sat, 27 Mar 2021, 06:57 Dheeraj Sharma,  wrote:
>>>
>>> Dear Sir,
>>>
>>> I have to specifically work on cryptominisat-5.0.1 version. I have tried to 
>>> install it by running command "./sage -p cryptominisat-5.0.1" on terminal 
>>> window (that is opened in Sage folder). But it is showing the following 
>>> statements:
>>>
>>> dheeraj@dheeraj-Latitude-5490:~/sage/sage_installation/sage-8.7$ ./sage -p 
>>> cryptominisat-5.0.1
>>> Attempting to download package cryptominisat-5.0.1
>>> >>> Checking online list of optional packages.
>>> >>> Checking online list of experimental packages.
>>> >>> Checking online list of huge packages.
>>> Error: could not find a package matching cryptominisat-5.0.1
>>>Try 'sage --package list' to see the available packages
>>>There is no package similar to cryptominisat-5.0.1
>>> You can find further packages at http://files.sagemath.org/spkg/
>>>
>>>
>>> I have further opened the web link provided in it. I have found that 
>>> cryptominsat-5.0.1 is available on following link.
>>> http://files.sagemath.org/spkg/upstream/cryptominisat/index.html
>>>
>>> Please, tell me the procedure to install cryptominisat-5.0.1.
>>>
>>> I am working on following operating system.
>>> Distributor ID: Ubuntu
>>> Description: Ubuntu 14.04.6 LTS
>>> Release: 14.04
>>> Codename: trusty
>>>
>>> With Regards,
>>> Dr. Dheeraj Kumar Sharma
>>> Assistant Professor
>>> Department of Electronics & Comm. Engg.
>>> National Institute of Technology, Kurukshetra
>>> Mob. No. +91-7206435934,
>>>   +91-9897715970
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "sage-devel" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to sage-devel+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sage-devel/CAMTmor4-ZCztGPcEWv9wgeGuHUbz7eeT3qyHJGFJxnKE81mbgA%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/044716c5-15f5-4f65-abaa-20c1c5d5351dn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1J2Kf6Ht_FN%3Dk4o-qLL2%2Bqi2%3DyA44-7doyh7Q2aAW_wA%40mail.gmail.com.


Re: [sage-devel] How to install Cryptominisat-5.0.1 version in Sage-8.7 Inbox

2021-03-27 Thread Dheeraj Sharma

Sir,

It has been required by the reviewer. I have submitted article in April 
2019.
Reviewer does require to work in cryptominisat-5.0.1 specifically.

Please, tell the procedure.
On Saturday, 27 March 2021 at 14:04:06 UTC+5:30 dim...@gmail.com wrote:

> this is certainly not recommended for "normal" use. 
>
> If you are trying to reproduce computations done years ago, perhaps try 
> installing a standalone version of cryptominisat, generate the input, and 
> feed it into the solver.
>
>
>
> On Sat, 27 Mar 2021, 06:57 Dheeraj Sharma,  wrote:
>
>> Dear Sir,
>>
>> I have to specifically work on cryptominisat-5.0.1 version. I have tried 
>> to install it by running command "./sage -p cryptominisat-5.0.1" on 
>> terminal window (that is opened in Sage folder). But it is showing the 
>> following statements:
>>
>> dheeraj@dheeraj-Latitude-5490:~/sage/sage_installation/sage-8.7$ ./sage 
>> -p cryptominisat-5.0.1
>> Attempting to download package cryptominisat-5.0.1
>> >>> Checking online list of optional packages.
>> >>> Checking online list of experimental packages.
>> >>> Checking online list of huge packages.
>> Error: could not find a package matching cryptominisat-5.0.1
>>Try 'sage --package list' to see the available packages
>>There is no package similar to cryptominisat-5.0.1
>> You can find further packages at http://files.sagemath.org/spkg/
>>
>>
>> I have further opened the web link provided in it. I have found that 
>> cryptominsat-5.0.1 is available on following link.
>> http://files.sagemath.org/spkg/upstream/cryptominisat/index.html
>>
>> Please, tell me the procedure to install cryptominisat-5.0.1.
>>
>> I am working on following operating system.
>> Distributor ID: Ubuntu
>> Description: Ubuntu 14.04.6 LTS
>> Release: 14.04
>> Codename: trusty
>>
>> With Regards,
>> Dr. Dheeraj Kumar Sharma
>> Assistant Professor
>> Department of Electronics & Comm. Engg.
>> National Institute of Technology, Kurukshetra
>> Mob. No. +91-7206435934 <+91%2072064%2035934>,
>>   +91-9897715970 <+91%2098977%2015970>
>>   
>>   
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/CAMTmor4-ZCztGPcEWv9wgeGuHUbz7eeT3qyHJGFJxnKE81mbgA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/044716c5-15f5-4f65-abaa-20c1c5d5351dn%40googlegroups.com.


Re: [sage-devel] How to install Cryptominisat-5.0.1 version in Sage-8.7 Inbox

2021-03-27 Thread Dima Pasechnik
this is certainly not recommended for "normal" use.

If you are trying to reproduce computations done years ago, perhaps try
installing a standalone version of cryptominisat, generate the input, and
feed it into the solver.



On Sat, 27 Mar 2021, 06:57 Dheeraj Sharma, 
wrote:

> Dear Sir,
>
> I have to specifically work on cryptominisat-5.0.1 version. I have tried
> to install it by running command "./sage -p cryptominisat-5.0.1" on
> terminal window (that is opened in Sage folder). But it is showing the
> following statements:
>
> dheeraj@dheeraj-Latitude-5490:~/sage/sage_installation/sage-8.7$ ./sage
> -p cryptominisat-5.0.1
> Attempting to download package cryptominisat-5.0.1
> >>> Checking online list of optional packages.
> >>> Checking online list of experimental packages.
> >>> Checking online list of huge packages.
> Error: could not find a package matching cryptominisat-5.0.1
>Try 'sage --package list' to see the available packages
>There is no package similar to cryptominisat-5.0.1
> You can find further packages at http://files.sagemath.org/spkg/
>
>
> I have further opened the web link provided in it. I have found that
> cryptominsat-5.0.1 is available on following link.
> http://files.sagemath.org/spkg/upstream/cryptominisat/index.html
>
> Please, tell me the procedure to install cryptominisat-5.0.1.
>
> I am working on following operating system.
> Distributor ID: Ubuntu
> Description: Ubuntu 14.04.6 LTS
> Release: 14.04
> Codename: trusty
>
> With Regards,
> Dr. Dheeraj Kumar Sharma
> Assistant Professor
> Department of Electronics & Comm. Engg.
> National Institute of Technology, Kurukshetra
> Mob. No. +91-7206435934,
>   +91-9897715970
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/CAMTmor4-ZCztGPcEWv9wgeGuHUbz7eeT3qyHJGFJxnKE81mbgA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1EU88_-z7jTcaHskYkcwuLxmhywyOj6E55DTHxZHSaow%40mail.gmail.com.


[sage-devel] How to install Cryptominisat-5.0.1 version in Sage-8.7 Inbox

2021-03-27 Thread Dheeraj Sharma
Dear Sir,

I have to specifically work on cryptominisat-5.0.1 version. I have tried to
install it by running command "./sage -p cryptominisat-5.0.1" on terminal
window (that is opened in Sage folder). But it is showing the following
statements:

dheeraj@dheeraj-Latitude-5490:~/sage/sage_installation/sage-8.7$ ./sage -p
cryptominisat-5.0.1
Attempting to download package cryptominisat-5.0.1
>>> Checking online list of optional packages.
>>> Checking online list of experimental packages.
>>> Checking online list of huge packages.
Error: could not find a package matching cryptominisat-5.0.1
   Try 'sage --package list' to see the available packages
   There is no package similar to cryptominisat-5.0.1
You can find further packages at http://files.sagemath.org/spkg/


I have further opened the web link provided in it. I have found that
cryptominsat-5.0.1 is available on following link.
http://files.sagemath.org/spkg/upstream/cryptominisat/index.html

Please, tell me the procedure to install cryptominisat-5.0.1.

I am working on following operating system.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.6 LTS
Release: 14.04
Codename: trusty

With Regards,
Dr. Dheeraj Kumar Sharma
Assistant Professor
Department of Electronics & Comm. Engg.
National Institute of Technology, Kurukshetra
Mob. No. +91-7206435934,
  +91-9897715970

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAMTmor4-ZCztGPcEWv9wgeGuHUbz7eeT3qyHJGFJxnKE81mbgA%40mail.gmail.com.