Search found 48 matches

by Victor NOEL
Tue Apr 08, 2008 12:43 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

The above event handlers will not work as you can only monitor messages sent using the ::/2 control construct; the predicate test/3 is called directly and is thus invisible as far as events areconcerned. In this case, you will need to drop the predicate test1/3 and make test/3 public. Ok, so I have...
by Victor NOEL
Tue Apr 08, 2008 11:20 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

I understand more now, so I applied your advices and wrote a little example like that : :- category(ctg, implements(monitoring)). :- public(test1/3). test1(X, Y, Z) :- test(X, Y, Z). test(X, Y, Z) :- a(1, X), a(2, Y), a(3, Z). after(_, test(X, Y, Z), _) :- writeq(X), write(' '), writeq(Y), write(' '...
by Victor NOEL
Tue Apr 08, 2008 10:12 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

You may use Logtalk support for event-driven programming. Define appropriate "before" and "after" event handlers for the predicates in the Gorgias category that you may want to trace at runtime. When debugging, turn events support on. For production code, run with events support off (which also imp...
by Victor NOEL
Tue Apr 08, 2008 8:42 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

I have a new question now :)

Is there a way to put in gorgias code some debugging information that would be compiled only if logtalk debug is on ?

Something that would not impact performance when I don't need it ...

Like that I would be able to make gorgias developer friendly :)

Thanks
by Victor NOEL
Mon Apr 07, 2008 11:41 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

Make sure that the non-threaded version of your code is working properly before trying to multi-thread it. In order to get all the solutions from a threaded_call/1-2 call, you need to backtrack over the threaded_exit/1-2 call. Your snippet of code does not do that, hence my suggestion for using thr...
by Victor NOEL
Mon Apr 07, 2008 11:03 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

You have a typo on the definition of the collect/1 predicate, in the threaded_exit/2 call. It should be You are right, but I just added the Tag and when it wasn't here, it wasn't working neither. In addition, you should use threaded_once/2 instead of threaded_call/2 in the spawn_extend/2 predicate....
by Victor NOEL
Mon Apr 07, 2008 9:47 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

I have installed the git version of swi-prolog, the svn version of logtalk, and the problem still occurs. This is the code I use. prove(Query, QDs) :- findall(qd(Query, Delta0), ::resolve(Query, Delta0), QDs), % resolve using "vanilla" interpreter spawn_extend(QDs, Goals), collect(Goals). spawn_exte...
by Victor NOEL
Sun Apr 06, 2008 5:02 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

The problem, however, is that Gorgias uses operations such as intersection/3 or union/3 where it's not clear which order should be preserved. For example, consider the following query: | ?- unordset::union([1,2,3,4], [0,2,4,5], Union). Union = [1,3,0,2,4,5] yes Depending on how you define the union...
by Victor NOEL
Sat Apr 05, 2008 1:32 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

After I tried a lot of things, this what I got : The idea is to try to prove a Query and get in return a list of instancied queries with their corresponding Deltas constructed by extend. The differents queries are found by resolve with a list (Delta0) of predicate that support it, and extend constru...
by Victor NOEL
Sat Apr 05, 2008 10:07 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

Take a look to the multi-threading examples in the current Logtalk development version, especially to the "primes" example. Ok, I started to look at them, but I didn't see this one :) If you chose to use the latest development version of Logtalk to take advantage of the multi-threading features, be...
by Victor NOEL
Fri Apr 04, 2008 2:55 pm
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

And a second one :) I am trying to use the threaded/1 predicate to do and-parallelism but when I use the : :- threaded. directive in the gorgias category, I get this error : ERROR! domain_error(object_directive, threaded/0) in directive: :-threaded above line: 25 ERROR: Unknown error term: error(dom...
by Victor NOEL
Fri Apr 04, 2008 9:54 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

Another question : Is there a reason why there is no set operation on unordered set like in the lists.pl from swi-prolog ? Or maybe there is but I couldn't see it :) Because lists order is important for gorgias (or at least for me about how I can understand the semantic of the results it give me :) ...
by Victor NOEL
Fri Apr 04, 2008 9:04 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

Looks like all is working great now (I just applied r4185 to lgt 2.31.4). I am modifying a little gorgias to better handle all the dynamic predicates, next I will take a look at all the union operation that needed to be sorted to see if it can be better handled. After that I will post here a better ...
by Victor NOEL
Thu Apr 03, 2008 11:46 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

Oh ok :)

I will wait for a fix, thanks you for the fast repy :)
by Victor NOEL
Thu Apr 03, 2008 9:43 am
Forum: Porting Prolog applications
Topic: Gorgias port
Replies: 61
Views: 91278

Re: Gorgias port

Hello, In fact, I can't add abducible(_,_) :- fail. to gorgias.lgt because gorgias.lgt is a category and can't have dynamic (abducible) predicates declared in it :) So I tried to adopt the trick detailed in http://logtalk.org/manuals/userman/categories.html : using a predicate abducible_/2 defined i...