Re: [eclipse-clp-users] Question regarding the redefined variable

From: Kish Shen <kisshen_at_...5...>
Date: Mon, 15 Dec 2014 08:23:29 +0000
Hi Rogesh,

 From your question, it seems you do not know Prolog -- ECLiPSe is an 
implementation of Prolog, with additional libraries and features. You 
really need to know Prolog in order to program in ECLiPSe, and most of 
the documentation that comes with ECLiPSe requires some basic knowledge 
of Prolog. The tutorial does give a very quick introduction to Prolog, 
but it is probably still too brief to learn Prolog properly.

If you don't know Prolog, you probably need to get some textbook or 
tutorial on Prolog or ECLiPSe, and

http://www.eclipseclp.org/reports/index.html

has pointers to various materials that may help.

I am having problems understanding the intention of your code fragments, 
but I suspect they almost certainly are not what you intended, e.g.

A=3;
B=5;

the semi-colon (;) is not a statement separator in Prolog, it is a 
disjunction.

 >A=B+3

is unifying A with the structure B+3, not the result of the expression B+3.

Cheers,

Kish

On 15/12/2014 01:52, Choughule, Yogesh wrote:
> Dear Users
>
> My question is regarding the redefined variable.
>
> Consider following code slice
>
> A=3;
> B=5;
> --
> --other constraints
> --
> A=B+3;   //A is redefined
>
> While giving the above constraints to ECLiPSe to solve A and B,
> error occurs because A is defined twice.
>
> 1) Should we rename A as A1 and use?
> 2) Is there any other way we can handle this situation?
>
>
> Thanks and Regards
>
> Yogesh C.
>
> ______________________________________________________________________
> Disclaimer: This email and any attachments are sent in strictest confidence
> for the sole use of the addressee and may contain legally privileged,
> confidential, and proprietary data. If you are not the intended recipient,
> please advise the sender by replying promptly to this email and then delete
> and destroy this email and any attachments without any further use, copying
> or forwarding.
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>
Received on Mon Dec 15 2014 - 08:23:39 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST