637 research outputs found

    System dependence graphs in sequential Erlang

    Full text link
    The system dependence graph (SDG) is a data structure used in the imperative paradigm for different static analysis, and particularly, for program slicing. Program slicing allows us to determine the part of a program (called slice) that influences a given variable of interest. Thanks to the SDG, we can produce precise slices for interprocedural programs. Unfortunately, the SDG cannot be used in the functional paradigm due to important features that are not considered in this formalism (e.g., pattern matching, higher-order, composite expressions, etc.). In this work we propose the first adaptation of the SDG to a functional language facing these problems. We take Erlang as the host language and we adapt the algorithms used to slice the SDG to produce precise slices of Erlang interprocedural programs. As a proof-of-concept, we have implemented a program slicer for Erlang based on our SDGs.This work has been partially supported by the Spanish Ministerio de Ciencia e Innovaci´on under grant TIN2008-06622-C03-02 and by the Generalitat Valenciana under grant PROMETEO/2011/052. Salvador Tamarit was partially supported by the Spanish MICINN under FPI grant BES-2009-015019Silva Galiana, JF.; Tamarit Muñoz, S.; Tomás Franco, C. (2012). System dependence graphs in sequential Erlang. En Fundamental Approaches to Software Engineering. Springer Verlag (Germany). 486-500. https://doi.org/10.1007/978-3-642-28872-2_33S486500Agrawal, H., Horgan, J.R.: Dynamic program slicing. In: Programming Language Design and Implementation (PLDI), pp. 246–256 (1990)Brown, C.: Tool Support for Refactoring Haskell Programs. PhD thesis, School of Computing, University of Kent, Canterbury, Kent, UK (2008)Cheda, D., Silva, J., Vidal, G.: Static slicing of rewrite systems. Electron. Notes Theor. Comput. Sci. 177, 123–136 (2007)Ferrante, J., Ottenstein, K.J., Warren, J.D.: The Program Dependence Graph and Its Use in Optimization. ACM Transactions on Programming Languages and Systems 9(3), 319–349 (1987)Field, J., Ramalingam, G., Tip, F.: Parametric program slicing. In: Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1995, pp. 379–392. ACM, New York (1995)Horwitz, S., Reps, T., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Transactions Programming Languages and Systems 12(1), 26–60 (1990)Korel, B., Laski, J.: Dynamic Program Slicing. Information Processing Letters 29(3), 155–163 (1988)Larsen, L., Harrold, M.J.: Slicing object-oriented software. In: Proceedings of the 18th International Conference on Software Engineering, ICSE 1996, pp. 495–505. IEEE Computer Society, Washington, DC (1996)Liang, D., Harrold, M.J.: Slicing objects using system dependence graphs. In: Proceedings of the International Conference on Software Maintenance, ICSM 1998, pp. 358–367. IEEE Computer Society, Washington, DC (1998)Lindahl, T., Sagonas, K.F.: Typer: a type annotator of erlang code. In: Sagonas, K.F., Armstrong, J. (eds.) Erlang Workshop, pp. 17–25. ACM (2005)Lindahl, T., Sagonas, K.F.: Practical type inference based on success typings. In: Bossi, A., Maher, M.J. (eds.) PPDP, pp. 167–178. ACM (2006)Ochoa, C., Silva, J., Vidal, G.: Dynamic slicing based on redex trails. In: Proceedings of the 2004 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM 2004, pp. 123–134. ACM, New York (2004)Reps, T., Turnidge, T.: Program Specialization via Program Slicing. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 409–429. Springer, Heidelberg (1996)Rodrigues, N.F., Barbosa, L.S.: Component identification through program slicing. In: Proc. of Formal Aspects of Component Software (FACS 2005). Elsevier ENTCS, pp. 291–304. Elsevier (2005)Tip, F.: A survey of program slicing techniques. Journal of Programming Languages 3(3), 121–189 (1995)Tóth, M., Bozó, I., Horváth, Z., Lövei, L., Tejfel, M., Kozsik, T.: Impact Analysis of Erlang Programs Using Behaviour Dependency Graphs. In: Horváth, Z., Plasmeijer, R., Zsók, V. (eds.) CEFP 2009. LNCS, vol. 6299, pp. 372–390. Springer, Heidelberg (2010)Walkinshaw, N., Roper, M., Wood, M., Roper, N.W.M.: The java system dependence graph. In: Third IEEE International Workshop on Source Code Analysis and Manipulation, p. 5 (2003)Weiser, M.: Program Slicing. In: Proceedings of the 5th International Conference on Software Engineering, pp. 439–449. IEEE Press (1981)Widera, M.: Flow graphs for testing sequential erlang programs. In: Proceedings of the 2004 ACM SIGPLAN Workshop on Erlang, ERLANG 2004, pp. 48–53. ACM, New York (2004)Widera, M., Informatik, F.: Concurrent erlang flow graphs. In: Proceedings of the Erlang/OTP User Conference (2005)Zhao, J.: Slicing aspect-oriented software. In: Proceedings of the 10th International Workshop on Program Comprehension, IWPC 2002, pp. 251–260. IEEE Computer Society, Washington, DC (2002

    Safe Concurrency Introduction through Slicing

    Get PDF
    Traditional refactoring is about modifying the structure of existing code without changing its behaviour, but with the aim of making code easier to understand, modify, or reuse. In this paper, we introduce three novel refactorings for retrofitting concurrency to Erlang applications, and demonstrate how the use of program slicing makes the automation of these refactorings possible

    Static Analysis for Divide-and-Conquer Pattern Discovery

    Get PDF
    Routines implementing divide-and-conquer algorithms are good candidates for parallelization. Their identifying property is that such a routine divides its input into "smaller" chunks, calls itself recursively on these smaller chunks, and combines the outputs into one. We set up conditions which characterize a wide range of d&c routine definitions. These conditions can be verified by static program analysis. This way d&c routines can be found automatically in existing program texts, and their parallelization based on semi-automatic refactoring can be facilitated. We work out the details in the context of the Erlang programming language

    Erlang programok statikus elemzése és szeletelése

    Get PDF
    A funkcionális programozási nyelvek terjedésének velejárója, hogy felmerül az igény olyan eszközökre, amelyek a fejlesztési folyamatot támogatják. Ezek lehetnek futási idejű eszközök, vagy olyanok, melyek csupán a forráskód elemzésével kı́nálnak hasznos információkat a fejlesztők számára. Az Erlang ipari környezetben is gyakran használt funkcionális programozási nyelv. A RefactorErl egy statikus elemző és refaktoráló eszköz Erlanghoz, mely számos transzformációt biztosı́t a forráskód jelentésmegőrző átalakı́tására, másrészről kiterjedt statikus elemzőkészlettel segı́ti a fejlesztőket a mindennapos tevékenységükben. Kutatásomban olyan elemzési módszerekkel foglalkoztam, amelyek segı́tségével az Erlang programok forráskódjában rejlő összetett összefüggések nyerhetők ki. Ezek az eredmények pedig további magasabb szintű elemzések alapját képzik. Az ismertetett eredményeim a vezérlés és az Erlang folyamatok közötti kapcsolatok elemzéséhez kapcsolódnak. A dolgozatomban Erlang programok vezérlésfolyam-gráfját adtam meg, amely tartalmazza a programok végrehajtása során előálló lehetséges végrehajtási utakat. A gráfot a nyelv szintaktikus kategóriáihoz rendelt formális szabályok segı́tségével definiáltam, amelyek a nyelv szemantikájának megfelelően adják meg a vezérlésfolyam-gráf éleit. A vezérlésfolyam-gráf felhasználásra került további elemzésekhez is, mint például a párhuzamosı́tható komponensek azonosı́tása. A vezérlésfolyam-gráf, illetve a benne foglalt információk felhasználhatóak a forráskódban történő változások hatáselemzéséhez. A vezérlésfüggőségi gráf egy kompaktabb reprezentáció, amely a vezérlési utakban lévő szekvenciák eliminálásával már csak a kifejezések közötti közvetlen függőségeket tartalmazza. Megadtam Erlang programokra a vezérlésfüggőségi gráfot, amelyet adatfüggőségi információkkal egészı́tettem ki. Az ı́gy definiált Erlang függőségi gráf felhasználható gráf alapú statikus programszeleteléshez. A definiált infrastruktúrára épı́tve megadtam egy hatáselemzés alapú teszteset szelekciós módszert. A módszer azon tesztesetek halmazát adja meg, amelyek érintettek lehetnek a változtatás/transzformáció kapcsán. Azaz a változtatás hatása elterjedhet a tesztelt funkcionalitásba. Az elemzés nem csak a transzformációk hatásának elemzésére, hanem tetszőleges változás elemzésére is használható. Dolgozatomban bemutattam Erlang programok egy statikus kommunikációs modelljét. Megadtam azokat az algoritmusokat, melyek segı́tségével felderı́thetőek az elindı́tott Erlang folyamatok és a köztük aszinkron üzenetküldésekkel lebonyolı́tott kommunikáció. A modellbe felvettem olyan rejtett kommunikációs elemeket is, mint a közös osztott memóriának tekinthető Erlang Term Storage (ets) táblák használata. Megadtam azokat a statikus elemzési algoritmusokat, melyek felhasználásával kiegészı́thető a kommunikációs gráf speciális Erlang folyamatokkal (például generikus szerverek) és az interfészeiken keresztül történő rejtett kommunikációval. A kommunikációs gráf kiválóan használható a kódban rejlő összefüggések megjelenı́tésére, kódmegértés, konkurenciából fakadó hibakeresés támogatásához. Ugyanakkor felhasználható konkurens programok változásához köthető hatáselemzés pontosı́tásához is

    Semi-Parametric Likelihood Functions for Bivariate Survival Data

    Get PDF
    Because of the numerous applications, characterization of multivariate survival distributions is still a growing area of research. The aim of this thesis is to investigate a joint probability distribution that can be derived for modeling nonnegative related random variables. We restrict the marginals to a specified lifetime distribution, while proposing a linear relationship between them with an unknown (error) random variable that we completely characterize. The distributions are all of positive supports, but one class has a positive probability of simultaneous occurrence. In that sense, we capture the absolutely continuous case, and the Marshall-Olkin type with a positive probability of simultaneous event on a set of measure zero. In particular, the form of the joint distribution when the marginals are of gamma distributions are provided, combining in a simple parametric form the dependence between the two random variables and a nonparametric likelihood function for the unknown random variable. Associated properties are studied and investigated and applications with simulated and real data are given

    Field-Sensitive Program Slicing

    Get PDF
    The granularity level of the program dependence graph (PDG) for composite data structures (tuples, lists, records, objects, etc.) is inaccurate when slicing their inner elements. We present the constrained-edges PDG (CE-PDG) that addresses this accuracy problem. The CE-PDG enhances the representation of composite data structures by decomposing statements into a subgraph that represents the inner elements of the structure, and the inclusion and propagation of data constraints along the CE-PDG edges allows for accurate slicing of complex data structures. Both extensions are conservative with respect to the PDG, in the sense that all slicing criteria (and more) that can be specified in the PDG can be also specified in the CE-PDG, and the slices produced with the CE-PDG are always smaller or equal to the slices produced by the PDG. An evaluation of our approach shows a reduction of the slices of 11.67%/5.49% for programs without/with loops

    Using Actors to Implement Sequential Simulations

    Get PDF
    This thesis investigates using an approach based on the Actors paradigm for implementing a discrete event simulation system and comparing the results with more traditional approaches. The goal of this work is to determine if using Actors for sequential programming is viable. If Actors are viable for this type of programming, then it follows that they would be usable for general programming. One potential advantage of using Actors instead of traditional paradigms for general programming would be the elimination of a distinction between designing for a sequential environment and a concurrent/distributed one. Using Actors for general programming may also allow for a single implementation that can be deployed on both single core and multiple core systems. Most of the existing discussions about the Actors model focus on its strengths in distributed environments and its ability to scale with the amount of available computing resources. The chosen system for implementation is intentionally sequential to allow for examination of the behaviour of existing Actors implementations where managing concurrency complexity is not the primary task. Multiple implementations of the simulation system were built using different languages (C++, Erlang, and Java) and different paradigms, including traditional ones and Actors. These different implementations were compared quantitatively, based on their execution time, memory usage, and code complexity. The analysis of these comparisons indicates that for certain existing development environments, Erlang/OTP, following the Actors paradigm, produces a comparable or better implementation than traditional paradigms. Further research is suggested to solidify the validity of the results presented in this research and to extend their applicability

    Dynamic slicing of concurrent specification languages

    Full text link
    This is the author’s version of a work that was accepted for publication in Parallel Computing. Changes resulting from the publishing process, such as peer review, editing, corrections, structural formatting, and other quality control mechanisms may not be reflected in this document. Changes may have been made to this work since it was submitted for publication. A definitive version was subsequently published in Parallel Computing, 53, 1-22., (2016). DOI 10.1016/j.parco.2016.01.006.[EN] Dynamic slicing is a technique to extract the part of the program (called slice) that influences or is influenced, in a particular execution, by a given point of interest in the source code (called slicing criterion). Since a single execution is considered, the technique often uses a trace of this execution to analyze data and control dependencies. In this work we present the first formulation and implementation of dynamic slicing in the context of CSP. Most of the ideas presented can be directly applied to other concurrent specification languages such as Promela or CCS, but we center the discussion and the implementation on CSP. We base our technique on a new data structure to represent CSP computations called track. A track is a data structure which represents the sequence of expressions that have been evaluated during the computation, and moreover, it is labeled with the location of these expressions in the specification. The implementation of a dynamic slicer for CSP is useful for debugging, program comprehension, and program specialization, and it is also interesting from a theoretical perspective because CSP introduces difficulties such as heavy concurrency and non-determinism, synchronizations, frequent absence of data dependence, etc. © 2016 Elsevier B.V. All rights reservedThis work has been partially supported by the EU (FEDER) and the Spanish Ministerio de Economia y Competitividad under Grant TIN2013-44742-C4-1-R and by the Generalitat Valenciana under Grant PROMETEOII/2015/013 (SmartLogic). Salvador Tamarit was partially supported by Madrid regional projects N-GREENS Software-CM (S2013/ICE-2731), and by European Union project POLCA (STREP FP7-ICT-20133.4 610686).Llorens Agost, ML.; Oliver Villarroya, J.; Silva, J.; Tamarit Muñoz, S. (2016). Dynamic slicing of concurrent specification languages. Parallel Computing. 53:1-22. https://doi.org/10.1016/j.parco.2016.01.006S1225

    Safety verification of asynchronous pushdown systems with shaped stacks

    Full text link
    In this paper, we study the program-point reachability problem of concurrent pushdown systems that communicate via unbounded and unordered message buffers. Our goal is to relax the common restriction that messages can only be retrieved by a pushdown process when its stack is empty. We use the notion of partially commutative context-free grammars to describe a new class of asynchronously communicating pushdown systems with a mild shape constraint on the stacks for which the program-point coverability problem remains decidable. Stacks that fit the shape constraint may reach arbitrary heights; further a process may execute any communication action (be it process creation, message send or retrieval) whether or not its stack is empty. This class extends previous computational models studied in the context of asynchronous programs, and enables the safety verification of a large class of message passing programs
    corecore