Skip to content

Instantly share code, notes, and snippets.

@lorenzleutgeb
Created January 27, 2018 15:28
Show Gist options
  • Save lorenzleutgeb/df483402bb5840896039092c3de9fa18 to your computer and use it in GitHub Desktop.
Save lorenzleutgeb/df483402bb5840896039092c3de9fa18 to your computer and use it in GitHub Desktop.
Conference Planning
% pc(M) M is a member of the Program Committee.
% paper(P) P is a submitted paper.
% assigned(P,M) M is assigned to review paper P.
% bid(M,P,B) M has rated the paper P with B.
% The following four auxiliary predicates are just handy shorthands:
cannot(P,M) :- bid(M,P,0).
wantnot(P,M) :- bid(M,P,1).
% 1. each PC-member is assigned with at most five submissions
:- pc(M), assigned(P1,M), assigned(P2,M), assigned(P3,M),
assigned(P4,M), assigned(P5,M), assigned(P6,M),
P1 != P2, P1 != P3, P1 != P4, P1 != P5, P1 != P6,
P2 != P3, P2 != P4, P2 != P5, P2 != P6,
P3 != P4, P3 != P5, P3 != P6,
P4 != P5, P4 != P6,
P5 != P6.
% 2. no PC-member is assigned more than three papers that he or she rated
% with "I don’t want to review this paper"
:- pc(M), assigned(P1,M), assigned(P2,M), assigned(P3,M), assigned(P4,M),
wantnot(M,P1), wantnot(M, P2), wantnot(M, P3), wantnot(M, P4),
P1 != P2, P1 != P3, P1 != P4,
P2 != P3, P2 != P4,
P3 != P4.
% 3. no PC-member can rate a submission with different bids
:- pc(M), paper(P), bid(M,P,B1), bid(M,P,B2), B1 != B2.
% 4. no PC-member is assigned a paper that he or she rated with
% "I cannot review this paper"
:- pc(M), assigned(P,M), cannot(P,M).
% 5. each submission is assigned to at least one PC-member who rated
% the paper with "I am willing to review this paper" or higher
haswilling(P) :- pc(M), paper(P), bid(M,P,B), B > 1, assigned(P,M).
:- paper(P), not haswilling(P).
% 6. if a PC-member does not bid on a certain paper, by default
% "I don't want to review this paper" is assumed as the PC-member's
% bid on this paper
hasbid(M,P) :- pc(M), paper(P), bid(M,P,_).
bid(M,P,0) :- pc(M), paper(P), not hasbid(M,P).
% Each submission is assigned to exactly three members to the PC.
{ assigned(P,M) : pc(M) } = 3 :- paper(P).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment