PLD: propositional logic instead of deeply nested if