Subject: Re: [SWIPL] aaahhhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!! nonsense!!!!!!!!

From: Jan Wielemaker <[email-masked]>
Date: Thu, 22 Nov 2001 21:19:30 +0100

>   argh!!! look at this!!!
> 
> handle_msg(Coordinator,ask_words(Ontology,CONCEPT)) :-
> 
> /*1*/
> linguistic_agents:ag_IdCard(Coordinator,[coordinator,[]]),
> /*2*/
> write('Concept is: '),write_ln(CONCEPT),
> /*3*/
> Ontology:find_Words(CONCEPT,Bag_of_Words),
> /*4*/
> write(Bag_of_Words).
> 
> 
> Ok, don't even try to understand what it does.
> Just know that:
> 
> row1: check if message-sender Coordinator is what he claims to be
> 
> row2: i write CONCEPT to see if no problem has occurred (it has to be a
> number), this row is not strictly necessary
> 
> row3: use module Ontology procedure find_Words to extract a list of
> synonyms related to CONCEPT (that it'll be Bag_of_Words).
> 
> row4: write(Bag_of_Words). don't think you need explanations  [;-)]
> 
> 
> Ok,when my agent system works, i got this result on the shell:
> 
> ReadyList is: $stream(1998822)
> Msg from Agent: Reiser@localhost. ReadStream: $stream(1998822)
> Msg read is: ask_words(wordnet_track_hound, 102443613)
> Concept is: 102443613
> []
> ok
> Where the '[]' is a empty list, this should mean there are no lexicals,
> but i know there are, and that my system "teorically" works fine, infact
> (and this is absurd!!!), if i manually write on the shell:
> 
> handle_msg(['Reiser',localhost],ask_words(wordnet_track_hound, 102443613)).
> 
> I got:
> 
> Concept is: 102443613
> [circuit_board, circuit_card, board, card]
> 
> that is the right result!!!!!!!!
> 
> there's no way why it works this way, the system runs the same predicate
> that i've manually written in the shell...but it gives no result (empty
> list)....i fear it may be some low-level bug....

Never say never, but I doubt it.  Most obvious things to check for
(you've not given us much to go on) are environment settings, working
directory, etc. that differ between the two invocations and are somehow
relevant.  Best advice

	* If you can manage the server process to talk to the user
	to do so and run in trace-mode.  Details depend on how Prolog
	is used, which OS, etc.

	* Print tactical messages to a file and see where things go
	wrong if you can't talk to a user directly.

Depending on the setup, debugging server-embedded (Prolog) applications
can be a nightmare ...

	Cheers --- Jan