Adjoint Logic with Applications