Theoretical Foundations of Quantum Programming Algorithm Design and Quantum Logic