Affiliation:
1. Univerisity of California, Berkeley, Berkeley, CA, USA
2. IBM T.J. Watson Research Center, Yorktown Heights, NY, USA
Abstract
Angelic nondeterminism can play an important role in program development. It simplifies specifications, for example in deriving programs with a refinement calculus; it is the formal basis of regular expressions; and Floyd relied on it to concisely express backtracking algorithms such as N-queens.
We show that angelic nondeterminism is also useful during the development of deterministic programs. The semantics of our angelic operator are the same as Floyd's but we use it as a substitute for yet-to-be-written deterministic code; the final program is fully deterministic. The angelic operator divines a value that makes the program meet its specification, if possible. Because the operator is executable, it allows the programmer to test incomplete programs: if a program has no safe execution, it is already incorrect; if a program does have a safe execution, the execution may reveal an implementation strategy to the programmer.
We introduce refinement-based angelic programming, describe our embedding of angelic operators into Scala, report on our implementation with bounded model checking, and describe our experience with two case studies. In one of the studies, we use angelic operators to modularize the Deutsch-Schorr-Waite (DSW) algorithm. The modularization is performed with the notion of a parasitic stack, whose incomplete specification was instantiated for DSW with angelic nondeterminism.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Programming not only by example;Proceedings of the 40th International Conference on Software Engineering;2018-05-27
2. EdSketch: execution-driven sketching for Java;Proceedings of the 24th ACM SIGSOFT International SPIN Symposium on Model Checking of Software;2017-07-13
3. Angelic Verification: Precise Verification Modulo Unknowns;Computer Aided Verification;2015
4. Beyond 2-Safety: Asymmetric Product Programs for Relational Program Verification;Logical Foundations of Computer Science;2013
5. A Machine-Checked Framework for Relational Separation Logic;Software Engineering and Formal Methods;2011