Formal Logical Methods for System Security and Correctness