Defensive coding for Logic