Abstract

Though many safety-critical software systems use floating point to represent real-world input and output, the mathematical specifications of these systems' behaviors use real numbers. Significant deviations from those specifications can cause errors and jeopardize safety. To ensure system safety, some programming systems offer exact real arithmetic, which often enables a program's computation to match its mathematical specification exactly. However, exact real arithmetic complicates decision-making: in these systems, it is impossible to compute (total and deterministic) discrete decisions based on connected spaces such as R. We present programming-language semantics based on constructive topology with variants allowing nondeterminism and/or partiality. Either nondeterminism or partiality suffices to allow computable decision making on connected spaces such as R. We then introduce pattern matching on spaces, a language construct for creating programs on spaces, generalizing pattern matching in functional programming, where patterns need not represent decidable predicates and also may overlap or be inexhaustive, giving rise to nondeterminism or partiality, respectively. Nondeterminism and/or partiality also yield formal logics for constructing approximate decision procedures. We extended the Marshall language for exact real arithmetic with these constructs and implemented some programs with it.

Highlights

  • Ensuring the safety of software that mixes discrete and continuous computation—such as cyber-physical systems, numerical computations, and machine learning—can be challenging

  • Constructive topology, in the form of locale theory, provides a single programming language in which it is possible to build and execute programs that compute with continuous values and to reason about these programs in terms of their mathematical descriptions

  • Our results show how constructive topology can serve as the foundation for programming systems that support mixing discrete and continuous computation

Read more

Summary

Introduction

Ensuring the safety of software that mixes discrete and continuous computation—such as cyber-physical systems, numerical computations, and machine learning—can be challenging. Programming systems that implement exact real arithmetic [Bauer 2008; O’Connor 2008; Taylor 2010] do guarantee accuracy and have been used to develop verified cyber-physical systems [Anand and Knepper 2015] While these programming systems ease development of traditionally continuous computations on the reals, there has been little investigation of how to soundly incorporate decision-making: computations from the reals (R) to the Booleans (B). Constructive topology, in the form of locale theory, provides a single programming language in which it is possible to build and execute programs that compute with continuous values and to reason about these programs in terms of their mathematical descriptions. In this programming language (category) FSpc, types (objects) are spaces and programs (morphisms) are continuous maps. Constructive topology has surprisingly strong computational abilities [Escardó 2007; Simpson 1998; Taylor 2010], such as the ability to compute the maximum that a real-valued function attains over a compact-overt space (see Definition 5.4)

Contributions
Constructive topology
Decision making with partiality and nondeterminism
Partiality
Nondeterminism
Monads and summary
Pattern matching
Pattern families
Open maps
Open embeddings
Pattern families: definition and properties
Syntax of pattern matching
Formal logics for approximate decision procedures
Quantification over compact-overt spaces
On compact-overt spaces
On compact-overt subspaces
Implementation in Marshall
Case studies
13 The cases cover so long as w
Related work
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call