Hi Tommy, On 11/04/2012 10:13, Chen Tommy wrote: > But when I use the instruction "rpc(remote predicate call)" in ECLiPSe > that just return "null". > I am not sure I understand you completely -- I assume you are calling the the eclipse.rpc method in Java, and are you saying that you get null returned as a result? It is difficult to say much about this as you don't seem to show any code of what you are doing. However, I am not sure I understand how an rpc can return null as the result, as this implies that the rpc was called with a variable as the goal, which I would have expected to cause an error to be thrown, rather than returning null... Can you please give more information on what you have done exactly, and also more details on your environment (platform, ECLiPSe version used, etc.). > It's can work in integer number but can't work in real number.Can I ask > why? Thanks for your help. > Again, I am not sure I understand you. Both floats and doubles can be used/returned in a rpc goal -- the rpc method is designed to accept a CompoundTerm representation of the goal you are calling, and the CompoundTerm can have both real (Java Float or Double) and integer subterms. A Goal cannot be just a float or double on its own, as these are not valid goals. However, note that a CompoundTerm cannot represent all ECLiPSe terms, in particular variables are only place holders and unique, i.e. variables cannot be shared in the term (occur more than once), and you cannot pass attribute information back to Java via the variables. In general, you should do the processing in ECLiPSe, and return only ground results back to Java. Cheers, Kish > If I want to solve the answer in real number domain as follow > > > > :- lib(ic), lib(listut). > > testTriangleTriangle(Path, OState, Arg, Result, NState) :- > Path> 0, > % Domains > [Sa] :: -127.5 .. 128.5, > [NSa] :: -127.5 .. 128.5, > [Sb] :: -127.5 .. 128.5, > [NSb] :: -127.5 .. 128.5, > [Sc] :: -127.5 .. 128.5, > [NSc] :: -127.5 .. 128.5, > % Constraints > Arg = [Sa, Sb, Sc], > NState = [NSa, NSb, NSc], > triangleTriangle(Path, OState, Arg, Result, NState), > % Solving > locate([Sa],0.01), > locate([NSa],0.01), > locate([Sb],0.01), > locate([NSb],0.01), > locate([Sc],0.01), > locate([NSc],0.01). > > triangleTriangle(1, [], [Sa, Sb, Sc], [], [NSideA, NSideB, NSideC]) :- > % Precondition > Sa + Sb $> Sc, > Sb + Sc $> Sa, > Sa + Sc $> Sb, > % Postcondition > NSideA $= Sa, > NSideB $= Sb, > NSideC $= Sc, > % Invariant > NSideA + NSideB $> NSideC, > NSideB + NSideC $> NSideA, > NSideA + NSideC $> NSideB. > > > > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > > > > _______________________________________________ > ECLiPSe-CLP-Users mailing list > ECLiPSe-CLP-Users_at_lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users -- This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message. Cisco Systems Limited (Company Number: 02558939), is registered in England and Wales with its registered office at 1 Callaghan Square, Cardiff, South Glamorgan CF10 5BT.Received on Wed Apr 11 2012 - 17:22:45 CEST
This archive was generated by hypermail 2.2.0 : Sat Apr 14 2012 - 06:15:39 CEST