A Formalism for Visual Query Interface Design