flatten or nodes
generalize to handle and
boolean flatten rewrite: dont re-rewrite