set(arithmetic).  
assign(domain_size,5). 
assign(max_models,-1).

list(distinct).
  [Black, Blue, Green, Red, White]. 
  [Cody, Jason, Riley, Steven, Tyler]. 
  [Book, Chocolate, Mug, Notepad, Tie]. 
  [HR, IT, Marketing, R_and_D, Sales]. 
  [Age_23, Age_28, Age_35, Age_41, Age_50]. 
  [Coffee, Juice, Soft_drink, Tea, Water].
end_of_list. 

formulas(utils). 
  right_neighbor(x,y) <-> x+1 = y.
  left_neighbor(x,y) <-> y+1 = x.
  neighbors(x,y) <-> right_neighbor(x,y) | left_neighbor(x,y).
  between(x,y,z) <-> (x+1=y | x+2=y | x+3=y) & ( y+1=z | y+2=z | y+3=z).
  somewhereLeft(x,y) <-> x+1=y | x+2=y | x+3=y | x+4=y.
end_of_list.

formulas(santa_clues).
  Cody = Age_23.                     %Clue 1
  Book = Riley.                      %Clue 2
  Juice = 4.                         %Clue 3
  neighbors(Riley,Age_41).           %Clue 4
  Age_35 = 0 | Age_35 = 4.           %Clue 5
  between(Mug,Red,Soft_drink).       %Clue 6
  left_neighbor(Notepad,Coffee).     %Clue 7
  right_neighbor(Blue,Tea).          %Clue 8
  neighbors(Green,Age_28).           %Clue 9
  right_neighbor(Cody,Steven).       %Clue 10
  Water = 1.                         %Clue 11
  R_and_D = 2.                       %Clue 12
  Tyler = Mug.                       %Clue 13
  Age_50 = 4.                        %Clue 14
  Soft_drink = 2.                    %Clue 15
  neighbors(Riley,Tie).              %Clue 16
  between(Water,Age_23,Age_50).      %Clue 17
  right_neighbor(Black,Jason).       %Clue 18
  neighbors(Cody,Soft_drink).        %Clue 19
  somewhereLeft(Blue,Sales).         %Clue 20
  IT = Notepad.                      %Clue 21
  Tea = 3.                           %Clue 22
  Chocolate = HR.                    %Clue 23 
  Tie = Green.                       %Clue 24             
end_of_list.
