lect.value (sp,v)
  
val vars  = FD.rangeVec   (root, size, (0, max))
val reif  = FD.boolvarVec (root, size)
val nreif = FD.boolvarVec (root, size) (* means "logical-not of reif" *)
val reif2 = Vector.map FD.boolvar2intvar reif
val sum   = FD.intvar (root, #[(0, size*max)])
val kvars = Vector.tabulate
		(size+1, (fn i => if i<size then (1,vars%i) else (~1, sum)))
fun readSolution space = Vector.map (toInt space) vars
fun bound (space, sol) =
    let
      val lsum = Vector.foldl (fn (e,s) => e+s) 0 sol
    