Joachim Schimpf writes: | | | I didn't want to believe it at first, but you are right :-( | | The bug is that the mode declaration also affects the behaviour | of retract and retract_all: | | [eclipse 12]: mode ht_flag(++,?). | Yes (0.00s cpu) | | [eclipse 13]: assert(ht_flag(1,2)). | Yes (0.00s cpu) | | [eclipse 14]: retract(ht_flag(X,Y)). % Bug: fails because of mode | No (0.00s cpu) | | [eclipse 15]: ht_flag(1,Y). % was not retracted | Y = 2 | Yes (0.00s cpu) | | [eclipse 16]: retract(ht_flag(1,Y)). % this works... | Y = 2 | Yes (0.00s cpu) | | All right, this completely explains the observed behaviour. | As a workaround, you can obviously just remove the mode declaration. | Alternatively, if you only need retract_all/1, you can use | abolish/1 instead (and repeat the dynamic declaration). | I tried that, it works (of course), but it makes no difference. | | | > ... constant memory requirement. Before, memory was | > slightly increasing from query to query. | | One more remark, unrelated to the bug: if you have a server loop | that is supposed to run forever, and asserts/compiles are involved, | then you should call trimcore/0 between queries. This will do some | delayed deallocation of code memory. But since you observe | constant memory, maybe you do that already... | | Thanks for this hint. I was not aware of trimcore/0. It is not mentioned in the user manual, isn't it? Is there some other place where to find such information? This is not a critique - I'd just would be curious to know how to find such things. A question for my understanding: in the server endless loop, which is a tail recursive predicate, I essentially do a ( call(Query) -> something_good ; something_bad ) Usually the Query succeeds. Is it so that the open choicepoints in the execution of Query are removed? It is so, I guess... But if not, how to get rid of those? Does trimcore do that? Peter | -- | Joachim Schimpf / phone: +44 20 7594 8187 | IC-Parc, Imperial College / mailto:J.Schimpf@ic.ac.uk | London SW7 2AZ, UK / http://www.icparc.ic.ac.uk/eclipseReceived on Fri Jun 07 08:59:32 2002
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:16 PM GMT GMT