Calculates value of formula in modal algebra