triska / clpb Goto Github PK
View Code? Open in Web Editor NEWBoolean Constraint Solving in Prolog
Home Page: https://www.metalevel.at/clpb/
Boolean Constraint Solving in Prolog
Home Page: https://www.metalevel.at/clpb/
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.