Re: [eclipse-clp-users] mapping between java and eclipse

From: Maged Zamzam <maged.zamzam_at_...6...>
Date: Fri, 23 Apr 2010 22:27:20 +0200
Hey Carole,
The problem here is that Java-Eclipse interface does not recognize the * as
a member in the list, however it recognizes it as a functor (a predicate).
Java-Eclipse interface does not recognize any strings or chars in the CP
code (As far as I understand and tested).
What you can do here is that taking each element in the collection one by
one, you will find a method called getFunctor() which will return * and then
you will parse everything you have.
For example, you will get String s = arg(1) + result.getFunctor() + arg(2).

Hope this would be helpful :)

On Fri, Apr 23, 2010 at 10:21 PM, carole dawood <carole.dawood@...6...>wrote:

> Hello,
> In my CP code, i have a return from my query a list of lists of
> terms however i can not display it in my java Code .
> My query is :
>
> ?- solve(A, C, S, 32).
>
> A = [[1 * 11.34], [1 * 11.34], [0 * 11.34], [0 * 11.34]]
>
> C = []
>
> S = [[1 * 14.5], [1 * 14.5], [0 * 14.5], [0 * 14.5]]
>
> In Java i get it like this:
>
> result.arg(2)->result1[[com.parctechnologies.eclipse.CompoundTermImpl with
> [functor=* arity=2 arg(1)=1 arg(2)=11.34]],
> [com.parctechnologies.eclipse.CompoundTermImpl with [functor=* arity=2
> arg(1)=1 arg(2)=11.34]], [com.parctechnologies.eclipse.CompoundTermImpl with
> [functor=* arity=2 arg(1)=0 arg(2)=11.34]],
> [com.parctechnologies.eclipse.CompoundTermImpl with [functor=* arity=2
> arg(1)=0 arg(2)=11.34]]]
>
>
>
> result.arg(3)->result2[]
>
>
>
> result.arg(4)->result3[[com.parctechnologies.eclipse.CompoundTermImpl with
> [functor=* arity=2 arg(1)=1 arg(2)=14.5]],
> [com.parctechnologies.eclipse.CompoundTermImpl with [functor=* arity=2
> arg(1)=1 arg(2)=14.5]], [com.parctechnologies.eclipse.CompoundTermImpl with
> [functor=* arity=2 arg(1)=0 arg(2)=14.5]],
> [com.parctechnologies.eclipse.CompoundTermImpl with [functor=* arity=2
> arg(1)=0 arg(2)=14.5]]]
>
>
>
> However another list of lists is displayed normally in java with the same
> code, i did not change anything in the code. Just instead of having a list
> of lists of numbers which is the below CP code, i have a list of lists of
> terms which is above and is not displayed properly..
>
> ?- solve(A, C, S, 32).
>
> A = [[1], [1], [0], [0]]
>
> C = []
>
> S = [[1], [1], [0], [0]]
>
> i normally get in java, a corresponding list of lists:
>
> result.arg(2)->result1[[1], [1], [0], [0]]
>
> result.arg(3)->result2[]
>
> result.arg(4)->result3[[1], [1], [0], [0]]
>
> Thank you a lot,
>
> Carole Dawood
>
> Computer Science and Engineering
>
> German University in Cairo
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>
>


-- 
-----------
Maged Zamzam
Computer Science and Engineering
German University in Cairo
Egypt.

Follow me on Twitter: @mandofagasta
Facebook: facebook.com/mandofagasta
Skype ID: mandofagasta
Received on Fri Apr 23 2010 - 20:27:28 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST