Search found 13 matches

by Monikuta
Mon Jun 02, 2008 4:18 pm
Forum: JIProlog
Topic: Error while loading Logtalk into JIProlog
Replies: 5
Views: 21285

Re: Error while loading Logtalk into JIProlog

I made the following modifications: :- private(map1/4). :- meta_predicate(map1(*, *, *, ::)). :- mode(map1(+atom, +tree, -tree, -callable), zero_or_one). and map(Pred, Old, New) :- map1(Pred, Old, New, _). map1(Pred, t(Key1, Value1, Left1, Right1), t(Key2, Value2, Left2, Right2), Goal) :- Goal =.. [...
by Monikuta
Mon Jun 02, 2008 12:27 pm
Forum: JIProlog
Topic: Error reading a list in JIProlog
Replies: 1
Views: 4153

Error reading a list in JIProlog

For my Checkers game, I am using a class Board that has two lists: -one for the computer player's pieces and -one for the human player's pieces I have tried my code in SWI-Prolog with Logtalk and it works just fine. But, when switching to JIProlog with Logtalk I get an error when trying to read a li...
by Monikuta
Mon Jun 02, 2008 12:08 pm
Forum: JIProlog
Topic: Error while loading Logtalk into JIProlog
Replies: 5
Views: 21285

Re: Error while loading Logtalk into JIProlog

I did the modification you suggested. But I get the following error: compiling object bintree... ERROR! error(type_error(numeric_expression), context(','(:: ',') > 0, file(undefined, 0))) in clause: map(_10290053, t(_5384363, _32249502, _12647886, _5694431), t(_9068888, _16570805, _3743881, _8851935...
by Monikuta
Mon Jun 02, 2008 9:23 am
Forum: JIProlog
Topic: Error while loading Logtalk into JIProlog
Replies: 5
Views: 21285

Error while loading Logtalk into JIProlog

I tried loading Logtalk into JIProlog by calling: {roots(loader)}. but I keep getting the following error message: <<< loading source file bintree... >>> compiling source file bintree... compiling object bintree... ERROR! unknown_error in clause: map(_26219432, _33204885, _30747539) :- map(_26219432...
by Monikuta
Thu May 29, 2008 6:30 am
Forum: SWI-Prolog
Topic: Integration of SWI-Prolog+Logtalk in Java
Replies: 1
Views: 4512

Integration of SWI-Prolog+Logtalk in Java

I want to integrate SWI-Prolog+Logtalk in Java.
I want to give as parameters to a query Java objects and return the result of the SWI-Prolog+Logtalk query in Java to process it.
Is there any tool for such integration?
Thank you in advance,
Monica Dogaru
by Monikuta
Wed May 28, 2008 3:16 pm
Forum: Help
Topic: Using a counter in Logtalk+SWI-Prolog
Replies: 6
Views: 10344

Re: Using a counter in Logtalk+SWI-Prolog

Thank you very much for your help, I greatly appreciate it. I had some other bug, and I thought it had to do with "counter". But it was someting else...got rid of it, now it's ok :)
I will come back with details or questions.
Thanks again!
Yours sincerely,
Monica Dogaru
by Monikuta
Wed May 28, 2008 6:04 am
Forum: Help
Topic: Using a counter in Logtalk+SWI-Prolog
Replies: 6
Views: 10344

Re: Using a counter in Logtalk+SWI-Prolog

Hello, thank you very much for your prompt answer, I found it very helpful. This problem is solved and it works fine. But, what should I do if I need to have a call for the counter method inside my sorting algorithm? I tried several ways, but did not succeed :( sortingAlgorithm(In,Out,End):- counter...
by Monikuta
Tue May 27, 2008 7:37 pm
Forum: Help
Topic: Using a counter in Logtalk+SWI-Prolog
Replies: 6
Views: 10344

Re: Using a counter in Logtalk+SWI-Prolog

I tried modifying the code from the first attempt: :- public(counter/1). :- dynamic(counter/1). init :- ::retractall(counter(_)), ::asserta(counter(7)). countup :- init, counter(Count), ::retractall(counter(Count)), Newcount is Count - 1, ::asserta(counter(Newcount)). makeBoard([White,Red,_]):- init...
by Monikuta
Tue May 27, 2008 6:46 pm
Forum: Help
Topic: Using a counter in Logtalk+SWI-Prolog
Replies: 6
Views: 10344

Using a counter in Logtalk+SWI-Prolog

Hello, i want to use a counter for drawing the board of my Checkers game. I am using Logtalk having SWI-Prolog as the back-end Prolog compiler. I tried in two ways, but I received some errors and did not manage to eliminate them. First attempt: :-object(board, instantiates(class), specializes(object...
by Monikuta
Tue May 20, 2008 6:38 am
Forum: Help
Topic: Parameter Passing to Logtalk predicates
Replies: 1
Views: 3776

Parameter Passing to Logtalk predicates

Hello, Suppose I want to create inside my object "main" some random objects of type "student" and add them to a list. How do I pass an object of type "student" as a parameter to a predicate defined inside the object "main" ? I tried using "student(XI,XN,XM)" as a parameter to the predicates "member"...
by Monikuta
Mon May 19, 2008 8:47 pm
Forum: Help
Topic: Object instances in Logtalk
Replies: 2
Views: 4593

Re: Object instances in Logtalk

This was very useful, thank you very much :D To begin with, I am trying some small examples in SWI-Prolog with Logtalk, just to accomodate with the syntax. The next step is continuing with my bachelor's degree project in Logtalk and JIProlog :) I will come back with details and questions. I am since...
by Monikuta
Mon May 19, 2008 5:55 pm
Forum: Help
Topic: Object instances in Logtalk
Replies: 2
Views: 4593

Object instances in Logtalk

Hello, I want to create in my object "main" instances of type "student". I have read the Logtalk documentation and looked through the examples that come with Logtalk, but I still do not understand :( :- object(main). start :- // here I want to make S new object student :- end_object. :- object(stude...
by Monikuta
Mon May 12, 2008 12:50 pm
Forum: JIProlog
Topic: problem integrating Logtalk in JIProlog
Replies: 3
Views: 5863

problem integrating Logtalk in JIProlog

I want to use the object-oriented feature of Logtalk and therefore i am trying to integrate it into JIProlog v3.0.3-1. Logtalk should work with JIProlog starting from v3.0.2-6. I am doing the following: 1. starting JIProlog IDE 2. loading ji.config from the Logtalk\configs 3. loading logtalk.pl (com...