A Theory of Probabilistic Contracts
Anton Hampus, Mattias NybergIn industrial-sized cyber-physical systems, ensuring fulfillment of requirements gets increasingly more costly as the number of components increases. To make the task feasible, compositional verification has been suggested as a scalable solution. Such techniques allow verification by divide-and-conquer, often using assume/guarantee contracts. Although previous research has focused mostly on the non-probabilistic setting, in the real world, probabilities often arise due to random hardware failures, communication delays, sensor ghost objects, machine learning, rounding errors, human behavior, and probabilistic algorithms. Therefore, for contract theories to be practically relevant to cyber-physical systems, there is a need to support probabilistic reasoning, for instance regarding safety and reliability. To this end, we first propose a contract metatheory for general input-output systems, allowing both probabilistic and non-probabilistic instantiations. Then, we instantiate the metatheory with probabilistic behaviors, introducing a new, fully trace-based probabilistic contract theory that supports general probability measures, continuous time, and continuous state spaces. To verify decompositions of such contracts, we also present a deductive system, which is illustrated by an industrially inspired automatic emergency braking example.