Re: [eclipse-clp-users] Tentative variables

From: Joachim Schimpf <jschimpf_at_coninfer.com>
Date: Mon, 14 Dec 2015 13:26:51 +0000
On 14/12/15 07:50, Edgaonkar, Shrirang wrote:
> Dear clp users,
>
>    Following is a sample of tentative variables.
>
> :- lib(ic).
> :- lib(tentative).
> solveNULLTest(Var):-
>   Var #:: 1..10,
>   tent_set(Var, 3).
>
> Output is:-
>
> ?- solveNULLTest(Var).
> Var = Var{tentative : (3 -> 0), ic : 1 .. 10}
> Yes (0.00s cpu)
>
> I use a java interface to solve the goals in eclipse and need information about
> the tentative values of variables in java. Is there a way to do that in?
>
> Currently java will give the following output:-
>
> com.parctechnologies.eclipse.CompoundTermImpl with [functor=solveNULLTest
> arity=1 arg(1)=null]
>
> But I would need the tentative values of the tentative variable(3 in this case)
> in the java output.


Java has no support for accessing variable attributes.
Just extract the tentative values in ECLiPSe, and return them to Java directly:

solveNULLTest(Tent):-
  Var #:: 1..10,
  tent_set(Var, 3),
  tent_get(Var, Tent).


-- Joachim
Received on Mon Dec 14 2015 - 13:27:03 CET

This archive was generated by hypermail 2.2.0 : Thu Dec 31 2015 - 03:13:25 CET