A Formal and Run-time Framework for the Adaptation of Local Behaviours to Match a Global Property ‹ Stefano Bistarelli 2 , Fabio Martinelli 1 , Ilaria Matteucci 1 , Francesco Santini 2 1 Istituto di Informatica e Telematica, IIT-CNR, Pisa, Italy [fabio.martinelli,ilaria.matteucci]@iit.cnr.it 2 Dipartimento di Matematica e Informatica, University of Perugia, Italy [bista,francesco.santini]@dmi.unipg.it Abstract. We address the problem of automatically identifying what local properties the agents of a Cyber Physical System have to satisfy to guarantee a global required property φ. To enrich the picture, we con- sider properties where, besides qualitative requirements on the actions to be performed, we assume a weight associated with them: quantita- tive properties are specified through a weighted modal-logic. We propose both a formal machinery based on a Quantitative Partial Model Checking function on contexts, and a run-time machinery that algorithmically tries to check if the local behaviours proposed by the agents satisfy φ. The proposed approach can be seen as a run-time decomposition, privacy- sensitive in the sense agents do not have to disclose their full behaviour. 1 Introduction The term Cyber-Physical Systems(CPS s) refers to a new generation of systems that integrate the dynamics of physical processes with those of the software and communication. Applications of CPSs include medical devices and systems, as- sisted living, traffic control and safety, advanced automotive systems, process control, or distributed robotics [17]. For instance, unmanned vehicles or drones encompass both the physical and cyber worlds at the same time: software, sen- sors, networking, and physical devices. CPSs are resource-constrained and need a high degree of automation, as the two previous examples require in fact [17,7]. The goal of the paper is to describe a formal framework that allows for opportunely finding out the properties that must be locally satisfied by each component of a CPS (or simply agent in the following), to guarantee a global required property φ representing a complex task a CSP has to satisfy. Such a decomposition xφ 1 ,...,φ n y is algorithmically found and tried to be satisfied at run-time: each agent proposes a behaviour with the purpose to satisfy a sub- task (i.e., a sub-formula, or sub-property, φ i ), thus trying to reduce the overall ‹ Research supported by: “VisColla” funded by Fondazione Cassa di Risparmio di Perugia; “BitCoins” co-funded by Banca d’Italia and Cassa di Risparmio di Perugia; the H2020 EU-funded European Network for Cyber Security, NeCS, (GA #675320).