infrastructure for refined type system