Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:31:28+00:00 2026-05-31T05:31:28+00:00

How do you do a variable summation in the constraint programming language ECLiPSe (

  • 0

How do you do a variable summation in the constraint programming language ECLiPSe (http://www.eclipseclp.org/examples/)?

I’m attempting to get this functionality:

:- lib(ic).         % include the standard interval constraint library
:- lib(branch_and_bound).   % include the branch and bound library for minimization
:- lib(ic_edge_finder).     % include the cumulative constraint library needed for resource constraints

    triangle(sums) :-
        places = [a,b,c,d,e,f,g,h,i],
        places :: 1..9,
        sums = [sum1],
        sums :: 10..30,
        alldifferent(places),
        sum1 #= a + b + c + d,
        sum1 #= b + e + f + g,
        sum1 #= d + g + h + i,
        flatten([places,sums],allVars),
        labeling(allVars).

And the error I’m getting is:

[eclipse 13]: compile('2a.ecl').        
undefined arithmetic expression in _1187 is sum1 in module eclipse
syntax error : in source transformation in triangle(sums) :- places = [a, b, c, d, e, f, g, h, i], places :: 1 .. 9, sums = [sum1], sums :: 10 .. 30, alldifferent(places), sum1 #= a + b + c + d, flatten([places, sums], allVars), labeling(allVars)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:31:29+00:00Added an answer on May 31, 2026 at 5:31 am

    In ECLiPSe, like in Prolog, variable names have to start with a capital letter or underscore:

    Places = [A,B,C,D,E,F,G,H,I],
    

    etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider variable like var url='http://www.example.com/index.php?id=ss'; or var url='http://www.example.com/dir1/dir2/index.php'; In these variables, i want to
$alltext variable contents this code inside: <li>sometext</li><li>sometext</li> <li>sometext</li><li>sometext</li> How do I get each <li>...</li>
Possible Duplicate: C# member variable initialization; best practice? Is there any benefit to this:
This variable is defined in xyz.cpp const int i = 10; The below main()
$image variable gives this code (when echo is used): <img src=/image.png width=100 height=147 alt=
this variable will collect the html which will eventually be placed in the side_bar
Before variable-length arrays were supported, I would dynamically allocate them like this: int foo(size_t
The variable asynchExecutions does get changed, but it doesn't change the reference variable. Simple
My variable $var has the form 'abc.de'. What does this substr exactly do in
Variable resp has following value. System.Xml.Linq.XElement resp - How do I get value of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.