Using Formal Methods To Build And Validate Reliable And Secure Smart Systems Via Tla+