{"title":"Linearly Ordered Attribute Grammars: with Automatic Augmenting Dependency Selection","authors":"L. T. V. Binsbergen, J. Bransen, A. Dijkstra","doi":"10.1145/2678015.2682543","DOIUrl":"https://doi.org/10.1145/2678015.2682543","url":null,"abstract":"Attribute Grammars (AGs) extend Context-Free Grammars with attributes: information gathered on the syntax tree that adds semantics to the syntax. AGs are very well suited for describing static analyses, code-generation and other phases incorporated in a compiler. AGs are divided into classes based on the nature of the dependencies between the attributes. In this paper we examine the class of Linearly Ordered Attribute Grammars (LOAGs), for which strict, bounded size evaluators can be generated. Deciding whether an Attribute Grammar is linearly ordered is an NP-hard problem. The Ordered Attribute Grammars form a subclass of LOAG for which membership is tested in polynomial time by Kastens' algorithm (1980). On top of this algorithm we apply an augmenting dependency selection algorithm, allowing it to determine membership for the class LOAG. Although the worst-case complexity of our algorithm is exponential, the algorithm turns out to be efficient for practical full-sized AGs. As a result, we can compile the main AG of the Utrecht Haskell Compiler without the manual addition of augmenting dependencies. The reader is provided with insight in the difficulty of deciding whether an AG is linearly ordered, what optimistic choice is made by Kastens' algorithm and how augmenting dependencies can resolve these difficulties.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"41 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132872969","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Object-sensitive Type Analysis of PHP","authors":"H. Hoek, Jurriaan Hage","doi":"10.1145/2678015.2682535","DOIUrl":"https://doi.org/10.1145/2678015.2682535","url":null,"abstract":"In this paper we develop an object-sensitive type analysis for PHP, based on an extension of the notion of monotone frameworks to deal with the dynamic aspects of PHP, and following the framework of Smaragdakis et al. for object-sensitive analysis. We consider a number of instantiations of the framework to see how the choices affect the running cost of the analysis, and the precision of the outcome. In this setting we have not been able to reproduce the major gains reported by Smaragdakis et al., but do find that abstract garbage collection substantially increases the scalability of our analyses.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"106 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115743010","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Generalising Tree Traversals to DAGs: Exploiting Sharing without the Pain","authors":"P. Bahr, E. Axelsson","doi":"10.1145/2678015.2682539","DOIUrl":"https://doi.org/10.1145/2678015.2682539","url":null,"abstract":"We present a recursion scheme based on attribute grammars that can be transparently applied to trees and acyclic graphs. Our recursion scheme allows the programmer to implement a tree traversal and then apply it to compact graph representations of trees instead. The resulting graph traversals avoid recomputation of intermediate results for shared nodes -- even if intermediate results are used in different contexts. Consequently, this approach leads to asymptotic speedup proportional to the compression provided by the graph representation. In general, however, this sharing of intermediate results is not sound. Therefore, we complement our implementation of the recursion scheme with a number of correspondence theorems that ensure soundness for various classes of traversals. We illustrate the practical applicability of the implementation as well as the complementing theory with a number of examples.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"113 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123618460","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","authors":"K. Asai, Kostis Sagonas","doi":"10.1145/2678015","DOIUrl":"https://doi.org/10.1145/2678015","url":null,"abstract":"It is our great pleasure to welcome you to the ACM SIGPLAN 2015 Workshop on Partial Evaluation and Program Manipulation -- PEPM'15, taking place in Mumbai, India, on the 13th and 14th of January 2015. The PEPM series aims to bring together researchers and practitioners working in the broad area of program transformation, an area which spans from refactoring, partial evaluation, super- compilation, staged programming, fusion and other meta-programming to model-driven development, program analyses including termination, inductive programming, program generation and applications of machine learning and probabilistic search. \u0000 \u0000In response to the call for papers, 27 abstracts were submitted, from which 20 materialized as paper submissions. Their topics covered theory and applications of various analysis and program manipulation techniques. The program committee decided to accept 14 of them, ten as full papers, three as short papers and one as a brief announcement. Few submissions got three reviews, the majority got four, and the remaining ones five. Afterwards the PC voted to select the best paper accepted for PEPM'15. We are delighted to announce that the award for the best paper submitted goes to Constraint Specialisation in Horn Clause Verification by Bishoksan Kafle and John P. Gallagher. \u0000 \u0000This volume also includes the abstract of the invited talk by Shriram Krishnamurthi.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"12 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116515450","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Type-based Exception Analysis for Non-strict Higher-order Functional Languages with Imprecise Exception Semantics","authors":"Ruud Koot, Jurriaan Hage","doi":"10.1145/2678015.2682542","DOIUrl":"https://doi.org/10.1145/2678015.2682542","url":null,"abstract":"Most statically typed functional programming languages allow programmers to write partial functions: functions that are not defined on all the elements of their domain as specified by their type. Applying a partial function to a value on which it is not defined will raise a run-time exception, thus in practice well-typed programs can and do still go wrong. To warn programmers about such errors, contemporary compilers for functional languages employ a local and purely syntactic analysis to detect partial case-expressions--those that do not cover all possible patterns of constructors. As programs often maintain invariants on their data, restricting the potential values of the scrutinee to a subtype of its given or inferred type, many of these incomplete case-expressions are harmless. Such an analysis does not account for these invariants and will thus report many false positives, overwhelming the programmer. We develop a constraint-based type system that detects harmful sources of partiality and prove it correct with respect to an imprecise exception semantics. The analysis accurately tracks the flow of both exceptions--the manifestation of partiality gone wrong--and ordinary data through the program, as well as the dependencies between them. The latter is crucial for usable precision, but has been omitted from previously published exception analyses.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"59 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114674093","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Threads as Resource for Concurrency Verification","authors":"Duy-Khanh Le, W. Chin, Y. M. Teo","doi":"10.1145/2678015.2682540","DOIUrl":"https://doi.org/10.1145/2678015.2682540","url":null,"abstract":"In mainstream languages, threads are first-class in that they can be dynamically created, stored in data structures, passed as parameters, and returned from procedures. However, existing verification systems support reasoning about threads in a restricted way: threads are often represented by unique tokens that can neither be split nor shared. In this paper, we propose \"threads as resource\" to enable more expressive treatment of first-class threads. Our approach allows the ownership of a thread (and its resource) to be flexibly split, combined, and (partially) transferred across procedure and thread boundaries. We illustrate the utility of our approach in handling three problems. First, we use \"threads as resource\" to verify the multi-join pattern, i.e. threads can be shared among concurrent threads and joined multiple times in different threads. Second, using inductive predicates, we show how our approach naturally captures the threadpool idiom where threads are stored in data structures. Lastly, we present how thread liveness can be precisely tracked. To demonstrate the feasibility of our approach, we implemented it in a tool, called ThreadHIP, on top of an existing ParaHIP verifier. Experimental results show that ThreadHIP is more expressive than ParaHIP while achieving comparable verification performance.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"52 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122280017","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Verifying Relational Properties of Functional Programs by First-Order Refinement","authors":"Kazuyuki Asada, Ryosuke Sato, N. Kobayashi","doi":"10.1145/2678015.2682546","DOIUrl":"https://doi.org/10.1145/2678015.2682546","url":null,"abstract":"Much progress has been made recently on fully automated verification of higher-order functional programs, based on refinement types and higher-order model checking. Most of those verification techniques are, however, based on first-order refinement types, hence unable to verify certain properties of functions (such as the equality of two recursive functions and the monotonicity of a function, which we call relational properties). To relax this limitation, we introduce a restricted form of higher-order refinement types where refinement predicates can refer to functions, and formalize a systematic program transformation to reduce type checking/inference for higher-order refinement types to that for first-order refinement types, so that the latter can be automatically solved by using an existing software model checker. We also prove the soundness of the transformation, and report on preliminary implementation and experiments.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"8 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125343481","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Static Backward Demand-Driven Slicing","authors":"B. Lisper, A. Masud, Husni Khanfar","doi":"10.1145/2678015.2682538","DOIUrl":"https://doi.org/10.1145/2678015.2682538","url":null,"abstract":"Program slicing identifies the program parts that may affect certain properties of the program, such as the outcomes of conditions affecting the program flow. Ottenstein's Program Dependence Graph (PDG) based algorithm is the state-of-practice for static slicing today: it is well-suited in applications where many slices are computed, since the cost of building the PDG then can be amortized over the slices. But there are applications that require few slices of a given program, and where computing all the dependencies may be unnecessary. We present a light-weight interprocedural algorithm for backward static slicing where the data dependence analysis is done using a variant of the Strongly Live Variables (SLV) analysis. This allows us to avoid building the Data Dependence Graph, and to slice program statements \"on-the-fly'' during the SLV analysis which is potentially faster for computing few slices. Furthermore we use an abstract interpretation-based value analysis to extend our slicing algorithm to slice low-level code, where data dependencies are not evident due to dynamically calculated addresses. Our algorithm computes slices as sets of Control Flow Graph nodes: we show how to adapt existing techniques to generate executable slices that correspond to semantically correct code, where jump statements have been inserted at appropriate places. We have implemented our slicing algorithms, and made an experimental evaluation comparing them with the standard PDG-based algorithm for a number of example programs. We obtain the same accuracy as for PDG-based slicing, sometimes with substantial improvements in performance.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"92 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127057050","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Constraint Specialisation in Horn Clause Verification","authors":"Bishoksan Kafle, J. Gallagher","doi":"10.1145/2678015.2682544","DOIUrl":"https://doi.org/10.1145/2678015.2682544","url":null,"abstract":"We present a method for specialising the constraints in constrained Horn clauses with respect to a goal. We use abstract interpretation to compute a model of a query-answer transformation of a given set of clauses and a goal. The effect is to propagate the constraints from the goal top-down and propagate answer constraints bottom-up. Our approach does not unfold the clauses at all; we use the constraints from the model to compute a specialised version of each clause in the program. The approach is independent of the abstract domain and the constraints theory underlying the clauses. Experimental results on verification problems show that this is an effective transformation, both in our own verification tools (convex polyhedra analyser) and as a pre-processor to other Horn clause verification tools.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"106 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124752515","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Jun Yu Li, Chenglong Wang, Yingfei Xiong, Zhenjiang Hu
{"title":"SWIN: Towards Type-Safe Java Program Adaptation between APIs","authors":"Jun Yu Li, Chenglong Wang, Yingfei Xiong, Zhenjiang Hu","doi":"10.1145/2678015.2682534","DOIUrl":"https://doi.org/10.1145/2678015.2682534","url":null,"abstract":"Java program adaptation between different APIs is a common task in software development. When an old API is upgraded to an incompatible new version, or when we want to migrate an application from one platform to another platform, we need to adapt programs between different APIs. Although different program transformation tools have been developed to automate the program adaptation task, no tool ensures type safety in transforming Java programs: given a transformation program and any well-typed Java program, the transformed result is still well-typed. As a matter of fact, it is often observed that a dedicated adaptation tool turns a working application into a set of incompatible programs. We address this problem by providing a type-safe transformation language, SWIN, for Java program adaptation between different APIs. SWIN is based on Twinning, a modern transformation language for Java programs. SWIN enhances Twinning with more flexible transformation rules, formal semantics, and, most importantly, full type-safe guarantee. We formally prove the type safety of SWIN on Featherweight Java, a known minimal formal core of Java. Our experience with three case studies shows that SWIN is as expressive as Twinning in specifying useful program transformations in the case studies while guaranteeing the type safety of the transformations.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"11 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131584108","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}