calculate path condition