axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Ability to guarantee a non-hanging Axiom?


From: C Y
Subject: [Axiom-developer] Ability to guarantee a non-hanging Axiom?
Date: Tue, 24 Jan 2006 12:12:59 -0800 (PST)

Admittedly this is not a problem I have encountered yet, but there are
general problems with solving some types of problems where the user
doesn't know when the computer will not succeed in reasonable time, or
there are multiple methods available (some of which yield a quick
solution in special cases) and the user doesn't know which method to
apply.  Is there a way to have Axiom, in cases where a calculation goes
for n seconds without returing an answer Axiom pauses the calculation
and prompts the user if they want to continue, and if so for how long? 
I don't know if this would require some sort of lisp image level magic,
but I was thinking maybe a macro could wrap every function call with a
"check time" conditional.  Then when a new input was sent from the
user, a global "running time" variable could keep track of how long
since the input was provided.  The "check time" conditional could see
if the total time since input was too great, and if so rather than
proceeding it could offer the user a prompt asking if they wanted to
continue.  If yes with no input for new running time, just reset the
"running time" value to zero and proceed with the actual function call.
 If a new running time limit is provided, subsequent checks can be
against that limit.  If the answer is no, the calculation can be
abandoned, a return of "calculation aborted" returned, and a new input
prompt provided.

This only works if a long calculation is calling more than one lisp
function, but for at least a fair number of cases it would work.  I
don't know how to ensure a "lisp kernel level" checkpoint of the
calculation, but that would be the ideal.

For some things, like solve, it would also be nice to use this feature
to do a "quick check" of a wide variety of solution techniques.  Say
there are four methods of finding some number related to a matrix, and
some are better for sparse and some are better for dense matricies. 
The difference might be so great that the user will notice a difference
if one method is tried vs. another (e.g. milliseconds vs. seconds). 
Since it's impossible to know this in advance, one strategy is to do a
"quick check" - run each technique on the problem with a max allowable
time of a fraction of a second, then perhaps a second each, and then
either pick one technique and run with it or contine to bump the time
each individual routine gets to try it.  Checkpointing each routine
would be nice but is probably very difficult to implement.  But if the
timing mechanism were in place it would make this kind of thing much
easier to do.

Does anybody know anything about such techniques?  i saw it mentioned a
few times on the Maxima list and it made sense to me, but I don't know
what the low level problems would be like.

Cheers,
CY

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]