Architectural Invariants and Correctness of IoT-based Systems