%%% Better world problem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% There are M (max_people) people X in {1,2,...,M} %%% Each of them at the beginning owns 2X Euros %%% The goal is to obtain an equilibrium situation %%% where the main difference between richness is 1 %%% Person X can donate to another person exactly %%% X euros per action. %%% No one can remain without money (at any state) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Invented and coded by DFP, 2007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% With this instance try :-bmap(2). (or 3 or 4) %%% time left_ffc: 0.047s, leftmost 0.047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% max_people(5). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% agent(X) :- max_people(N), interval(X,1,N). %%%%%%%%%%%%%%%%%%%%% fluent(owns(B),1,M):- agent(B), max_people(N),M is N*(N+1). %%%%%%%%%%%%%%%% action([X],gives(Y)):- agent(X),agent(Y),neq(X,Y). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% executable([X],gives(Y),[owns(X) gt X ]) :- action([X],gives(Y)). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% causes(owns(X) eq owns(X)^(-1) - X, [actocc([X],gives(Y))]):- action([X],gives(Y)). causes(owns(Y) eq owns(Y)^(-1) + X, [actocc([X],gives(Y))]) :- action([X],gives(Y)). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% initially(owns(X) eq 2*X) :- agent(X). %%%%%%%%%%%%%%% goal(owns(X) leq owns(Y) + 1) :- agent(X), agent(Y), neq(X,Y). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%