[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic Allocation seems to crash gprolog (follow-up)
From: |
Daniel Diaz |
Subject: |
Re: Dynamic Allocation seems to crash gprolog (follow-up) |
Date: |
Fri, 14 Dec 2001 19:48:56 +0100 |
Leonardo, there is a bug in your program that makes it create a lot of terms in
the heap (compound
terms).
I have tried your program with SWI-Prolog, Yap and SICStus Prolog. In all
systems an overflow
occurs.
Sorry to not enough time to help you to find the problem...
To makes the program under those systems I have defined:
% not all systems accept several declarations separated by comma
:- dynamic(parent/2).
:- dynamic(root/1).
:- dynamic(is_parent/2).
:- dynamic(is_root/1).
:- dynamic(a/1).
new_atom(X) :-
(retract(a(I)) ; I = 0), !,
I1 is I+1,
asserta(a(I1)),
name(I1,LCodes),
atom_codes(IA,LCodes),
atom_concat('tree_', IA, X).
for(I,I,J):-
I =< J.
for(X,I,J) :-
I < J,
I1 is I+1,
for(X,I1,J).
For yap, I had to rename path/1 in my_path/1 (path/1 is a built-in).
"Leonardo B. Lopes" wrote:
>
> Dear Daniel and Friends,
>
> This is an update on the message I sent earlier. I upgraded to
> 1.2.8 and the problem still persisted... I appreciate any help.
>
> Thanks!
--
Daniel Diaz address@hidden
http://pauillac.inria.fr/~diaz
gprolog --version 2>&1 | sed -n -e 's/By //p'