Cleaning a text field
the (val · ¬cur · pos) | (¬val · ¬cur) = ¬cur (val·pos | ¬val) = ¬cur (pos | ¬val). So, the condition is 

if ( (i != current) &amp;&amp; (!val || [self isCurrentPosition:i]) ) {
        [self replaceObjectAtIndex:i withObject:@""];
    }


You just must practise factoring out the common subexpressions and subprograms and learn how to use the Carnot maps for boolean minimization.