void X( int b[]) { b[0] = !b[0]; } // NOT int main( void) { int b[1] = { 0 }; // constraint: b[i] = 0 or 1 ...
void X( int b[], int k) { b[k] = !b[k]; } // NOT on bit k void CX( int b[], int c, int k) // controlled-NOT on bit k controlled by bit c, c != k { b[k] ^= b[c]; // if( b[c]) b[k] = !b[k]; } int main( void) { int b[2] = { 0, 0 }; ...