grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
129 stars 24 forks source link

No obvious timeout control available #360

Open wdkrnls opened 2 months ago

wdkrnls commented 2 months ago

I want to avoid getting stuck into a practically infinite search. Is there a way to cause all computations to error out if clock time exceeds e.g. 3 seconds? I'm looking for functionality like:

SetTimeout(3) 
InfiniteLoop()

Or

WithTimeout(3) Solve({x + Sqrt(y) == 1, x + y == 2}, {x, y})

It would be nice to limit max iterations as well. However, that seems like something which would have to happen on a case by case basis.

WithMaxIterations(10) SumTriangle(100)
wdkrnls commented 2 months ago

I saw in the documentation there was a GetTime command. However, I couldn't find it defined. Even time didn't work because GetTime didn't do anything.

 In Time(Solve(x/y == 1, x))
[1] GetTime(True) seconds taken\n
wdkrnls commented 1 month ago

I did find that setting MaxEvalDepth(100) can help with the Solve situation.