Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
:-op(760,yfx,#<=>). :-op(750,xfy,#=>). :-op(750,yfx,#<=). % This SWISH instance has preloaded implementation for the % following SICStus clpfd library predicates: % domain/3, count/4, minimum/2, maximum/2, table/2, % #<=> /2, #=> /2, #<= /2 % CUT HERE X = X = X = (Submit to ETS from the next line) :- use_module(library(clpfd)).
:- use_module(library(clpfd)). domain(L, Min, Max) :- L ins Min..Max. :- op(760, yfx, #<=>). :- op(750, xfy, #=>). :- op(750, yfx, #<=). X #<=> Y :- X #<==> Y. X #=> Y :- X #==> Y. X #<= Y :- X #<== Y. count(Val,List,RelOp,Count) :- maplist(to_c(Val), List, Bs), sum(Bs, RelOp, Count). to_c(Val, X, B) :- X #= Val #<==> B. minimum(Min, [V|Vs]) :- foldl(mymin, Vs, V, Min). maximum(Min, [V|Vs]) :- foldl(mymax, Vs, V, Min). mymin(X, Y, Min) :- Min #= min(X, Y). mymax(X, Y, Max) :- Max #= max(X, Y). table(Tuples, Table) :- tuples_in(Tuples, Table).