set(arithmetic).
assign(domain_size,11).     %max n(n+1)/2 for grid size n
assign(max_models,-1).

formulas(kakurasu3).
  all x all y (x < 4 & y < 4 ->  
     (f(x,y) < 2) & 
     (f(x,0) + f(x,1)*2 + f(x,2)*3 + f(x,3)*4 = f(x,4)) & 
     (f(0,y) + f(1,y)*2 + f(2,y)*3 + f(3,y)*4 = f(4,y))).

  all x all y (x > 4 | y > 4 -> f(x,y)=0).
  f(4,4)=0.
end_of_list.

formulas(puzzle).
  f(0,4) = 4 & f(1,4) = 6  & f(2,4) = 8 & f(3,4) = 9.
  f(4,0) = 5 & f(4,1) = 6  & f(4,2) = 9 & f(4,3) = 8.
end_of_list.
