I think so too. I solved that question with your very helpful answer.
I take this opportunity to ask you other two smaller questions. I'm trying to make some tests on some popular Prolog systems, like SWI-Prolog, SICStus, because I'd like, for my thesis, to show a comparison between the execution time necessary for solving a query with Tail Call Optimization enabled and the time spent with no optimization. In SWI-Prolog that's easy, because there is an appropriate flag, which can be changed with the set_prolog_flag/2 predicate. In SICStus, instead, I didn't found anything like that. I tried to add to my theory a dummy goal to avoid tail call optimization, but it seems not to work (execution time doesn't change). Do you have any suggestions? Do you know other Prolog systems in which it is simple to disable tail call optimization?
Moreover, to measure execution time, I write the following line: statistics (runtime, [T0|_]), doReps(fatt(20,F), 1000), statistics(runtime, [T1|_]), T is T1 -T0. DoReps is a predicate that I created to run the same query many times. The theory is about factorial computation. (in the example: 20!) I noticed that the time stored in the T variable changes every time I run the line above. Am I making some mistake?
Thank you again,
Silvia Umiliacchi
----Messaggio originale---- Da: Bart.Demoen(a)cs.kuleuven.be Data: 26/07/2011 19.53 A: "silviaumiliacchi(a)libero.it"<silviaumiliacchi(a)libero.it> Cc: <ciao-users(a)clip.dia.fi.upm.es> Ogg: Re: [Ciao-users] R: Re: Question about tail call optimization
first of all, thank you for your answer. You caught my doubt very well. It would be very helpful if you could send me the report you told about.
I think something is wrong with ciao-users(a)clip.dia.fi.upm.es. This was posted about a month ago and answered - no ?
Cheers
Bart Demoen
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm