take constant boolean expressions into account for definite return
analysis for #678 and #677