Coder Social home page Coder Social logo

triska / clpb Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 5.0 297 KB

Boolean Constraint Solving in Prolog

Home Page: https://www.metalevel.at/clpb/

Prolog 100.00%
bdd clp constraint-programming constraints independent-sets matchsticks-puzzle prolog sat satisfiability

clpb's People

Contributors

triska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

clpb's Issues

Problem with weighted_maximum and */1

Given the following:

works(A, B) :-
    sat(*([+[A, B], B])),
    labeling([A, B]).

doesnt(A, B) :-
    sat(*([+[A, B], B])),
    weighted_maximum([-1,-1], [A, B], _).

works2(A, B) :-
    sat(A + B * B),
    weighted_maximum([-1,-1], [A, B], _).

running doesnt throws the following error:

[debug]  ?- doesnt(A, B).
ERROR: Uninstantiated argument expected, found 1
ERROR: In:
ERROR:   [19] throw(error(uninstantiation_error(1),_11940))
ERROR:   [18] error:uninstantiation_error(1) at /usr/lib/swi-prolog/library/error.pl:161
ERROR:   [17] error:is_not(var,1) at /usr/lib/swi-prolog/library/error.pl:282
ERROR:   [16] error:element_is_not([1],var) at /usr/lib/swi-prolog/library/error.pl:324
ERROR:   [15] error:element_is_not([_12080,1],var) at /usr/lib/swi-prolog/library/error.pl:321
ERROR:   [14] error:not_a_list(list(var),[_12128,1]) at /usr/lib/swi-prolog/library/error.pl:304
ERROR:   [13] error:is_not(list(var),[_12176,1]) at /usr/lib/swi-prolog/library/error.pl:270
ERROR:   [12] error:must_be(list(var),[_12224,1]) at /usr/lib/swi-prolog/library/error.pl:248
ERROR:   [11] clpb:weighted_maximum([-1,-1],[_12282,1],_12266) at /usr/lib/swi-prolog/library/clp/clpb.pl:1442
ERROR:   [10] doesnt(_12314,1) at ...
ERROR:    [9] <user>
   Exception: (12) error:must_be(list(var), [_9118{...}, 1]) ? creep
   Exception: (11) clpb:weighted_maximum([-1, -1], [_9118{...}, 1], _12538) ? creep
   Exception: (10) doesnt(_8658, _8660) ? creep

while works and works2 both work, which seems odd to me, but perhaps I'm misunderstanding something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.