Hi,
I need a way to find if a given predicate is dynamic, static or
built-in. The Reference Manual lists the usual predicate_property/2 but
does not enumerate the possible predicate properties. Can someone
provide me with some more info or a possible solution? Thanks.
Regards,
Paulo
-----------------------------------------------------------
Paulo Jorge Lopes de Moura
Dep. of Mathematics and Informatics Office 4.32
University of Beira Interior Phone: +351 75 319700
6200 Covilhc Fax: +351 75 319732
Portugal
mailto:pmoura(a)noe.ubi.pt
http://www.ci.uc.pt/logtalk/pmoura.html
-----------------------------------------------------------
Hi people,
here again with more problems.
Look at this small program:
**************************************
:- concurrent proceed/2.
:- use_module(library(concurrency)).
:- use_module(library(system)).
:- use_module(library(random)).
not(X) :- X,!,fail.
not(X).
repeat.
repeat :- repeat.
producer(N,0) :- display(end(N)),nl.
producer(N,M) :-
repeat,
random(1,100,I),
not(proceed(N,I)), <==== ????
display(proceed(N,I)),
nl,
asserta_fact(proceed(N,I)),
M2 is M - 1,
producer(N,M2).
start(0).
start(N) :-
eng_call(producer(N,5),create,create),
M is N - 1,
start(M).
*****************************************
This program starts N threads.
Each thread calculates a random number. Then, if there is already a fact
with this number fails and tries to recalculate another one. If not,
asserts a fact with the number and the thread identifier. Each thread
repeats this operation 5 times.
If I run this program as it is, it doesn't work. The strange thing is
that when I remove the marked line (<==== ????) then it works!!!
Do you experiment the same behaviour? Anybody knows what's wrong?
I'm using Ciao1.5p166 and Linux.
Thanks in advance.
______________________________________________________________________________
_/ _/ _/_| Jordi Sabater Mir
/ _/ _/ _| IIIA - Institut d'Investigacio en Intel.ligencia Artificial
_/ _/___| CSIC - Spanish Scientific Research Council
_/ _/____| Campus Universitat Autonoma de Barcelona
/ _/ _| 08193 Bellaterra, Catalonia, Spain
Ph.: +34 3 5809570 Fax.: +34 3 5809661
jsabater(a)iiia.csic.es http://www.iiia.csic.es
______________________________________________________________________________
I was trying the example that Manuel sent about communication
between threads and, although the example itself doesn't work on my
installation (any idea?) the ideas in the example were enough to implement
what I needed.
Thanks Manuel.
Another question for people who are using Ciao-Threads in Linux. Why after
using eng_call to create a new thread, Ciao creates a new process? Is it
normal or perhaps am I doing something wrong?
Thanks again.
______________________________________________________________________________
_/ _/ _/_| Jordi Sabater Mir
/ _/ _/ _| IIIA - Institut d'Investigacio en Intel.ligencia Artificial
_/ _/___| CSIC - Spanish Scientific Research Council
_/ _/____| Campus Universitat Autonoma de Barcelona
/ _/ _| 08193 Bellaterra, Catalonia, Spain
Ph.: +34 3 5809570 Fax.: +34 3 5809661
jsabater(a)iiia.csic.es http://www.iiia.csic.es
______________________________________________________________________________
Hi people,
Do you know if there is possible to have information shared by two
or more threads? How can threads communicate between them?
Thanks.
______________________________________________________________________________
_/ _/ _/_| Jordi Sabater Mir
/ _/ _/ _| IIIA - Institut d'Investigacio en Intel.ligencia Artificial
_/ _/___| CSIC - Spanish Scientific Research Council
_/ _/____| Campus Universitat Autonoma de Barcelona
/ _/ _| 08193 Bellaterra, Catalonia, Spain
Ph.: +34 3 5809570 Fax.: +34 3 5809661
jsabater(a)iiia.csic.es http://www.iiia.csic.es
______________________________________________________________________________
Hi everybody ...
I just get the ciao system and as I read the manual, it look impressive
to me .
Nice prolog !!!
But I plan to use it to access database and I don't find where is the
'database mediator server' I may use in the windows .
Should someone help me to find how to make it work ????
I prefer unix than win and may be, another possible implementation
should be made using Tclodbc - ODBC extension for tcl
http://www.solagem.fi/~rnurmi/tclodbc.html
Sorry for my poor english ... and thanks.
Alain