Formalization of Lightweight Java with Gradual Security