Contract-based hierarchical resilience framework for cyber-physical systems | Synapse