Re: [eclipse-clp-users] simple questions on the "sendmore.ecl" example

From: Kish Shen <kisshen_at_...5...>
Date: Sun, 31 Jul 2011 02:15:36 +0100
Hi Kostas,

On 30/07/2011 17:09, Kostas Oikonomou wrote:
> I have a very elementary question: how do I run a query from
> the Emacs Eclipse mode?

If you want to run a query from the emacs eclipse mode, you need to have 
an ECLiPSe-process running in another emacs window first. To do this, 
select ECLiPSe-Process->Run ECLiPSe

This will create a new window in your emacs and run ECLiPSe with the 
command eclipse. You will have to set the Eclipse Path variable if 
'eclipse' is not sufficient to run ECLiPSe in a shell.

You can set the variable by ECLiPSe-Edit->Preferences->Customize. You 
probably need to restart emacs (after saving the Eclipse path variable 
for a new session) to get it to work.

> Eclipse-Process ->  Compile buffer in Emacs.  Then the only
> way I can think of for running the query
>
> labeling(Digits).
>

Running labeling(Digits) as a query will return a type error, as you 
found out -- this has nothing to do with TkECLiPSe, but is because 
labeling/1 is a predicate provided by lib(ic) (which you loaded when you 
compiled the sendmore.ecl example), and  labeling expects a collection 
of integer ic variables or integers.

Trying to run labeling(Digits) as a query suggest to me that you are not 
very familiar with running Prolog. If this is the case, then maybe you 
need to read some introductory text to Prolog first. The tutorial has a 
chapter on Prolog (Prolog Introduction), but it is rather dense and may 
be difficult if you have never used Prolog before.

For the sendmore.ecl example, the query to run is sendmore(Digits) -- if 
you look at the code for the example, you will see that the first thing 
sendmore/1 do is instantiate Digits to a list of variables, and then 
model the problem before calling labeling/1 to perform the (constrained) 
search.

Cheers,

Kish


-- 
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 Sun Jul 31 2011 - 01:15:45 CEST

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