Synthesis of Divide and Conquer Parallelism for Loops ∗

Total Page:16

File Type:pdf, Size:1020Kb

Synthesis of Divide and Conquer Parallelism for Loops ∗ Synthesis of Divide and Conquer Parallelism for Loops ∗ Azadeh Farzan and Victor Nicolet † University of Toronto, Canada Abstract 1. Introduction Divide-and-conquer is a common parallel programming Despite big advances in optimizing and parallelizing compil- skeleton supported by many cross-platform multithreaded ers, correct and efficient parallel code is often hand-crafted libraries, and most commonly used by programmers for par- in a difficult and error-prone process. The introduction of allelization. The challenges of producing (manually or au- libraries like Intel’s TBB [39] was motivated by this diffi- tomatically) a correct divide-and-conquer parallel program culty and with the aim of making the task of writing well- from a given sequential code are two-fold: (1) assuming that performing parallel programs easier for an average program- a good solution exists where individual worker threads exe- mer. These libraries offer efficient implementations for com- cute a code identical to the sequential one, the programmer monly used parallel skeletons, which makes it easier for the has to provide the extra code for dividing the tasks and com- programmer to write code in the style of a given skeleton bining the partial results (i.e. joins), and (2) the sequential without having to make special considerations for important code may not be suitable for divide-and-conquer paralleliza- performance factors like scalability of memory allocation or tion as is, and may need to be modified to become a part of task scheduling. Divide-and-conquer parallelism is the most a good solution. We address both challenges in this paper. commonly used of these skeletons. We present an automated synthesis technique to synthesize Consider the function sum = 0; correct joins and an algorithm for modifying the sequential sum that returns the sum for (i = 0; i < |s|; i++) { code to make it suitable for parallelization when modifica- of the elements of an ar- sum = sum + s[i]; } tions are necessary. We focus on a class of loops that tra- ray of integers. The code verse a read-only collection and compute a scalar function on the right is a sequential loop that computes this function. over that collection. We present theoretical results for when To compute the sum, in the style of divide and conquer par- the necessary modifications to sequential code are possi- allelism, the computation should be structured as illustrated ble, theoretical guarantees for the algorithmic solutions pre- in Figure 1. The array s of length ¶s¶ is partitioned into n+1 sented here, and experimental evaluation of the approach’s success in practice and the quality of the produced parallel sum(s[0..k1]) sum(s[k1 +1..k2]) sum(s[kn 1 +1..kn]) sum(s[kn +1.. s 1]) ··· − | | − programs. CCS Concepts • Computing methodologies → Paral- ··· lel programming languages;• Theory of computation → sum(s[0..k2]) sum(s[kn 1 +1.. s 1]) ··· ··· − | | − Program verification; Parallel computing models ··· Keywords Divide and Conquer Parallelism, Program Syn- sum(s) thesis, Homomorphisms Figure 1. Divide and conquer style computation of sum. ∗ An extended version of this paper including proofs of theorems can be chunks, and sum is individually computed for each chunk. found at www.cs.toronto.edu/~azadeh/papers/pldi17-ex.pdf † joined Funded by Ontario Ministry of Research’s Early Researcher Award and The results of these partial sum computations are NSERC Discovery Accelerated Supplement Award (operator j) into results for the combined chunks at each in- termediate step, with the join at the root of the tree returning the result of sum for the entire array. The burden of a correct design is to come up with the correct implementation of the Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and join operator. In this example, it is easy to quickly observe the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s). that the join has to simply return the sum of the two partial PLDI’17 June 18–23, 2017, Barcelona, Spain results. In general, it could be tricky to reformulate an arbi- © 2017 Copyright held by the owner/author(s). ACM ISBN 978-1-nnnn-nnnn-n/17/06. $15.00 trary sequential computation in this style. Recent advances DOI: http://dx.doi.org/10.1145/3062341.3062355 in program synthesis [2] demonstrate the power of synthesis in producing non-trivial computations. A natural question to foundations to answer these questions, and in Section 6, we ask is whether this power can be leveraged for this problem. present an algorithm for producing this lifting automatically In this paper, we focus on a class of divide-and-conquer that satisfies all aforementioned criteria. In summary, the pa- parallel programs that operate on sequences (lists, arrays, or per makes the following contributions: in general any collection type with a linear traversal itera- • We present an algorithm to synthesize a join for divide- tor) in which the divide operator is assumed to be the default and-conquer parallelism when one exists. Moreover, sequence concatenation operator (i.e. divide s into s1 and these joins are accompanied by automatically generated s2 where s = s1 a s2). In Section 4, we discuss how we use machine-checked proofs of correctness (Sections 4, 7). syntax-guided synthesis (SyGuS) [2] efficiently to synthesize • We present an algorithm for automatic lifting of non- the join operators. Moreover, in Section 7, we discuss how parallelizable loops (where a join does not exist) to trans- the proofs of correctness for synthesized join operations can form them into parallelizable ones (Section 6). be automatically generated and checked. This addresses a • We lay the theoretical foundations for when a loop is ef- challenge that many SyGuS schemes seem to bypass, in that, ficiently parallelized (divide-and-conquer-style), and ex- they only guarantee the synthesized artifact be correct for the plore when an efficient lift exists and when it can be au- set of examples used in the synthesis process (or boundedly tomatically discovered (Sections 5, 6). many input instances), and do not provide a proof of correct- • We built a tool, PARSYNT, and present experimental ness for the entire (infinite) data domain of program inputs. results that demonstrate the efficacy of the approach and A general divide-and-conquer parallel solution is not al- the efficiency of the produced parallel code (Section 8). ways as simple as the diagram in Figure 1. Consider the function is-sorted(s) which returns true if an array is sorted, 2. Overview and false otherwise. Providing the partial computation re- sults, a boolean value in this case, from both sides (of a join) We start by presenting an overview of our contributions by will not suffice. If both sub-arrays are sorted, the join cannot way of two examples that demonstrate the challenges of con- make a decision about the sortedness of the concatenated ar- verting a sequential computation to divide-and-conquer par- ray. In other words, a join cannot be defined solely in terms allelism and help us illustrate our solution. We use sequences of the sortedness of the subarrays. as linear collections that abstract any collection data type To a human programmer, it is clear that the join re- with a linear traversal iterator. quires the last element of the first subarray and the first Second Smallest. Con- element of the second subarray to connect the dots. The m = MAX_INT; sider the loop implemen- extra information in this case is as simple as remember- m2 = MAX_INT; tation of the function for (i = 0; i < |s|; i++) { ing two extra values. But, as we demonstrate with an- m2 = min(m2, max(m,s[i])); min2 on the right, that re- other example in Section 2, the extra information required m=min(m, s[i]); turns the second smallest } for the join may need to be computed by worker threads element of a sequence. Figure 2. Second Smallest to be available to the join. Intuitively, this means that Functions min and max worker threads have to be are used for brevity and can be replaced by their standard modified (compared to the O A definitions min(a; b) = a $ b ? a ∶ b and max(a; b) = a % sequential code) to compute parallelizable ⇥ loop projection b ? a ∶ b. Here, m and m2 keep track of the smallest and the this extra information in or- I O second smallest elements of the sequence respectively. der to guarantee the exis- sequential loop tence of a join operator. We For a novice, in devising a join for m = min(ml; mr) 1 a divide and conquer paralleliza- call this modification of the code, lifting , for short, after m2 = min(m2l; m2r) the identical standard mathematical concept as illustrated in tion of this example, it is easy to the diagram above, where A stands for the extra (auxiliary) make the mistake of using the incorrect updates illustrated 2 information that needs to be computed by the loop. on the right . The necessity of lifting in some cases raises two ques- The correct join operator computes the combined small- tions: (1) does such a lifting always exist? And, (2) can est and second smallest of two subsequences according the the overhead from lifting and the accompanying join over- following two equations, where the l and r subscripts distin- shadow the performance gains from parallelization? In Sec- guish the values coming from the left and the right subse- tion 5, we address both questions.
Recommended publications
  • Well-Founded Functions and Extreme Predicates in Dafny: a Tutorial
    EPiC Series in Computing Volume 40, 2016, Pages 52–66 IWIL-2015. 11th International Work- shop on the Implementation of Logics Well-founded Functions and Extreme Predicates in Dafny: A Tutorial K. Rustan M. Leino Microsoft Research [email protected] Abstract A recursive function is well defined if its every recursive call corresponds a decrease in some well-founded order. Such well-founded functions are useful for example in computer programs when computing a value from some input. A boolean function can also be defined as an extreme solution to a recurrence relation, that is, as a least or greatest fixpoint of some functor. Such extreme predicates are useful for example in logic when encoding a set of inductive or coinductive inference rules. The verification-aware programming language Dafny supports both well-founded functions and extreme predicates. This tutorial describes the difference in general terms, and then describes novel syntactic support in Dafny for defining and proving lemmas with extreme predicates. Various examples and considerations are given. Although Dafny’s verifier has at its core a first-order SMT solver, Dafny’s logical encoding makes it possible to reason about fixpoints in an automated way. 0. Introduction Recursive functions are a core part of computer science and mathematics. Roughly speaking, when the definition of such a function spells out a terminating computation from given arguments, we may refer to it as a well-founded function. For example, the common factorial and Fibonacci functions are well-founded functions. There are also other ways to define functions. An important case regards the definition of a boolean function as an extreme solution (that is, a least or greatest solution) to some equation.
    [Show full text]
  • Programming Language Features for Refinement
    Programming Language Features for Refinement Jason Koenig K. Rustan M. Leino Stanford University Microsoft Research [email protected] [email protected] Algorithmic and data refinement are well studied topics that provide a mathematically rigorous ap- proach to gradually introducing details in the implementation of software. Program refinements are performed in the context of some programming language, but mainstream languages lack features for recording the sequence of refinement steps in the program text. To experiment with the combination of refinement, automated verification, and language design, refinement features have been added to the verification-aware programming language Dafny. This paper describes those features and reflects on some initial usage thereof. 0. Introduction Two major problems faced by software engineers are the development of software and the maintenance of software. In addition to fixing bugs, maintenance involves adapting the software to new or previously underappreciated scenarios, for example, using new APIs, supporting new hardware, or improving the performance. Software version control systems track the history of software changes, but older versions typically do not play any significant role in understanding or evolving the software further. For exam- ple, when a simple but inefficient data structure is replaced by a more efficient one, the program edits are destructive. Consequently, understanding the new code may be significantly more difficult than un- derstanding the initial version, because the source code will only show how the more complicated data structure is used. The initial development of the software may proceed in a similar way, whereby a software engi- neer first implements the basic functionality and then extends it with additional functionality or more advanced behaviors.
    [Show full text]
  • Developing Verified Sequential Programs with Event-B
    UNIVERSITY OF SOUTHAMPTON Developing Verified Sequential Programs with Event-B by Mohammadsadegh Dalvandi A thesis submitted in partial fulfillment for the degree of Doctor of Philosophy in the Faculty of Physical Sciences and Engineering Electronics and Computer Science April 2018 UNIVERSITY OF SOUTHAMPTON ABSTRACT FACULTY OF PHYSICAL SCIENCES AND ENGINEERING ELECTRONICS AND COMPUTER SCIENCE Doctor of Philosophy by Mohammadsadegh Dalvandi The constructive approach to software correctness aims at formal modelling of the in- tended behaviour and structure of a system in different levels of abstraction and verifying properties of models. The target of analytical approach is to verify properties of the final program code. A high level look at these two approaches suggests that the con- structive and analytical approaches should complement each other well. The aim of this thesis is to build a link between Event-B (constructive approach) and Dafny (analytical approach) for developing sequential verified programs. The first contribution of this the- sis is a tool supported method for transforming Event-B models to simple Dafny code contracts (in the form of method pre- and post-conditions). Transformation of Event-B formal models to Dafny method declarations and code contracts is enabled by a set of transformation rules. Using this set of transformation rules, one can generate code contracts from Event-B models but not implementations. The generated code contracts must be seen as an interface that can be implemented. If there is an implementation that satisfies the generated contracts then it is considered to be a correct implementation of the abstract Event-B model. A tool for automatic transformation of Event-B models to simple Dafny code contracts is presented.
    [Show full text]
  • Master's Thesis
    FACULTY OF SCIENCE AND TECHNOLOGY MASTER'S THESIS Study programme/specialisation: Computer Science Spring / Autumn semester, 20......19 Open/Confidential Author: ………………………………………… Nicolas Fløysvik (signature of author) Programme coordinator: Hein Meling Supervisor(s): Hein Meling Title of master's thesis: Using domain restricted types to improve code correctness Credits: 30 Keywords: Domain restrictions, Formal specifications, Number of pages: …………………75 symbolic execution, Rolsyn analyzer, + supplemental material/other: …………0 Stavanger,……………………….15/06/2019 date/year Title page for Master's Thesis Faculty of Science and Technology Domain Restricted Types for Improved Code Correctness Nicolas Fløysvik University of Stavanger Supervised by: Professor Hein Meling University of Stavanger June 2019 Abstract ReDi is a new static analysis tool for improving code correctness. It targets the C# language and is a .NET Roslyn live analyzer providing live analysis feedback to the developers using it. ReDi uses principles from formal specification and symbolic execution to implement methods for performing domain restriction on variables, parameters, and return values. A domain restriction is an invariant implemented as a check function, that can be applied to variables utilizing an annotation referring to the check method. ReDi can also help to prevent runtime exceptions caused by null pointers. ReDi can prevent null exceptions by integrating nullability into the domain of the variables, making it feasible for ReDi to statically keep track of null, and de- tecting variables that may be null when used. ReDi shows promising results with finding inconsistencies and faults in some programming projects, the open source CoreWiki project by Jeff Fritz and several web service API projects for services offered by Innovation Norway.
    [Show full text]
  • Essays on Emotional Well-Being, Health Insurance Disparities and Health Insurance Markets
    University of New Mexico UNM Digital Repository Economics ETDs Electronic Theses and Dissertations Summer 7-15-2020 Essays on Emotional Well-being, Health Insurance Disparities and Health Insurance Markets Disha Shende Follow this and additional works at: https://digitalrepository.unm.edu/econ_etds Part of the Behavioral Economics Commons, Health Economics Commons, and the Public Economics Commons Recommended Citation Shende, Disha. "Essays on Emotional Well-being, Health Insurance Disparities and Health Insurance Markets." (2020). https://digitalrepository.unm.edu/econ_etds/115 This Dissertation is brought to you for free and open access by the Electronic Theses and Dissertations at UNM Digital Repository. It has been accepted for inclusion in Economics ETDs by an authorized administrator of UNM Digital Repository. For more information, please contact [email protected], [email protected], [email protected]. Disha Shende Candidate Economics Department This dissertation is approved, and it is acceptable in quality and form for publication: Approved by the Dissertation Committee: Alok Bohara, Chairperson Richard Santos Sarah Stith Smita Pakhale i Essays on Emotional Well-being, Health Insurance Disparities and Health Insurance Markets DISHA SHENDE B.Tech., Shri Guru Govind Singh Inst. of Engr. and Tech., India, 2010 M.A., Applied Economics, University of Cincinnati, 2015 M.A., Economics, University of New Mexico, 2017 DISSERTATION Submitted in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy Economics At the The University of New Mexico Albuquerque, New Mexico July 2020 ii DEDICATION To all the revolutionary figures who fought for my right to education iii ACKNOWLEDGEMENT This has been one of the most important bodies of work in my academic career so far.
    [Show full text]
  • Dafny: an Automatic Program Verifier for Functional Correctness K
    Dafny: An Automatic Program Verifier for Functional Correctness K. Rustan M. Leino Microsoft Research [email protected] Abstract Traditionally, the full verification of a program’s functional correctness has been obtained with pen and paper or with interactive proof assistants, whereas only reduced verification tasks, such as ex- tended static checking, have enjoyed the automation offered by satisfiability-modulo-theories (SMT) solvers. More recently, powerful SMT solvers and well-designed program verifiers are starting to break that tradition, thus reducing the effort involved in doing full verification. This paper gives a tour of the language and verifier Dafny, which has been used to verify the functional correctness of a number of challenging pointer-based programs. The paper describes the features incorporated in Dafny, illustrating their use by small examples and giving a taste of how they are coded for an SMT solver. As a larger case study, the paper shows the full functional specification of the Schorr-Waite algorithm in Dafny. 0 Introduction Applications of program verification technology fall into a spectrum of assurance levels, at one extreme proving that the program lives up to its functional specification (e.g., [8, 23, 28]), at the other extreme just finding some likely bugs (e.g., [19, 24]). Traditionally, program verifiers at the high end of the spectrum have used interactive proof assistants, which require the user to have a high degree of prover expertise, invoking tactics or guiding the tool through its various symbolic manipulations. Because they limit which program properties they reason about, tools at the low end of the spectrum have been able to take advantage of satisfiability-modulo-theories (SMT) solvers, which offer some fixed set of automatic decision procedures [18, 5].
    [Show full text]
  • Bounded Model Checking of Pointer Programs Revisited?
    Bounded Model Checking of Pointer Programs Revisited? Witold Charatonik1 and Piotr Witkowski2 1 Institute of Computer Science, University of Wroclaw, [email protected] 2 [email protected] Abstract. Bounded model checking of pointer programs is a debugging technique for programs that manipulate dynamically allocated pointer structures on the heap. It is based on the following four observations. First, error conditions like dereference of a dangling pointer, are express- ible in a fragment of first-order logic with two-variables. Second, the fragment is closed under weakest preconditions wrt. finite paths. Third, data structures like trees, lists etc. are expressible by inductive predi- cates defined in a fragment of Datalog. Finally, the combination of the two fragments of the two-variable logic and Datalog is decidable. In this paper we improve this technique by extending the expressivity of the underlying logics. In a sequence of examples we demonstrate that the new logic is capable of modeling more sophisticated data structures with more complex dependencies on heaps and more complex analyses. 1 Introduction Automated verification of programs manipulating dynamically allocated pointer structures is a challenging and important problem. In [11] the authors proposed a bounded model checking (BMC) procedure for imperative programs that manipulate dynamically allocated pointer struc- tures on the heap. Although in this procedure an explicit bound is assumed on the length of the program execution, the size of the initial data structure is not bounded. Therefore, such programs form infinite and infinitely branching transition systems. The procedure is based on the following four observations. First, error conditions like dereference of a dangling pointer, are expressible in a fragment of first-order logic with two-variables.
    [Show full text]
  • The Merger Control Review
    [ Exclusively for: Suncica Vaglenarova | 09-Sep-15, 07:52 AM ] ©The Law Reviews The MergerThe Control Review Merger Control Review Sixth Edition Editor Ilene Knable Gotts Law Business Research The Merger Control Review The Merger Control Review Reproduced with permission from Law Business Research Ltd. This article was first published in The Merger Control Review - Edition 6 (published in July 2015 – editor Ilene Knable Gotts) For further information please email [email protected] The Merger Control Review Sixth Edition Editor Ilene Knable Gotts Law Business Research Ltd PUBLISHER Gideon Roberton BUSINESS DEVELOPMENT MANAGER Nick Barette SENIOR ACCOUNT MANAGERS Katherine Jablonowska, Thomas Lee, Felicity Bown ACCOUNT MANAGER Joel Woods PUBLISHING MANAGER Lucy Brewer MARKETING ASSISTANT Rebecca Mogridge EDITORIAL COORDINATOR Shani Bans HEAD OF PRODUCTION Adam Myers PRODUCTION EDITOR Anne Borthwick SUBEDITOR Caroline Herbert MANAGING DIRECTOR Richard Davey Published in the United Kingdom by Law Business Research Ltd, London 87 Lancaster Road, London, W11 1QQ, UK © 2015 Law Business Research Ltd www.TheLawReviews.co.uk No photocopying: copyright licences do not apply. The information provided in this publication is general and may not apply in a specific situation, nor does it necessarily represent the views of authors’ firms or their clients. Legal advice should always be sought before taking any legal action based on the information provided. The publishers accept no responsibility for any acts or omissions contained herein. Although the information provided is accurate as of July 2015, be advised that this is a developing area. Enquiries concerning reproduction should be sent to Law Business Research, at the address above.
    [Show full text]
  • Btech Cse Syllabus 2017.Pdf
    NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL RULES AND REGULATIONS SCHEME OF INSTRUCTION AND SYLLABI FOR B.TECH PROGRAM Effective from 2017-18 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL VISION Towards a Global Knowledge Hub, striving continuously in pursuit of excellence in Education, Research, Entrepreneurship and Technological services to the society. MISSION Imparting total quality education to develop innovative, entrepreneurial and ethical future professionals fit for globally competitive environment. Allowing stake holders to share our reservoir of experience in education and knowledge for mutual enrichment in the field of technical education. Fostering product oriented research for establishing a self-sustaining and wealth creating centre to serve the societal needs. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING VISION Attaining global recognition in Computer Science & Engineering education, research and training to meet the growing needs of the industry and society. MISSION Imparting quality education through well-designed curriculum in tune with the challenging software needs of the industry. Providing state-of-art research facilities to generate knowledge and develop technologies in the thrust areas of Computer Science and Engineering. Developing linkages with world class organizations to strengthen industry-academia relationships for mutual benefit. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.TECH IN COMPUTER SCIENCE AND ENGINEERING PROGRAM EDUCATIONAL OBJECTIVES Apply computer science theory blended with mathematics and engineering to model PEO1 computing systems. Design, implement, test and maintain software systems based on requirement PEO2 specifications. Communicate effectively with team members, engage in applying technologies and PEO3 lead teams in industry. Assess the computing systems from the view point of quality, security, privacy, cost, PEO4 utility, etiquette and ethics.
    [Show full text]
  • Developing Verified Programs with Dafny
    Developing Verified Programs with Dafny K. Rustan M. Leino Microsoft Research, Redmond, WA, USA [email protected] Abstract—Dafny is a programming language and program method Sort(a: int, b: int, c: int) returns (x: int, y: int, z: int) verifier. The language includes specification constructs and the ensures x ≤ y ≤ z ^ multiset{a, b, c} = multiset{x, y, z}; verifier checks that the program lives up to its specifications. { These tutorial notes give some Dafny programs used as examples x, y, z := a, b, c; if z < y { y, z := z, y; } in the tutorial. if y < x { x, y := y, x; } if z < y { y, z := z, y; } I. INTRODUCTION } Reasoning about programs is a fundamental skill that every software engineer needs. Dafny is a programming language Fig. 0. Example that shows some basic features of Dafny. The method’s specification says that x,y,z is a sorted version of a,b,c, and the verifier designed with verification in mind [0]. It can be used to automatically checks the code to satisfy this specification. develop provably correct code (e.g., [1]). Because its state-of- the-art program verifier is easy to run—it runs automatically method TriangleNumber(N: int) returns (t: int) 0 in the background in the integrated development environment requires 0 ≤ N; and it runs at the click of a button in the web version1—Dafny ensures t = N*(N+1) / 2; { also stands out as a tool that through its analysis feedback t := 0; helps teach reasoning about programs. This tutorial shows how var n := 0; while n < N to use Dafny, and these tutorial notes show some example invariant 0 ≤ n ≤ N ^ t = n*(n+1) / 2; programs that highlight major features of Dafny.
    [Show full text]
  • Dafny Quick Reference* J
    DAFNY QUICK REFERENCE* J. Pascoal Faria *NON-EXHAUSTIVE FEUP, MIEIC, MFES, 2019/20 INDEX What is Dafny Type system Program Specification & .Programming styles .Basic types organization verification constructs .Programs & .Collections .Methods .Basic: specifications .Sets .Functions & .requires and ensures .Verifier, compiler & .Sequences predicates .reads, modifies & old VSCode extension .Multisets .Expressions .invariant & decreases .Maps .Statements .Advanced: .Tuples .Modules .assert & assume .Inductive data .ghost variables & types methods .lemmas .Arrays .attributes .Classes .Traits WHAT IS DAFNY? WHAT IS DAFNY? A powerful programming language & system from Microsoft Research, targeting the development of verified programs, and used in several real world projects requiring formal verification. Powerful programming language: Multi-paradigm: combines the functional, imperative and object-oriented styles Allows writing programs (implementations) and specifications (with several sorts of assertions & annotations) Powerful programming system: Verifier using Z3 Compiler to C# Extension for VSCode PROGRAMMING STYLES Functional .Immutable types (value types) .Side-effect free functions and predicates .… Best suited for writing specifications! Imperative (structured & object-oriented) .Statements .Methods .Modules .Classes .… Best suited for writing implementations! PROGRAMS (IMPLEMENTATIONS) & SPECIFICATIONS Formal specification of method pre- and post-conditions (method semantics). Formal specification of loop variant and invariant,
    [Show full text]
  • User Interaction in Deductive Interactive Program Verification
    User Interaction in Deductive Interactive Program Verification Zur Erlangung des akademischen Grades eines Doktors der Naturwissenschaften von der KIT-Fakult¨atf¨urInformatik des Karlsruher Instituts f¨urTechnologie (KIT) genehmigte Dissertation von Sarah Caecilia Grebing aus Mannheim Tag der m¨undlichen Pr¨ufung: 07. Februar 2019 Erster Gutachter: Prof. Dr. Bernhard Beckert Zweiter Gutachter: Assoc. Prof. Dr. Andr´ePlatzer Contents Deutsche Zusammenfassung xv 1. Introduction1 1.1. Structure and Contribution of this Thesis . .2 1.1.1. Qualitative, Explorative User Studies . .3 1.1.2. Interaction Concept for Interactive Program Verification . .5 1.2. Previously Published Material . .6 I. Foundations for this Thesis9 2. Usability of Software Systems: Background and Methods 11 2.1. Human-Computer Interaction . 12 2.2. User-Centered Process . 12 2.3. Usability . 13 2.3.1. What is Usability? . 13 2.3.2. Usability Principles . 14 2.4. Interactions . 16 2.4.1. Models of Interaction . 16 2.4.2. Interaction Styles . 18 2.5. Task Analysis . 20 2.5.1. A brief Introduction to Sequence Models . 20 2.6. Evaluation Methods . 22 2.6.1. Questionnaires . 23 2.6.2. Interviews . 24 2.6.3. Focus Groups . 24 2.6.4. Preparation and Conduction of Focus Groups and Interviews . 25 3. Interactive Deductive Program Verification 29 3.1. Introduction . 29 3.2. Logical Calculi . 30 3.3. Specification of Java Programs with JML . 32 3.3.1. Method Contracts . 33 3.3.2. Loop Invariants . 34 3.3.3. Class Invariants . 36 3.3.4. The Purpose of Specifications . 36 3.4. A Brief Introduction to Java Dynamic Logic (JavaDL) .
    [Show full text]