Added tracking for constants in each subformula.