fd variables in GNU Prolog 
Author Message
 fd variables in GNU Prolog

Hi,

I am an absolute beginner in prolog and have to write an interface to
the finite domain constraint solving mechanism in GNU Prolog.

GNU Prolog provides a C interface for "normal" prolog terms. Via the
type "WamWord" I am able to send and receive prolog terms in C but it
did not work for fd variables ...

                         :
       ___       ________:________________________
      |   |     |        :                        |
      |   |     |        :                        |
      |   |     |        :                        |
      |  -------->  C  <--->     GNU PROLOG       |
      |   |     |        :                        |
      |   |     | inter- :             ^ ???      |
      |   |     |        :   __________|_______   |
      |   |     |  face  :  |          |       |  |
      |  <--------       :  | ???      v       |  |
      |   |     |      <------>    fd          |  |
      |   |     |        :  |                  |  |
      |   |     |        :  |__________________|  |
      |___|     |________:________________________|
                         :
                         :

So I tried to hide the fd variables and only send the min. and max.
value through the interface. At this point I had the problem to get
"global" access to a fd variable in prolog. I defined a clause that
returns a certain variable. I was able to set the min. and max. values
for this variable and to ask for their values (in the same relation).
Calling another relation from the first relation and setting other min.
and max. values for the same variable (via the defined clause) changed
the values only in the actual relation ("locally").

Seems that it was handled like "call by value" ... (?)

My first question is: is there any possibility to get access to fd
variables directly via the C interface?

... and my second question: how can I access one/the same fd variable in
prolog from several relations without handleing it as a parameter?

Any ideas will be very welcome.

Thanks!

Wolfgang



Sat, 14 Aug 2004 20:51:16 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. FD and the GNU linker?

2. system:fd-stream-fd

3. Depending On Variable for FD

4. SWI Prolog Vs GNU Prolog

5. GNU prolog, SWI-prolog and here documents

6. Newbie question: Logical variable in CLP/Prolog vs variable in C

7. "Unbound variable" error in GNU Lilypond

8. gdb and gnu's f77 , printing variables from included files

9. gnu smalltalk: stix display variable

10. bedevere: The Python wrapper to GNU Prolog

11. Newbie GNU prolog Loading question

12. Problem with GNU Prolog

 

 
Powered by phpBB® Forum Software