Ion-beam mixing with chemical guidance .1. The bilayer problem