Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You are going to have a new love affair.


sci / sci.math.symbolic / Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-in timelimit

SubjectAuthor
* adding timelimit to CAS calls to integrate when CAS does not support built-in tiNasser M. Abbasi
`* Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-iclicliclic@freenet.de
 `* Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-inNasser M. Abbasi
  `- Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-inNasser M. Abbasi

1
Subject: adding timelimit to CAS calls to integrate when CAS does not support built-in timelimit
From: Nasser M. Abbasi
Newsgroups: sci.math.symbolic
Organization: A noiseless patient Spider
Date: Fri, 26 Jan 2024 06:48 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nma@12000.org (Nasser M. Abbasi)
Newsgroups: sci.math.symbolic
Subject: adding timelimit to CAS calls to integrate when CAS does not support
built-in timelimit
Date: Fri, 26 Jan 2024 00:48:27 -0600
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <uovkjr$2nl5d$1@dont-email.me>
Reply-To: nma@12000.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Jan 2024 06:48:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="961ba0f0be791c94b742c6a12b798cd7";
logging-data="2872493"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DgGzA5C6GCIqavyxZ4xEu"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:yrxedjjdPZi/UdLZg6ete38psoI=
Content-Language: en-US
View all headers

FYI;

I run some tests using different CAS systems that do not support
setting a timelimit on its calls.

For example Reduce and Fricas and Maxima and GIAC and others.

For me, timelimit() is the most important function, as without
it, it is very easy to make any CAS hang. Yet, strangely
open source CAS systems do not have such a basic function as
a built-in.

They do not have a direct way to insure a call to some command
such as integrate should not take more than say 30 seconds and
to return an error if the call exceeds this timelimit.

Commercial CAS systems Maple and Mathematica have an easy to use
built-in command for this. This document is meant to describe how
to add timelimit to other systems that do not support this.

This method only works and have been tested on Linux.

I found this method to be reliable and works well. It is
based on using the Linux command timeout and using
Python's subprocess.Popen().

Python is used as the main driver for all these scripts.

<https://12000.org/my_notes/faq/time_out_cas/index.htm>

--Nasser

Subject: Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-in timelimit
From: clicliclic@freenet.d
Newsgroups: sci.math.symbolic
Organization: Killfiles, Unlimited
Date: Fri, 26 Jan 2024 08:45 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.eyrie.org!news.killfile.org!.POSTED.port-212-202-10-122.dynamic.as20676.net!not-for-mail
From: nobody@nowhere.invalid (clicliclic@freenet.de)
Newsgroups: sci.math.symbolic
Subject: Re: adding timelimit to CAS calls to integrate when CAS does not
supportbuilt-in timelimit
Date: Fri, 26 Jan 2024 09:45:26 +0100
Organization: Killfiles, Unlimited
Message-ID: <65B37126.58FA9A48@nowhere.invalid>
References: <uovkjr$2nl5d$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: flea.killfile.org; posting-host="port-212-202-10-122.dynamic.as20676.net:212.202.10.122";
logging-data="2304938"; mail-complaints-to="news@news.killfile.org"
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de
View all headers

"Nasser M. Abbasi" schrieb:
>
> I run some tests using different CAS systems that do not support
> setting a timelimit on its calls.
>
> For example Reduce and Fricas and Maxima and GIAC and others.
>
> For me, timelimit() is the most important function, as without
> it, it is very easy to make any CAS hang. Yet, strangely
> open source CAS systems do not have such a basic function as
> a built-in.
>
> They do not have a direct way to insure a call to some command
> such as integrate should not take more than say 30 seconds and
> to return an error if the call exceeds this timelimit.
>

Presumably nobody felt the need for this back when these systems were
conceived because they were meant for console operation and a
computation could always be interrupted with Control-C or similar.

>
> [...]
>

Martin.

Subject: Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-in timelimit
From: Nasser M. Abbasi
Newsgroups: sci.math.symbolic
Organization: A noiseless patient Spider
Date: Fri, 26 Jan 2024 09:11 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nma@12000.org (Nasser M. Abbasi)
Newsgroups: sci.math.symbolic
Subject: Re: adding timelimit to CAS calls to integrate when CAS does not
supportbuilt-in timelimit
Date: Fri, 26 Jan 2024 03:11:50 -0600
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <uovt0n$2ot1f$1@dont-email.me>
References: <uovkjr$2nl5d$1@dont-email.me> <65B37126.58FA9A48@nowhere.invalid>
Reply-To: nma@12000.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Jan 2024 09:11:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="961ba0f0be791c94b742c6a12b798cd7";
logging-data="2913327"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18N5T9KGQiiUgcxNtRp+/l/"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:JZNyWGogJa/lE4DkypuJwzjuCjQ=
In-Reply-To: <65B37126.58FA9A48@nowhere.invalid>
Content-Language: en-US
View all headers

On 1/26/2024 2:45 AM, clicliclic@freenet.de wrote:
>
> "Nasser M. Abbasi" schrieb:
>>
>> I run some tests using different CAS systems that do not support
>> setting a timelimit on its calls.
>>
>> For example Reduce and Fricas and Maxima and GIAC and others.
>>
>> For me, timelimit() is the most important function, as without
>> it, it is very easy to make any CAS hang. Yet, strangely
>> open source CAS systems do not have such a basic function as
>> a built-in.
>>
>> They do not have a direct way to insure a call to some command
>> such as integrate should not take more than say 30 seconds and
>> to return an error if the call exceeds this timelimit.
>>

>
> Presumably nobody felt the need for this back when these systems were
> conceived because they were meant for console operation and a
> computation could always be interrupted with Control-C or similar.
>

Ok, but isn't the birth of Mathematica and Maple is around same
time frame as these other open source CAS systems? Mathematica
was born in 1988, and Maple in 1982. Sure, Reduce and Maxima
and Fricas are few years older, but not by much. May be 10 years?

Sympy is also a much younger CAS than all of them and it
has no timelimit() command. Also mupad has no timelimit()
built-in and I had to do many ticks in Matlab to implement it.

In Mathematica, TimeConstrained has date of 1988 on it.

<https://reference.wolfram.com/language/ref/TimeConstrained.html>

Also, open source CAS systems had all the time to add
such a built-in function since the 1970's or 1980's?

Btw, Maple timelimit() also has some problems I complained
about before. It does not always work (i.e. terminate
the call at the time requested). I could ask for 30 seconds
time limit, and it could terminate after 5 minutes or 10.

So even Maplesoft still needs to work/improve its
timelimit() function.

I found Mathematica's TimeConstrained function very robust
and always works and stops the call at the time limit requested.

--Nasser

>>
>> [...]
>>
>
> Martin.

Subject: Re: adding timelimit to CAS calls to integrate when CAS does not supportbuilt-in timelimit
From: Nasser M. Abbasi
Newsgroups: sci.math.symbolic
Organization: A noiseless patient Spider
Date: Fri, 26 Jan 2024 19:59 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nma@12000.org (Nasser M. Abbasi)
Newsgroups: sci.math.symbolic
Subject: Re: adding timelimit to CAS calls to integrate when CAS does not
supportbuilt-in timelimit
Date: Fri, 26 Jan 2024 13:59:39 -0600
Organization: A noiseless patient Spider
Lines: 78
Message-ID: <up12vd$30hh8$1@dont-email.me>
References: <uovkjr$2nl5d$1@dont-email.me> <65B37126.58FA9A48@nowhere.invalid>
<uovt0n$2ot1f$1@dont-email.me>
Reply-To: nma@12000.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 26 Jan 2024 19:59:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="961ba0f0be791c94b742c6a12b798cd7";
logging-data="3163688"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/B00hJ2K41IULZGmuPBewH"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:oOc8NsqOQdTMjCKLIjJrhH8VeAY=
Content-Language: en-US
In-Reply-To: <uovt0n$2ot1f$1@dont-email.me>
View all headers

Fyi;

I was told that Fricas now has timeout which is good. I did not
know about it. First open source CAS to have timeout !

https://fricas.github.io/api/TimeoutPackage.html#index-1

----------------
eval_with_timeout: (() -> S, Integer) -> Union(S, failed)
eval_with_timeout(f, t) calls f with timeout of t seconds.
Returns value computed by f or “failed” if f did not finish within t seconds.
-------------------

--Nasser

On 1/26/2024 3:11 AM, Nasser M. Abbasi wrote:
> On 1/26/2024 2:45 AM, clicliclic@freenet.de wrote:
>>
>> "Nasser M. Abbasi" schrieb:
>>>
>>> I run some tests using different CAS systems that do not support
>>> setting a timelimit on its calls.
>>>
>>> For example Reduce and Fricas and Maxima and GIAC and others.
>>>
>>> For me, timelimit() is the most important function, as without
>>> it, it is very easy to make any CAS hang. Yet, strangely
>>> open source CAS systems do not have such a basic function as
>>> a built-in.
>>>
>>> They do not have a direct way to insure a call to some command
>>> such as integrate should not take more than say 30 seconds and
>>> to return an error if the call exceeds this timelimit.
>>>
>
>
>>
>> Presumably nobody felt the need for this back when these systems were
>> conceived because they were meant for console operation and a
>> computation could always be interrupted with Control-C or similar.
>>
>
> Ok, but isn't the birth of Mathematica and Maple is around same
> time frame as these other open source CAS systems? Mathematica
> was born in 1988, and Maple in 1982. Sure, Reduce and Maxima
> and Fricas are few years older, but not by much. May be 10 years?
>
> Sympy is also a much younger CAS than all of them and it
> has no timelimit() command. Also mupad has no timelimit()
> built-in and I had to do many ticks in Matlab to implement it.
>
> In Mathematica, TimeConstrained has date of 1988 on it.
>
> <https://reference.wolfram.com/language/ref/TimeConstrained.html>
>
> Also, open source CAS systems had all the time to add
> such a built-in function since the 1970's or 1980's?
>
> Btw, Maple timelimit() also has some problems I complained
> about before. It does not always work (i.e. terminate
> the call at the time requested). I could ask for 30 seconds
> time limit, and it could terminate after 5 minutes or 10.
>
> So even Maplesoft still needs to work/improve its
> timelimit() function.
>
> I found Mathematica's TimeConstrained function very robust
> and always works and stops the call at the time limit requested.
>
> --Nasser
>
>>>
>>> [...]
>>>
>>
>> Martin.
>

1

rocksolid light 0.9.8
clearnet tor