PROLOG with constraints, library fd and Eclipse

This is a discussion on PROLOG with constraints, library fd and Eclipse within the Tech Board forums, part of the Community Boards category; I want to find the max element of a list with expressions, which are formed like this: Code: [3 * ...

  1. #1
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Glyfada,Athens
    Posts
    2,650

    PROLOG with constraints, library fd and Eclipse

    I want to find the max element of a list with expressions, which are formed like this:
    Code:
    [3 * (1 - _636{[0, 1]}),...]
    As you can see the variable _636 is constrained, with the domain to be [0,1], which holds true for the other variables too.

    I have tried a lot of thing, like the max predicate of the kernel, maxlist of fd_global, I am inserting and removing eval from places to places again and again, but no result. Error always occur and if it is not, is when I use maxlist and it fails. Any ideas?

    If I set the max element, manually, then everything works, so I suppose the problem is there (in finding the max element).

    Predicates link.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Glyfada,Athens
    Posts
    2,650
    Solved! I had to make another list, that would hold all the expressions and use the #=.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to link a library in eclipse c/c++ ide?
    By ayanbizz in forum C++ Programming
    Replies: 2
    Last Post: 11-01-2011, 06:15 AM
  2. SDL library on eclipse (windows)
    By chiefblink117 in forum C Programming
    Replies: 1
    Last Post: 09-26-2011, 09:41 PM
  3. Prolog
    By ssharish2005 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-16-2008, 09:54 AM
  4. Replies: 0
    Last Post: 03-03-2003, 12:39 PM
  5. more prolog
    By bob20 in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 12-10-2002, 09:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21