[mercury-users] backtracking?

hanberg at ruc.dk hanberg at ruc.dk
Fri Jul 16 05:41:11 AEST 2004


Hi

I'm having trouble running a somewhat heavy program. I implemented a theorem
prover using mercury, but I have trouble with the following lines:

:- pred proveable1(list(expr(T)), list(int), list(int)).
:- mode proveable1(in, in, out) is nondet.

proveable1([Head|Tail], OLDINTLIST, NEWINTLIST) :- proveable(Head, 4, INT),
proveable2(Tail, [INT|OLDINTLIST], NEWINTLIST).

proveable1(_, OLDINTLIST, NEWINTLIST) :- NEWINTLIST=OLDINTLIST.

I'm trying to test the speed on a rather large input which comes from a file.
Before these lines I have putted the file into a list which is the [Head|Tail]
part. The problem is getting the list of new int's out - the value indicating
how the algorithm ended. I get the following lines running the code on input
lists around 50 - 150 in length depending on the formulas in the list. I get the
following error:

Mercury runtime: memory zone nondetstack#0 overflowed
PC at signal: 134522191 (804a54f)
This may have been caused by a stack overflow, due to unbounded recursion.

I don't really know how to either get the ints out without backtracking or
extend the memory. Hope someone can help me.

Tony



--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list