compute the point free version of a frege function