users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Iteratively calling Prolog from C


From: Manuel Carro
Subject: Re: Iteratively calling Prolog from C
Date: Thu, 17 Jul 2003 10:45:18 +0200

>> Well, I call them "accumulator" variables, although there
>> may be a better way to describe them. Factorial_nd is the
>> simplest example, I believe. Notice how the last
>> two variables in factorial_nd/5 are used to store values
>> over backtracking. Otherwise, the same principle is used in
>> fib_qmat_nd.pl, fib_range_nd.pl, and magic_sq.pl.

    These are accumulator variables, that name has been around for
tenths of years.  But you are not storing values over backtracking.
When you backtrack to a choicepoint in the computation you have the
same variable values as when that choicepoint was first created.

        MCL

________________________________________________
Nula aestetica sine etica. Ergo apaga y vĂ¡monos.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]