let mem q i =
  Dom.mem q i.dom &&
  (match i.lo with
     | None -> true
     | Some(alpha, l) -> 
         if alpha then Q.ge q l else Q.gt q l) &&
  (match i.hi with
     | None -> true
     | Some(h, beta) -> 
         if beta then Q.le q h else Q.lt q h)