add function for computing list of compact sort variables of a boolean expression