Solvability Regularity and Optimal Control of Boundary Value Problems for PDEs