round(29..34). p(29..68). %% maximally 68P can be reached by the current leader team(d). team(n). team(ki). team(r). team(in). team(bo). team(bi). team(au). team(svs). team(du). team(un). team(bs). team(dd). team(sp). team(ft). team(hdh). team(da). team(kl). % standings after 29 rounds: points(29,d,53). points(29,n,50). points(29,ki,46). points(29,r,41). points(29,in,41). points(29,bo,40). points(29,bi,40). points(29,au,39). points(29,svs,38). points(29,du,38). points(29,un,37). points(29,bs,37). points(29,dd,37). points(29,sp,37). points(29,ft,37). points(29,hdh,34). points(29,da,32). points(29,kl,29). % games of the remaining rounds: game(30,in,n). game(30,hdh,d). game(30,dd,ki). game(30,du,svs). game(30,ft,r). game(30,sp,un). game(30,bi,au). game(30,da,bs). game(30,bo,kl). game(31,ki,n). game(31,d,in). game(31,au,du). game(31,r,sp). game(31,svs,da). game(31,un,hdh). game(31,bs,bi). game(31,kl,dd). game(31,ft,bo). game(32,n,bs). game(32,dd,d). game(32,in,ki). game(32,du,r). game(32,hdh,svs). game(32,da,un). game(32,bi,kl). game(32,sp,ft). game(32,bo,au). game(33,svs,n). game(33,d,ki). game(33,ft,du). game(33,r,da). game(33,un,bo). game(33,sp,bi). game(33,bs,in). game(33,kl,hdh). game(33,au,dd). game(34,n,d). game(34,ki,bs). game(34,du,sp). game(34,bo,r). game(34,dd,un). game(34,bi,svs). game(34,in,kl). game(34,hdh,ft). game(34,da,au). 1{ win(R,X,Y), draw(R,X,Y), win(R,Y,X) }1 :- game(R,X,Y). points(RR,X,M) :- win(RR,X,Y), points(R,X,N), RR = R+1, M = N+3, round(R), team(X), team(Y), p(N). points(RR,Y,N) :- win(RR,X,Y), points(R,Y,N), RR = R+1, round(R), team(X), team(Y), p(N). points(RR,X,M) :- draw(RR,X,Y), points(R,X,N), RR = R+1, M = N+1, round(R), team(X), team(Y), p(N). points(RR,Y,M) :- draw(RR,X,Y), points(R,Y,N), RR = R+1, M = N+1, round(R), team(X), team(Y), p(N). %%%% Alternative, less code, but slower % 1{ result(R,X,Y,3,0), result(R,X,Y,1,1), result(R,X,Y,0,3) }1 :- game(R,X,Y). % points(RR,X,PX2) :- result(RR,X,Y,DX,DY), points(R,X,PX), % RR = R+1, PX2 = PX+DX, round(R), team(X), team(Y), p(PX), p(PY), e(DX,DY). % points(RR,Y,PY2) :- result(RR,X,Y,DX,DY), points(R,Y,PY), % RR = R+1, PY2 = PY+DY, round(R), team(X), team(Y), p(PX), p(PY), e(DX,DY). % points(34,n,59). % points(34,ki,57). % points(34,d,56). points(34,X,44) :- team(X), X != n, X != ki, X != d. :- points(34,X,N1), points(34,X,N2), team(X), p(N1), p(N2), N1 != N2. % kill models where N and D have more points than KI (113247 remain) % :- points(34,n,PN), points(34,ki,PK), points(34,d,PD), PN > PK, PD > PK, p(PN), p(PD), p(PK). % Can N still end up on 3rd place then? % kill models where KI and N do not have more points than D: (80926 remain) % :- points(34,n,PN), points(34,ki,PK), PN > PK, p(PN), p(PK). % :- points(34,n,PN), points(34,d,PD), PN > PD, p(PN), p(PD). % kill models there N, D, and KI do not have the same number of points (1877 models remain) %:- points(34,n,P1), points(34,d,P2), P1 != P2, p(P1), p(P2). %:- points(34,n,P1), points(34,ki,P2), P1 != P2, p(P1), p(P2). %:- points(34,d,P1), points(34,ki,P2), P1 != P2, p(P1), p(P2). % points(34,ki,58). %% all have 58P: 295, 57P: 756, 56P: 585, 55P: 241