Problem with obtaining an result in java

From: Kronawitter Katharina <k.kronawitter_at_t-online.de>
Date: Wed 30 Mar 2005 10:22:08 PM GMT
Message-ID: <000001c53576$ee070e20$b6e2fad9@SecondLife.local>
Hi,

can you help me?

I've got a constraint logic program without variables in the head
(because of the limit of 255 variables) and I don't know how to get a
solution for the variables in the program into my Java-Programm.

With variables in the head, I was able to get the results for the
variables like that:

String call = "h(F_l_BWB_t00_t0002, F_s_BWB_t00_t0002,
F_m_BWB_t00_t0002).";
CompoundTerm result = eclipse.rpc(call);
for (int i = 1; i <= result.arity(); i++) {

       Object o = result.arg(i);
}

As that doesn't work anymore, I tried to use write-statements in the
program, but then, the results are only in the standard-output and I
can't access the values.


Below, I've attached an example.

Thank you very much for your help!!!

Katharina
------------------------------------------------------------------------
-----------------------------------------------------
:- lib(ic).
h :-
F_m_BWB_t00_t0001 #>= 1 ,
F_m_BWB_t00_t0001 #=< 1 ,
F_m_BWB_t00 #>= 2 ,
F_m_BWB_t00 #=< 3 ,
F_m_BWB_t00 #= F_m_BWB_t00_t0001 + F_m_BWB_t00_t0002 ,
F_BWB_t00_t0002 #>= 6 ,
F_BWB_t00_t0002 #=< 8 ,
F_BWB_t00_t0002 #= F_s_BWB_t00_t0002 + F_l_BWB_t00_t0002 +
F_m_BWB_t00_t0002 ,
F_s_BWB_t00_t0001 #>= 1 ,
F_s_BWB_t00_t0001 #=< 1 ,
F_s_BWB_t00 #>= 4 ,
F_s_BWB_t00 #=< 5 ,
F_s_BWB_t00 #= F_s_BWB_t00_t0002 + F_s_BWB_t00_t0001 ,
F_l_BWB_t00_t0001 #>= 1 ,
F_l_BWB_t00_t0001 #=< 1 ,
F_BWB_t00 #>= 9 ,
F_BWB_t00 #=< 11 ,
F_BWB_t00 #= F_BWB_t00_t0002 + F_BWB_t00_t0001 ,
F_BWB_t00 #>= 9 ,
F_BWB_t00 #=< 11 ,
F_BWB_t00 #= F_m_BWB_t00 + F_s_BWB_t00 + F_l_BWB_t00 ,
F_BWB_t00_t0001 #>= 3 ,
F_BWB_t00_t0001 #=< 3 ,
F_BWB_t00_t0001 #= F_m_BWB_t00_t0001 + F_l_BWB_t00_t0001 +
F_s_BWB_t00_t0001 ,
F_BWB_t00_t0001 #>= 3 ,
F_BWB_t00_t0001 #=< 3 ,
F_BWB #>= 9 ,
F_BWB #=< 11 ,
F_BWB #= F_BWB_t00 ,
F_l_BWB_t00 #>= 3 ,
F_l_BWB_t00 #=< 3 ,
F_l_BWB_t00 #= F_l_BWB_t00_t0001 + F_l_BWB_t00_t0002 ,
Variables = [F_l_BWB_t00_t0002, F_s_BWB_t00_t0002, F_m_BWB_t00_t0002] ,
Variables :: [0..450] ,
labeling(Variables) ,

write( F_l_BWB_t00_t0002 ) , nl ,

write( F_s_BWB_t00_t0002 ) , nl ,

write( F_m_BWB_t00_t0002 ).

------------------------------------------------------------------------
------------------------------------------------------------------------
----------------
Received on Thu Mar 31 10:46:46 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:35 PM GMT GMT