Formal Methods: Foundations and Applications