561 results on '"Program transformation"'
Search Results
2. Making legacy Fortran code type safe through automated program transformation
- Author
-
Wim Vanderbauwhede
- Subjects
Computer science ,Programming language ,Fortran ,Subroutine ,Program transformation ,020206 networking & telecommunications ,02 engineering and technology ,Type (model theory) ,computer.software_genre ,Theoretical Computer Science ,Hardware and Architecture ,Type safety ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,020201 artificial intelligence & image processing ,Compiler ,Legacy code ,computer ,Software ,Information Systems ,computer.programming_language - Abstract
Fortran is still widely used in scientific computing, and a very large corpus of legacy as well as new code is written in FORTRAN 77. In general this code is not type safe, so that incorrect programs can compile without errors. In this paper, we present a formal approach to ensure type safety of legacy Fortran code through automated program transformation. The objective of this work is to reduce programming errors by guaranteeing type safety. We present the first rigorous analysis of the type safety of FORTRAN 77 and the novel program transformation and type checking algorithms required to convert FORTRAN 77 subroutines and functions into pure, side-effect free subroutines and functions in Fortran 90. We have implemented these algorithms in a source-to-source compiler which type checks and automatically transforms the legacy code. We show that the resulting code is type safe and that the pure, side-effect free and referentially transparent subroutines can readily be offloaded to accelerators.
- Published
- 2022
3. Characterization and Automatic Updates of Deprecated Machine-Learning API Usages
- Author
-
Lingxiao Jiang, David Lo, Stefanus Agus Haryono, Julia Lawall, Ferdian Thung, Singapore Management University (SIS), Well Honed Infrastructure Software for Programming Environments and Runtimes (Whisper), Inria de Paris, Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria), This research is also supported by the Singapore National Research Foundation (award number: NRF2016-NRF-ANR003), ANR-16-CE25-0012,ITrans,Inférence automatique de règles de transformation pour le portage des logiciels d'infrastructure patrimoniaux(2016), Singapore Management University, Well Honed Infrastructure Software for Programming Environments and Runtimes ( Whisper), Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-LIP6, and Sorbonne Université (SU)-Centre National de la Recherche Scientifique (CNRS)-Sorbonne Université (SU)-Centre National de la Recherche Scientifique (CNRS)
- Subjects
Computer science ,business.industry ,Program transformation ,020207 software engineering ,02 engineering and technology ,Deprecated API ,[INFO.INFO-SE]Computer Science [cs]/Software Engineering [cs.SE] ,Python (programming language) ,Machine learning ,computer.software_genre ,User input ,Deprecated ,Program Transformation ,Empirical research ,Digital subscriber line ,0202 electrical engineering, electronic engineering, information engineering ,Feature (machine learning) ,Applications of artificial intelligence ,Artificial intelligence ,business ,Automatic Update ,computer ,computer.programming_language ,Python - Abstract
International audience; Due to the rise of AI applications, machine learning (ML) libraries, often written in Python, have become far more accessible. ML libraries tend to be updated periodically, which may deprecate existing APIs, making it necessary for application developers to update their usages. In this paper, we build a tool to automate deprecated API usage updates. We first present an empirical study to better understand how updates of deprecated ML API usages in Python can be done. The study involves a dataset of 112 deprecated APIs from Scikit-Learn, TensorFlow, and PyTorch. Guided by the findings of our empirical study, we propose MLCatchUp, a tool to automate the updates of Python deprecated API usages, that automatically infers the API migration transformation through comparison of the deprecated and updated API signatures. These transformations are expressed in a Domain Specific Language (DSL). We evaluate MLCatchUp using a dataset containing 267 files with 551 API usages that we collected from public GitHub repositories. In our dataset, MLCatchUp can detect deprecated API usages with perfect accuracy, and update them correctly for 80.6% of the cases. We further improve the accuracy of MLCatchUp in performing updates by adding a feature that allows it to accept an additional user input that specifies the transformation constraints in the DSL for context-dependent API migration. Using this addition, MLCatchUp can make correct updates for 90.7% of the cases.
- Published
- 2021
- Full Text
- View/download PDF
4. MLCatchUp: Automated Update of Deprecated Machine-Learning APIs in Python
- Author
-
Ferdian Thung, Stefanus Agus Haryono, David Lo, Julia Lawall, Lingxiao Jiang, Singapore Management University (SIS), Singapore Management University, Well Honed Infrastructure Software for Programming Environments and Runtimes ( Whisper), Inria de Paris, Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-LIP6, Sorbonne Université (SU)-Centre National de la Recherche Scientifique (CNRS)-Sorbonne Université (SU)-Centre National de la Recherche Scientifique (CNRS), This research is also supported by the Singapore National Research Foundation (award number: NRF2016-NRF-ANR003), ANR-16-CE25-0012,ITrans,Inférence automatique de règles de transformation pour le portage des logiciels d'infrastructure patrimoniaux(2016), Well Honed Infrastructure Software for Programming Environments and Runtimes (Whisper), and Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)
- Subjects
Computer science ,Process (engineering) ,business.industry ,A domain ,Program transformation ,020207 software engineering ,Deprecated API ,[INFO.INFO-SE]Computer Science [cs]/Software Engineering [cs.SE] ,02 engineering and technology ,Python (programming language) ,Machine learning ,computer.software_genre ,Program Transformation ,Deprecated ,Digital subscriber line ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,Artificial intelligence ,Automatic Update ,business ,computer ,Python ,computer.programming_language - Abstract
Tool Paper; International audience; Machine learning (ML) libraries are gaining vast popularity, especially in the Python programming language. Using the latest version of such libraries is recommended to ensure the best performance and security. When migrating to the latest version of a machine learning library, usages of deprecated APIs need to be updated, which is a time-consuming process. In this paper, we propose MLCatchUp, an automated API usage update tool for deprecated APIs of popular ML libraries written in Python. MLCatchUp automatically infers the required transformation to migrate usages of deprecated API through the differences between the deprecated and updated API signatures. MLCatchUp offers a readable transformation rule in the form of a domain specific language (DSL). We evaluate MLCatchUp using a dataset of 267 real-world Python code containing 551 usages of 68 distinct deprecated APIs, where MLCatchUp achieves 90.7% accuracy. A video demonstration of MLCatchUp is available at https://youtu.be/5NjOPNt5iaA.
- Published
- 2021
- Full Text
- View/download PDF
5. On the fly synthesis of edit suggestions
- Author
-
Arjun Radhakrishna, Abhishek Udupa, Vu Le, Alan Leung, Anders Miltner, Sumit Gulwani, Ashish Tiwari, and Gustavo Soares
- Subjects
SQL ,Computer science ,Programming by example ,Programming language ,Programming by demonstration ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,Microsoft Visual Studio ,Code refactoring ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Safety, Risk, Reliability and Quality ,computer ,Software ,Markdown ,Program synthesis ,computer.programming_language - Abstract
When working with a document, users often perform context-specific repetitive edits – changes to the document that are similar but specific to the contexts at their locations. Programming by demonstration/examples (PBD/PBE) systems automate these tasks by learning programs to perform the repetitive edits from demonstration or examples. However, PBD/PBE systems are not widely adopted, mainly because they require modal UIs – users must enter a special mode to give the demonstration/examples. This paper presents Blue-Pencil, a modeless system for synthesizing edit suggestions on the fly. Blue-Pencil observes users as they make changes to the document, silently identifies repetitive changes, and automatically suggests transformations that can apply at other locations. Blue-Pencil is parameterized – it allows the ”plug-and-play” of different PBE engines to support different document types and different kinds of transformations. We demonstrate this parameterization by instantiating Blue-Pencil to several domains – C# and SQL code, markdown documents, and spreadsheets – using various existing PBE engines. Our evaluation on 37 code editing sessions shows that Blue-Pencil synthesized edit suggestions with a precision of 0.89 and a recall of 1.0, and took 199 ms to return suggestions on average. Finally, we report on several improvements based on feedback gleaned from a field study with professional programmers to investigate the use of Blue-Pencil during long code editing sessions. Blue-Pencil has been integrated with Visual Studio IntelliCode to power the IntelliCode refactorings feature.
- Published
- 2019
- Full Text
- View/download PDF
6. Neural architecture search as program transformation exploration
- Author
-
Jack Turner, Elliot J. Crowley, and Michael O'Boyle
- Subjects
FOS: Computer and information sciences ,Scheme (programming language) ,Computer Science - Machine Learning ,program transformations ,Theoretical computer science ,Exploit ,Computer science ,Inference ,02 engineering and technology ,010501 environmental sciences ,computer.software_genre ,01 natural sciences ,Machine Learning (cs.LG) ,Robustness (computer science) ,0202 electrical engineering, electronic engineering, information engineering ,0105 earth and related environmental sciences ,computer.programming_language ,Computer Science - Programming Languages ,Memory hierarchy ,Artificial neural network ,Program transformation ,020207 software engineering ,neural networks ,Compiler ,computer ,Programming Languages (cs.PL) - Abstract
Improving the performance of deep neural networks (DNNs) is important to both the compiler and neural architecture search (NAS) communities. Compilers apply program transformations in order to exploit hardware parallelism and memory hierarchy. However, legality concerns mean they fail to exploit the natural robustness of neural networks. In contrast, NAS techniques mutate networks by operations such as the grouping or bottlenecking of convolutions, exploiting the resilience of DNNs. In this work, we express such neural architecture operations as program transformations whose legality depends on a notion of representational capacity. This allows them to be combined with existing transformations into a unified optimization framework. This unification allows us to express existing NAS operations as combinations of simpler transformations. Crucially, it allows us to generate and explore new tensor convolutions. We prototyped the combined framework in TVM and were able to find optimizations across different DNNs, that significantly reduce inference time - over 3$\times$ in the majority of cases. Furthermore, our scheme dramatically reduces NAS search time. Code is available at~\href{https://github.com/jack-willturner/nas-as-program-transformation-exploration}{this https url}.
- Published
- 2021
- Full Text
- View/download PDF
7. Software Obfuscation with Non-Linear Mixed Boolean-Arithmetic Expressions
- Author
-
Jing Li, Dongpeng Xu, Weijie Feng, Qilong Zheng, and Binbin Liu
- Subjects
Obfuscation (software) ,Scheme (programming language) ,Transformation (function) ,Computer science ,Program transformation ,Pattern matching ,Arithmetic ,Bitwise operation ,computer ,Program synthesis ,Expression (mathematics) ,computer.programming_language - Abstract
Mixed Boolean-Arithmetic (MBA) expression mixes bitwise operations (e.g., AND, OR, and NOT) and arithmetic operations (e.g., ADD and IMUL). It enables a semantic-preserving program transformation to convert a simple expression to a difficult-to-understand but equivalent form. MBA expression has been widely adopted as a highly effective and low-cost obfuscation scheme. However, state-of-the-art deobfuscation research proposes substantial challenges to the MBA obfuscation technique. Attacking methods such as bit-blasting, pattern matching, program synthesis, deep learning, and mathematical transformation can successfully simplify specific categories of MBA expressions. Existing MBA obfuscation must be enhanced to overcome these emerging challenges.
- Published
- 2021
- Full Text
- View/download PDF
8. Understanding type changes in Java
- Author
-
Nikolaos Tsantalis, Ameya Ketkar, and Danny Dig
- Subjects
Java ,business.industry ,Computer science ,Concurrency ,Maintainability ,Program transformation ,020207 software engineering ,02 engineering and technology ,Commit ,Automation ,Empirical research ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Software engineering ,business ,computer ,Software evolution ,computer.programming_language - Abstract
Developers frequently change the type of a program element and update all its references for performance, security, concurrency,library migration, or better maintainability. Despite type changes being a common program transformation, it is the least automated and the least studied. With this knowledge gap, researchers miss opportunities to improve the state of the art in automation for software evolution, tool builders do not invest resources where automation is most needed, language and library designers can-not make informed decisions when introducing new types, and developers fail to use common practices when changing types. To fill this gap, we present the first large-scale and most fine-grained empirical study on type changes in Java. We develop state-of-the-art tools to statically mine 297,543 type changes and their subsequent code adaptations from a diverse corpus of 129 Java projects containing 416,652 commits. With this rich data set we answer research questions about the practice of type changes. Among others, we found that type changes are actually more common than renaming,but the current research and tools for type changes are inadequate.Based on our extensive and reliable data, we present actionable,empirically-justified implications.
- Published
- 2020
- Full Text
- View/download PDF
9. Metamodels and Category Theory in the Transformation of Semi-structured Data
- Author
-
Damián Emilio Gibaja-Romero and Rosa-Maria Canton-Croda
- Subjects
Theoretical computer science ,Computer science ,Program transformation ,020207 software engineering ,02 engineering and technology ,Directed graph ,Data modeling ,Abstraction (mathematics) ,Unified Modeling Language ,Data model ,Mathematics::Category Theory ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Semi-structured data ,Category theory ,Categorical variable ,computer ,computer.programming_language - Abstract
Models’ transformations involve code abstraction and program description, i.e., models’ transformations (MTs) operate in a more diverse set of artifacts than program transformation. Note that MTs allow programmers to link different structures, as Category Theory does for Mathematics, through recognizing similar features and properties. In this paper, we show that Category Theory can be used to describe MTs. Specifically, we propose a categorical framework for transforming a semi-structured data model, an OEM database, into a model of structured data, in UML language. This categorical approach allows us to establish a bridge between such models and the categories of simple and directed graphs, which makes it possible to apply the features of such categories to manage databases.
- Published
- 2020
- Full Text
- View/download PDF
10. Distilling Programs to Prove Termination
- Author
-
Geoff W. Hamilton
- Subjects
FOS: Computer and information sciences ,Proof by infinite descent ,Computer Science - Logic in Computer Science ,Theoretical computer science ,Computer science ,F.3.1 ,D.2.4 ,Program transformation ,Function (mathematics) ,Logic in Computer Science (cs.LO) ,Ranking (information retrieval) ,Undecidable problem ,Set (abstract data type) ,Transition system ,Turing ,computer ,computer.programming_language - Abstract
The problem of determining whether or not any program terminates was shown to be undecidable by Turing, but recent advances in the area have allowed this information to be determined for a large class of programs. The classic method for deciding whether a program terminates dates back to Turing himself and involves finding a ranking function that maps a program state to a well-order, and then proving that the result of this function decreases for every possible program transition. More recent approaches to proving termination have involved moving away from the search for a single ranking function and toward a search for a set of ranking functions; this set is a choice of ranking functions and a disjunctive termination argument is used. In this paper, we describe a new technique for determining whether programs terminate. Our technique is applied to the output of the distillation program transformation that converts programs into a simplified form called distilled form. Programs in distilled form are converted into a corresponding labelled transition system and termination can be demonstrated by showing that all possible infinite traces through this labelled transition system would result in an infinite descent of well-founded data values. We demonstrate our technique on a number of examples, and compare it to previous work., In Proceedings VPT/HCVS 2020, arXiv:2008.02483. This work owes a lot to the input of Neil Jones, who provided many useful insights and ideas on the subject matter presented here
- Published
- 2020
11. Enforcing Control Flow Confidentiality with SGX
- Author
-
Xiaoyu Zhang, Yongzhi Wang, and Yu Zou
- Subjects
010302 applied physics ,Java ,business.industry ,Computer science ,Program transformation ,Cloud computing ,02 engineering and technology ,Computer security ,computer.software_genre ,01 natural sciences ,020202 computer hardware & architecture ,Obfuscation (software) ,Control flow ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Information system ,Overhead (computing) ,Confidentiality ,business ,computer ,computer.programming_language - Abstract
When a program is executed on a untrusted cloud, the confidentiality of the program logic and related control flow variables should be protected. To obtain this goal, control flow obfuscation can be used. However, previous work has not been effective in terms of performance overhead and security. In this paper, we propose E-CFHider, a hardware-based method to protect the confidentiality of logics and variables involved in control flow. By using the Intel SGX technology and program transformation, we store the control flow variables and execute statements related to those variables in the trusted execution environment, i.e., the SGX enclave. We found this method can better protect the confidentiality of control flow and achieve acceptable performance overhead.
- Published
- 2020
- Full Text
- View/download PDF
12. Tailoring programs for static analysis via program transformation
- Author
-
Claire Le Goues and Rijnard van Tonder
- Subjects
Black box (phreaking) ,Java ,business.industry ,Programming language ,Computer science ,Software development ,Program transformation ,020207 software engineering ,Usability ,02 engineering and technology ,Static analysis ,computer.software_genre ,Program analysis ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,False positive paradox ,business ,computer ,computer.programming_language - Abstract
Static analysis is a proven technique for catching bugs during software development. However, analysis tooling must approximate, both theoretically and in the interest of practicality. False positives are a pervading manifestation of such approximations---tool configuration and customization is therefore crucial for usability and directing analysis behavior. To suppress false positives, developers readily disable bug checks or insert comments that suppress spurious bug reports. Existing work shows that these mechanisms fall short of developer needs and present a significant pain point for using or adopting analyses. We draw on the insight that an analysis user always has one notable ability to influence analysis behavior regardless of analyzer options and implementation: modifying their program. We present a new technique for automated, generic, and temporary code changes that tailor to suppress spurious analysis errors. We adopt a rule-based approach where simple, declarative templates describe general syntactic changes for code patterns that are known to be problematic for the analyzer. Our technique promotes program transformation as a general primitive for improving the fidelity of analysis reports (we treat any given analyzer as a black box). We evaluate using five different static analyzers supporting three different languages (C, Java, and PHP) on large, real world programs (up to 800KLOC). We show that our approach is effective in sidestepping long-standing and complex issues in analysis implementations.
- Published
- 2020
- Full Text
- View/download PDF
13. PASAPTO: Policy-aware Security and Performance Trade-off Analysis--Computation on Encrypted Data with Restricted Leakage
- Author
-
Jonas Janneck, Florian Kerschbaum, Nikolas Kratzschmar, Jarn Kussmaul, Andreas Fischer, and Eric Bodden
- Subjects
Optimization problem ,Java ,business.industry ,Computer science ,Decision tree ,Program transformation ,020206 networking & telecommunications ,020207 software engineering ,Java bytecode ,Plaintext ,02 engineering and technology ,Encryption ,Control flow ,Computer engineering ,0202 electrical engineering, electronic engineering, information engineering ,business ,computer ,computer.programming_language - Abstract
This work considers the trade-off between security and performance when revealing partial information about encrypted data computed on. The focus of our work is on information revealed through control flow side-channels when executing programs on encrypted data. We use quantitative information flow to measure security, running time to measure performance and program transformation techniques to alter the trade-off between the two. Combined with information flow policies, we perform a policy-aware security and performance trade-off (PASAPTO) analysis. We formalize the problem of PASAPTO analysis as an optimization problem, prove the NPhardness of the corresponding decision problem and present two algorithms solving it heuristically.We implemented our algorithms and combined them with the Dataflow Authentication (DFAuth) approach for outsourcing sensitive computations. Our DFAuth Trade-off Analyzer (DFATA) takes Java Bytecode operating on plaintext data and an associated information flow policy as input. It outputs semantically equivalent program variants operating on encrypted data which are policy-compliant and approximately Pareto-optimal with respect to leakage and performance. We evaluated DFATA in a commercial cloud environment using Java programs, e.g., a decision tree program performing machine learning on medical data. The decision tree variant with the worst performance is 357% slower than the fastest variant. Leakage varies between 0% and 17% of the input.
- Published
- 2020
- Full Text
- View/download PDF
14. D-Goldilocks: Automatic Redistribution of Remote Functionalities for Performance and Efficiency
- Author
-
Kijin An and Eli Tilevich
- Subjects
Offset (computer science) ,business.industry ,Computer science ,Distributed computing ,Program transformation ,020206 networking & telecommunications ,020207 software engineering ,02 engineering and technology ,JavaScript ,computer.software_genre ,Software ,Code refactoring ,Goldilocks principle ,0202 electrical engineering, electronic engineering, information engineering ,Granularity ,Latency (engineering) ,business ,computer ,computer.programming_language - Abstract
Distributed applications enhance their execution by using remote resources. However, distributed execution incurs communication, synchronization, fault-handling, and security overheads. If these overheads are not offset by the yet larger execution enhancement, distribution becomes counterproductive. For maximum benefits, the distribution's granularity cannot be too fine or too crude; it must be just right. In this paper, we present a novel approach to re-architecting distributed applications, whose distribution granularity has turned ill-conceived. To adjust the distribution of such applications, our approach automatically reshapes their remote invocations to reduce aggregate latency and resource consumption. To that end, our approach insources a remote functionality for local execution, splits it into separate functions to profile their performance, and determines the optimal redistribution based on a cost function. Redistribution strategies combine separate functions into single remotely invocable units. To automate all the required program transformations, our approach introduces a series of domain-specific automatic refactorings. We have concretely realized our approach as an analysis and automatic program transformation infrastructure for the important domain of full-stack JavaScript applications, and evaluated its value, utility, and performance on a series of real-world cross-platform mobile apps. Our evaluation results indicate that our approach can become a useful tool for software developers charged with the challenges of re-architecting distributed applications.
- Published
- 2020
- Full Text
- View/download PDF
15. Stacked borrows: an aliasing model for Rust
- Author
-
Derek Dreyer, Hoang-Hai Dang, Ralf Jung, and Jeehoon Kang
- Subjects
010302 applied physics ,Pointer aliasing ,Programming language ,Computer science ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,01 natural sciences ,Alias analysis ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Compiler ,Memory model ,Aliasing (computing) ,Safety, Risk, Reliability and Quality ,computer ,Software ,Undefined behavior ,Rust (programming language) ,computer.programming_language - Abstract
Type systems are useful not just for the safety guarantees they provide, but also for helping compilers generate more efficient code by simplifying important program analyses. In Rust, the type system imposes a strict discipline on pointer aliasing, and it is an express goal of the Rust compiler developers to make use of that alias information for the purpose of program optimizations that reorder memory accesses. The problem is that Rust also supports unsafe code, and programmers can write unsafe code that bypasses the usual compiler checks to violate the aliasing discipline. To strike a balance between optimizations and unsafe code, the language needs to provide a set of rules such that unsafe code authors can be sure, if they are following these rules, that the compiler will preserve the semantics of their code despite all the optimizations it is doing. In this work, we propose Stacked Borrows , an operational semantics for memory accesses in Rust. Stacked Borrows defines an aliasing discipline and declares programs violating it to have undefined behavior , meaning the compiler does not have to consider such programs when performing optimizations. We give formal proofs (mechanized in Coq) showing that this rules out enough programs to enable optimizations that reorder memory accesses around unknown code and function calls, based solely on intraprocedural reasoning. We also implemented this operational model in an interpreter for Rust and ran large parts of the Rust standard library test suite in the interpreter to validate that the model permits enough real-world unsafe Rust code.
- Published
- 2020
- Full Text
- View/download PDF
16. Seminaïve evaluation for a higher-order functional language
- Author
-
Neel Krishnaswami, Michael Arntzenius, Krishnaswami, Neel [0000-0003-2838-5865], and Apollo - University of Cambridge Repository
- Subjects
Evaluation strategy ,Functional programming ,Datalog ,Theoretical computer science ,Computer science ,Program transformation ,Order (ring theory) ,020207 software engineering ,02 engineering and technology ,Distinctive feature ,Transformation (function) ,TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES ,020204 information systems ,incremental computation ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,seminaive evaluation ,functional languages ,Safety, Risk, Reliability and Quality ,Datafun ,computer ,Software ,relational languages ,computer.programming_language - Abstract
© 2020 Copyright held by the owner/author(s). One of the workhorse techniques for implementing bottom-up Datalog engines is seminaïve evaluation. This optimization improves the performance of Datalog's most distinctive feature: recursively defined predicates. These are computed iteratively, and under a naïve evaluation strategy, each iteration recomputes all previous values. Seminaïve evaluation computes a safe approximation of the difference between iterations. This can asymptotically improve the performance of Datalog queries. Seminaïve evaluation is defined partly as a program transformation and partly as a modified iteration strategy, and takes advantage of the first-order nature of Datalog code. This paper extends the seminaïve transformation to higher-order programs written in the Datafun language, which extends Datalog with features like first-class relations, higher-order functions, and datatypes like sum types.
- Published
- 2020
17. Semi-inversion of Conditional Constructor Term Rewriting Systems
- Author
-
Robert Glück and Maja Hanne Kirkeby
- Subjects
050101 languages & linguistics ,Functional programming ,Computer science ,Programming language ,Heuristic ,05 social sciences ,Program transformation ,02 engineering and technology ,Term (logic) ,computer.software_genre ,Prolog ,Inversion (linguistics) ,0202 electrical engineering, electronic engineering, information engineering ,Programming paradigm ,Computer Science::Programming Languages ,020201 artificial intelligence & image processing ,0501 psychology and cognitive sciences ,Rewriting ,computer ,computer.programming_language - Abstract
Inversion is an important and useful program transformation and has been studied in various programming language paradigms. Semi-inversion is more general than just swapping the input and output of a program; instead, parts of the input and output can be freely swapped. In this paper, we present a polyvariant semi-inversion algorithm for conditional constructor term rewriting systems. These systems can model logic and functional languages, which have the advantage that semi-inversion, as well as partial and full inversion, can be studied across different programming paradigms. The semi-inverter makes use of local inversion and a simple but effective heuristic and is proven to be correct. A Prolog implementation is applied to several problems, including inversion of a simple encrypter and of a program inverter for a reversible language.
- Published
- 2020
- Full Text
- View/download PDF
18. Backpropagation in the Simply Typed Lambda-Calculus with Linear Negation
- Author
-
Damiano Mazza, Aloïs Brunel, Michele Pagani, Mazza, Damiano, Deepomatic, Centre National de la Recherche Scientifique (CNRS), and Université Paris Diderot - Paris 7 (UPD7)
- Subjects
FOS: Computer and information sciences ,Computer Science - Logic in Computer Science ,Computer Science - Machine Learning ,Theoretical computer science ,[INFO.INFO-LO] Computer Science [cs]/Logic in Computer Science [cs.LO] ,Computer science ,Automatic differentiation ,0102 computer and information sciences ,02 engineering and technology ,01 natural sciences ,Machine Learning (cs.LG) ,0202 electrical engineering, electronic engineering, information engineering ,Lambda-calculus ,Safety, Risk, Reliability and Quality ,computer.programming_language ,Computer Science - Programming Languages ,[INFO.INFO-PL]Computer Science [cs]/Programming Languages [cs.PL] ,Simply typed lambda calculus ,Artificial neural network ,[INFO.INFO-LO]Computer Science [cs]/Logic in Computer Science [cs.LO] ,Program transformation ,020207 software engineering ,Linear Logic ,Linear logic ,Backpropagation ,Logic in Computer Science (cs.LO) ,[INFO.INFO-PL] Computer Science [cs]/Programming Languages [cs.PL] ,010201 computation theory & mathematics ,Combinatory logic ,Lambda calculus ,Differentiable Programming ,computer ,Software ,Programming Languages (cs.PL) - Abstract
Backpropagation is a classic automatic differentiation algorithm computing the gradient of functions specified by a certain class of simple, first-order programs, called computational graphs. It is a fundamental tool in several fields, most notably machine learning, where it is the key for efficiently training (deep) neural networks. Recent years have witnessed the quick growth of a research field called differentiable programming, the aim of which is to express computational graphs more synthetically and modularly by resorting to actual programming languages endowed with control flow operators and higher-order combinators, such as map and fold. In this paper, we extend the backpropagation algorithm to a paradigmatic example of such a programming language: we define a compositional program transformation from the simply-typed lambda-calculus to itself augmented with a notion of linear negation, and prove that this computes the gradient of the source program with the same efficiency as first-order backpropagation. The transformation is completely effect-free and thus provides a purely logical understanding of the dynamics of backpropagation., Comment: 27 pages
- Published
- 2020
19. Witnessing Secure Compilation
- Author
-
Kedar S. Namjoshi and Lucas M. Tabajara
- Subjects
Scheme (programming language) ,050101 languages & linguistics ,Property (philosophy) ,Programming language ,Computer science ,05 social sciences ,Process (computing) ,Optimizing compiler ,Program transformation ,02 engineering and technology ,computer.software_genre ,Automaton ,Bundle ,0202 electrical engineering, electronic engineering, information engineering ,Computer Science::Programming Languages ,020201 artificial intelligence & image processing ,0501 psychology and cognitive sciences ,Compiler ,computer ,Computer Science::Cryptography and Security ,computer.programming_language - Abstract
Compiler optimizations may break or weaken the security properties of a source program. This work develops a translation validation methodology for secure compilation. A security property is expressed as an automaton operating over a bundle of program traces. A refinement proof scheme derived from a property automaton guarantees that the associated security property is preserved by a program transformation. This generalizes known refinement methods that apply only to specific security properties. In practice, the refinement relations (“security witnesses”) are generated during compilation and validated independently with a refinement checker. This process is illustrated for common optimizations. Crucially, it is not necessary to formally verify the compiler implementation, which is infeasible for production compilers.
- Published
- 2020
- Full Text
- View/download PDF
20. One tool, many languages: language-parametric transformation with incremental parametric syntax
- Author
-
James Koppel, Armando Solar-Lezama, and Varot Premtoon
- Subjects
FOS: Computer and information sciences ,D.3.4 ,D.3.1 ,Computer science ,02 engineering and technology ,computer.software_genre ,JavaScript ,01 natural sciences ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Safety, Risk, Reliability and Quality ,computer.programming_language ,010302 applied physics ,Computer Science - Programming Languages ,Syntax (programming languages) ,Programming language ,Program transformation ,020207 software engineering ,Construct (python library) ,Python (programming language) ,Code refactoring ,Haskell ,Compiler ,computer ,Software ,Programming Languages (cs.PL) - Abstract
We present a new approach for building source-to-source transformations that can run on multiple programming languages, based on a new way of representing programs called incremental parametric syntax. We implement this approach in Haskell in our Cubix system, and construct incremental parametric syntaxes for C, Java, JavaScript, Lua, and Python. We demonstrate a whole-program refactoring tool that runs on all of them, along with three smaller transformations that each run on several. Our evaluation shows that (1) once a transformation is written, little work is required to configure it for a new language (2) transformations built this way output readable code which preserve the structure of the original, according to participants in our human study, and (3) our transformations can still handle language corner-cases, as validated on compiler test suites.
- Published
- 2018
- Full Text
- View/download PDF
21. Improvements in a call-by-need functional core language: Common subexpression elimination and resource preserving translations
- Author
-
David Sabel and Manfred Schmidt-Schauß
- Subjects
Functional programming ,Theoretical computer science ,Simply typed lambda calculus ,Semantics (computer science) ,Computer science ,Program transformation ,0102 computer and information sciences ,02 engineering and technology ,01 natural sciences ,Operational semantics ,TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES ,010201 computation theory & mathematics ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,0202 electrical engineering, electronic engineering, information engineering ,Computer Science::Programming Languages ,020201 artificial intelligence & image processing ,Common subexpression elimination ,Lambda calculus ,computer ,Typed lambda calculus ,Software ,computer.programming_language - Abstract
An improvement is a correct program transformation that optimizes the program, where the criterion is that the number of computation steps until a value is obtained is not strictly increased in any context. This paper investigates improvements in both – an untyped and a polymorphically typed variant – of a call-by-need lambda calculus with letrec, case, constructors and seq. Besides showing that several local transformations are optimizations, a main result of this paper is a proof that common subexpression elimination is correct and an improvement, which proves a conjecture and thus closes a gap in the improvement theory of Moran and Sands. The improvement relation used in this paper is generic in which essential computation steps are counted and thus the obtained results apply for several notions of improvement. Besides the small-step operational semantics, also an abstract machine semantics is considered for counting computation steps. We show for several length measures that the call-by-need calculus of Moran and Sands and our calculus are equivalent.
- Published
- 2017
- Full Text
- View/download PDF
22. Transforming Coroutining Logic Programs into Equivalent CHR Programs
- Author
-
Danny De Schreye, Vincent Nys, Lisitsa, Alexei, Nemytykh, Andrei P, Proietti, Maurizio, and Nemytykh, Andrei
- Subjects
FOS: Computer and information sciences ,CHR ,compiling control ,program transformation ,Computer Science - Logic in Computer Science ,Selection (relational algebra) ,Computer science ,coroutines ,computer.software_genre ,Porting ,lcsh:QA75.5-76.95 ,Prolog ,logic programming ,Program analysis ,Control (linguistics) ,Implementation ,computer.programming_language ,D.1.6 ,D.3.2 ,D.3.3 ,Computer Science - Programming Languages ,Programming language ,lcsh:Mathematics ,Static analysis ,lcsh:QA1-939 ,Partial deduction ,Logic in Computer Science (cs.LO) ,TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES ,lcsh:Electronic computers. Computer science ,computer ,Programming Languages (cs.PL) - Abstract
We extend a technique called Compiling Control. The technique transforms coroutining logic programs into logic programs that, when executed under the standard left-to-right selection rule (and not using any delay features) have the same computational behavior as the coroutining program. In recent work, we revised Compiling Control and reformulated it as an instance of Abstract Conjunctive Partial Deduction. This work was mostly focused on the program analysis performed in Compiling Control. In the current paper, we focus on the synthesis of the transformed program. Instead of synthesizing a new logic program, we synthesize a CHR(Prolog) program which mimics the coroutining program. The synthesis to CHR yields programs containing only simplification rules, which are particularly amenable to certain static analysis techniques. The programs are also more concise and readable and can be ported to CHR implementations embedded in other languages than Prolog., In Proceedings VPT 2017, arXiv:1708.06887
- Published
- 2017
- Full Text
- View/download PDF
23. A Versatile, Sound Tool for Simplifying Definitions
- Author
-
Alessandro Coglio, Eric Whitman Smith, and Matt Kaufmann
- Subjects
FOS: Computer and information sciences ,Guard (information security) ,geography ,Computer Science - Programming Languages ,geography.geographical_feature_category ,Computer Science - Artificial Intelligence ,Computer science ,lcsh:Mathematics ,media_common.quotation_subject ,Program transformation ,ACL2 ,lcsh:QA1-939 ,Mathematical proof ,lcsh:QA75.5-76.95 ,Artificial Intelligence (cs.AI) ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Calculus ,lcsh:Electronic computers. Computer science ,Function (engineering) ,computer ,Sound (geography) ,Programming Languages (cs.PL) ,media_common ,computer.programming_language - Abstract
We present a tool, simplify-defun, that transforms the definition of a given function into a simplified definition of a new function, providing a proof checked by ACL2 that the old and new functions are equivalent. When appropriate it also generates termination and guard proofs for the new function. We explain how the tool is engineered so that these proofs will succeed. Examples illustrate its utility, in particular for program transformation in synthesis and verification., Comment: In Proceedings ACL2Workshop 2017, arXiv:1705.00766
- Published
- 2017
- Full Text
- View/download PDF
24. Automatic Optimization of Python Skeletal Parallel Programs
- Author
-
Jolan Philippe, Frédéric Loulergue, Northern Arizona University [Flagstaff], Laboratoire d'Informatique Fondamentale d'Orléans (LIFO), Université d'Orléans (UO)-Institut National des Sciences Appliquées - Centre Val de Loire (INSA CVL), Institut National des Sciences Appliquées (INSA)-Institut National des Sciences Appliquées (INSA), Laboratoire des Sciences du Numérique de Nantes (LS2N), IMT Atlantique Bretagne-Pays de la Loire (IMT Atlantique), Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)-Université de Nantes - UFR des Sciences et des Techniques (UN UFR ST), Université de Nantes (UN)-Université de Nantes (UN)-École Centrale de Nantes (ECN)-Centre National de la Recherche Scientifique (CNRS), Université de Nantes - UFR des Sciences et des Techniques (UN UFR ST), Université de Nantes (UN)-Université de Nantes (UN)-École Centrale de Nantes (ECN)-Centre National de la Recherche Scientifique (CNRS)-IMT Atlantique Bretagne-Pays de la Loire (IMT Atlantique), and Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)
- Subjects
[INFO.INFO-PL]Computer Science [cs]/Programming Languages [cs.PL] ,Computer science ,Programming language ,Parallel algorithm ,Program transformation ,020207 software engineering ,02 engineering and technology ,Python (programming language) ,Data structure ,computer.software_genre ,020202 computer hardware & architecture ,Map ,0202 electrical engineering, electronic engineering, information engineering ,Algorithmic skeleton ,Sequential function ,Programmer ,computer ,computer.programming_language - Abstract
International audience; Skeletal parallelism is a model of parallelism where parallel constructs are provided to the programmer as usual patterns of parallel algorithms. High-level skeleton libraries often offer a global view of programs instead of the common Single Program Multiple Data view in parallel programming. A program is written as a sequential program but operates on parallel data structures. Most of the time, skeletons on a parallel data structure have counterparts on a sequential data structure. For example, the map function that applies a given function to all the elements of a sequential collection (e.g., a list) has a map skeleton counterpart that applies a sequential function to all the elements of a distributed collection. Two of the challenges a programmer faces when using a skeleton library that provides a wide variety of skeletons are: which are the skeletons to use, and how to compose them? These design decisions may have a large impact on the performance of the parallel programs. However, skeletons, especially when they do not mutate the data structure they operate on, but are rather implemented as pure functions , possess algebraic properties that allow to transform compositions of skeletons into more efficient compositions of skeletons. In this paper, we present such an automatic transformation framework for the Python skeleton library PySke and evaluate it on several example applications.
- Published
- 2019
- Full Text
- View/download PDF
25. Gerenuk
- Author
-
Miryung Kim, Christian Navasca, Brian Demsky, Guoqing Harry Xu, Cheng Cai, Shan Lu, and Khanh Nguyen
- Subjects
010302 applied physics ,Computer science ,Scala ,Serialization ,Speculative execution ,Byte ,Program transformation ,02 engineering and technology ,Parallel computing ,computer.software_genre ,01 natural sciences ,Data type ,020202 computer hardware & architecture ,Runtime system ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Compiler ,computer ,computer.programming_language - Abstract
Big Data systems are typically implemented in object-oriented languages such as Java and Scala due to the quick development cycle they provide. These systems are executed on top of a managed runtime such as the Java Virtual Machine (JVM), which requires each data item to be represented as an object before it can be processed. This representation is the direct cause of many kinds of severe inefficiencies. We developed Gerenuk, a compiler and runtime that aims to enable a JVM-based data-parallel system to achieve near-native efficiency by transforming a set of statements in the system for direct execution over inlined native bytes. The key insight leading to Gerenuk's success is two-fold: (1) analytics workloads often use immutable and confined data types. If we speculatively optimize the system and user code with this assumption, the transformation can be made tractable. (2) The flow of data starts at a deserialization point where objects are created from a sequence of native bytes and ends at a serialization point where they are turned back into a byte sequence to be sent to the disk or network. This flow naturally defines a speculative execution region (SER) to be transformed. Gerenuk compiles a SER speculatively into a version that can operate directly over native bytes that come from the disk or network. The Gerenuk runtime aborts the SER execution upon violations of the immutability and confinement assumption and switches to the slow path by deserializing the bytes and re-executing the original SER. Our evaluation on Spark and Hadoop demonstrates promising results.
- Published
- 2019
- Full Text
- View/download PDF
26. Protecting Security-Sensitive Data Using Program Transformation and Intel SGX
- Author
-
Yongzhi Wang and Anter Faree
- Subjects
Guard (information security) ,Java ,business.industry ,Computer science ,Program transformation ,Cloud computing ,computer.software_genre ,Upload ,Software ,Trusted computing base ,Operating system ,business ,computer ,computer.programming_language - Abstract
Cloud computing allows clients uploading their sensitive data to the public cloud and perform sensitive computations in those untrusted areas, which drives to possible violations to the confidentiality of client sensitive data. By leveraging the program transformation and the Intel Software Guard Extension (SGX) technology, our proposed solution hides the security-sensitive statements inside an SGX enclave. Some former works have shown that most applications can run in their entirety inside trusted areas such as SGX enclaves, and that leads to a large trusted computing base (TCB). As a result, we analyze a case study in which we partition an application and use an SGX enclave to protect only security-sensitive statements, thus obtaining a smaller TCB. In this paper, we describe our case study that secures applications written in Java using Intel SGX technology. We analyzed our proposed solution using concrete examples to show how the confidentiality of security-sensitive variables is protected.
- Published
- 2019
- Full Text
- View/download PDF
27. Java Stream Fusion
- Author
-
Francisco Ribeiro, Alberto Pardo, João Saraiva, and Universidade do Minho
- Subjects
Program Fusion ,Object-oriented programming ,Fusion ,Functional programming ,Science & Technology ,Java ,Computer science ,Programming language ,Functional Programming ,Program transformation ,020207 software engineering ,0102 computer and information sciences ,02 engineering and technology ,computer.software_genre ,01 natural sciences ,Set (abstract data type) ,Object-Oriented Programming ,010201 computation theory & mathematics ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,computer ,Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática ,computer.programming_language ,Program fusion - Abstract
In this paper, we show how stream fusion, a program transformation technique used in functional programming, can be adapted for an Object-Oriented setting. This makes it possible to have more Stream operators than the ones currently provided by the Java Stream API. The addition of more operators allows for a greater deal of expressiveness. To this extent, we show how these operators are incorporated in the stream setting. Furthermore, we also demonstrate how a specific set of optimizations eliminates overheads and produces equivalent code in the form of for loops. In this way, programmers are relieved from the burden of writing code in such a cumbersome style, thus allowing for a more declarative and intuitive programming approach., This work is financed by the ERDF European Regional Development Fund through the Operational Programme for Competitiveness and Internationalisation - COMPETE 2020 Programme and by National Funds through the Portuguese funding agency, FCT - Fundação para a Ciência e a Tecnologia within project POCI-01-0145-FEDER016718.
- Published
- 2019
- Full Text
- View/download PDF
28. Automatically Generating Fix Suggestions in Response to Static Code Analysis Warnings
- Author
-
Gustavo Pinto, Carlo A. Furia, Diego Marcilio, and Rodrigo Bonifácio
- Subjects
Java ,business.industry ,Computer science ,media_common.quotation_subject ,Program transformation ,020207 software engineering ,Static program analysis ,02 engineering and technology ,Automation ,Variety (cybernetics) ,Software ,Empirical research ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Quality (business) ,Software engineering ,business ,computer ,media_common ,computer.programming_language - Abstract
Static code analysis tools such as FindBugs and SonarQube are widely used on open-source and industrial projects to detect a variety of issues that may negatively affect the quality of software. Despite these tools' popularity and high level of automation, several empirical studies report that developers normally fix only a small fraction (typically, less than 10% [1]) of the reported issues—so-called "warnings". If these analysis tools could also automatically provide suggestions on how to fix the issues that trigger some of the warnings, their feedback would become more actionable and more directly useful to developers. In this work, we investigate whether it is feasible to automatically generate fix suggestions for common warnings issued by static code analysis tools, and to what extent developers are willing to accept such suggestions into the codebases they're maintaining. To this end, we implemented a Java program transformation technique that fixes 11 distinct rules checked by two well-known static code analysis tools (SonarQube and SpotBugs). Fix suggestions are generated automatically based on templates, which are instantiated in a way that removes the source of the warnings; templates for some rules are even capable of producing multi-line patches. We submitted 38 pull requests, including 920 fixes generated automatically by our technique for various open-source Java projects, including the Eclipse IDE and both SonarQube and SpotBugs tools. At the time of writing, project maintainers accepted 84% of our fix suggestions (95% of them without any modifications). These results indicate that our approach to generating fix suggestions is feasible, and can help increase the applicability of static code analysis tools.
- Published
- 2019
- Full Text
- View/download PDF
29. Towards Constructing the SSA form using Reaching Definitions Over Dominance Frontiers
- Author
-
Abu Naser Masud and Federico Ciccozzi
- Subjects
Theoretical computer science ,Static single assignment form ,Computer science ,Program transformation ,Local variable ,020207 software engineering ,02 engineering and technology ,Program optimization ,Reaching definition ,computer.software_genre ,Global variable ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Compiler ,Perl ,computer ,computer.programming_language - Abstract
The Static Single Assignment (SSA) form is an intermediate representation used for the analysis and optimization of programs in modern compilers. The ϕ-function placement is the most computationally expensive part of converting any program into its SSA form. The most widely-used ϕ-function placement algorithms are based on computing dominance frontiers. However, this kind of algorithms works under the limiting assumption that all variables are defined at the beginning of the program, which is not the case for local variables. In this paper, we introduce an innovative algorithm based on computing reaching definitions, only assuming that global variables and formal parameters are defined at the beginning of the program. We implemented our algorithm and compared it to a well-known dominance frontiers-based algorithm in the Clang/LLVM compiler framework by performing experiments on a benchmarking suite for Perl. The results of our experiments show that, besides a few computationally expensive cases, our algorithm is fairly efficient, and most notably it produces up to 169% and on an average 74% fewer ϕ-functions than the reference dominance frontiers-based algorithm.
- Published
- 2019
- Full Text
- View/download PDF
30. Towards Generating Transformation Rules without Examples for Android API Replacement
- Author
-
Ferdian Thung, Hong Jin Kang, Lingxiao Jiang, and David Lo
- Subjects
Deprecation ,Software documentation ,Java ,Computer science ,business.industry ,Program transformation ,020207 software engineering ,02 engineering and technology ,Maintenance engineering ,Deprecated ,Software ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Android (operating system) ,Software engineering ,business ,computer ,computer.programming_language - Abstract
Deprecation of APIs in software libraries is common when library maintainers make changes to a library and will no longer support certain APIs in the future. When deprecation occurs, developers whose programs depend on the APIs need to replace the usages of the deprecated APIs sooner or later. Often times, software documentation specifies which new APIs the developers should use in place of a deprecated API. However, replacing the usages of a deprecated API remains a challenge since developers may not know exactly how to use the new APIs. The developers would first need to understand the API changes before they can replace the deprecated API correctly. Previous work has proposed an approach to assist developers in deprecatedAndroid API replacement by learning from examples. In this work, we also focus on Android APIs and propose an approach named No Example API Transformation (NEAT) to generate transformation rules that can assist developers in deprecatedAPI replacement even when code examples are not available (e.g., when the deprecation has happened recently). We have validated the effectiveness of NEATon generating transformation rules for deprecated Android APIs. Using NEAT, we can generate 37 transformation rules for 37 out of a selection of 100 deprecatedAPIs and have validated these rules to be correct.
- Published
- 2019
- Full Text
- View/download PDF
31. CFHider: Control Flow Obfuscation with Intel SGX
- Author
-
Yulong Shen, Yao Liu, Ke Cheng, Yongzhi Wang, Anter Faree, Yibo Yang, and Cuicui Su
- Subjects
Java ,business.industry ,Computer science ,Program transformation ,020206 networking & telecommunications ,Cloud computing ,02 engineering and technology ,computer.software_genre ,Software ,Control flow ,Obfuscation ,0202 electrical engineering, electronic engineering, information engineering ,Operating system ,020201 artificial intelligence & image processing ,business ,computer ,computer.programming_language - Abstract
When a program is executed on an untrusted cloud, the confidentiality of the program's logics needs to be protected. Control flow obfuscation is a direct approach to obtain this goal. However, existing methods in this direction cannot achieve both high confidentiality and low overhead. In this paper, we propose CFHider, a hardware-assisted method to protect the control flow confidentiality. By combining program transformation and Intel Software Guard Extension (SGX) technology, CFHider moves branch statement conditions to an opaque and trusted memory space, i.e., the enclave, thereby offering a guaranteed control flow confidentiality. Based on the design of CFHider, we developed a prototype system targeting on Java applications. Our analysis and experimental results indicate that CFHider is effective in protecting the control flow confidentiality and incurs a much reduced performance overhead than existing software-based solutions (by a factor of 8.8).
- Published
- 2019
- Full Text
- View/download PDF
32. OBLIVE: Seamless Code Obfuscation for Java Programs and Android Apps
- Author
-
Davide Pizzolotto, Mariano Ceccato, and Roberto Fellin
- Subjects
Reverse engineering ,Java ,business.industry ,Computer science ,End user ,Data obfuscation ,Mobile computing ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,Obfuscation (software) ,Code obfuscation ,0202 electrical engineering, electronic engineering, information engineering ,Malware ,Android (operating system) ,Software engineering ,business ,computer ,computer.programming_language - Abstract
Malicious reverse engineering is a problem when a program is delivered to the end users. In fact, an end user might try to understand the internals of the program, in order to elaborate an attack, tamper with the software and alter its behaviour. Code obfuscation represents a mitigation to these kind of malicious reverse engineering and tampering attacks, making programs harder to analyze (by a tool) and understand (by a human). In this paper, we present Oblive, a tool meant to support developers in applying code obfuscation to their programs. A developer is required to specify security requirements as single-line code annotations only. Oblive, then, reads annotations and applies state-of-the-art data and code obfuscation, namely xormask with opaque mask and java-to-native code, while the program is being compiled. Oblive is successfully applied both to plain Java programs and Android apps. Showcase videos are available for the code obfuscation part https://youtu.be/Bml-BkKP3CU and for the data obfuscation part https://youtu.be/zbizYVK42ps.
- Published
- 2019
- Full Text
- View/download PDF
33. Futures and promises in Haskell and Scala
- Author
-
Tamino Dauth and Martin Sulzmann
- Subjects
Record locking ,Futures and promises ,Computer science ,Programming language ,Scala ,Concurrency ,Program transformation ,Software transactional memory ,Context (language use) ,Haskell ,computer.software_genre ,computer ,computer.programming_language - Abstract
Futures and promises are a high-level concurrency construct to aid the user in writing scalable and correct asynchronous programs. We introduce a simple core language based on which we can derive a rich set of future and promise features. We discuss ways to implement the core features via shared-state concurrency making either use of Software Transactional Memory, an elementary lock-based primitive, or an atomic compare-and-swap operation. The approach has been fully implemented in Haskell and Scala. For both languages, we provide empirical evidence of the effectiveness of our method. We consider program transformations in the context of futures and promises and observe potential problems in existing Scala-based libraries.
- Published
- 2019
- Full Text
- View/download PDF
34. Efficiently implementing the copy semantics of MATLAB's arrays in JavaScript
- Author
-
Foley-BourgonVincent and HendrenLaurie
- Subjects
Computer science ,Programming language ,Leverage (statistics) ,Program transformation ,JavaScript ,MATLAB ,computer.software_genre ,Computer Graphics and Computer-Aided Design ,computer ,Software ,computer.programming_language - Abstract
Compiling MATLAB---a dynamic, array-based language---to JavaScript is an attractive proposal: the output code can be deployed on a platform used by billions and can leverage the countless hours that have gone into making JavaScript JIT engines fast. But before that can happen, the original MATLAB code must be properly translated, making sure to bridge the semantic gaps of the two languages. An important area where MATLAB and JavaScript differ is in their handling of arrays: for example, in MATLAB, arrays are one-indexed and writing at an index beyond the end of an array extends it; in JavaScript, typed arrays are zero-indexed and writing out of bounds is a no-op. A MATLAB-to-JavaScript compiler must address these mismatches. Another salient and pervasive difference between the two languages is the assignment of arrays to variables: in MATLAB, this operation has value semantics, while in JavaScript is has reference semantics. In this paper, we present MatJuice --- a source-to-source, ahead-of-time compiler back-end for MATLAB --- and how it deals efficiently with this last issue. We present an intra-procedural data-flow analysis to track where each array variable may point to and which variables are possibly aliased. We also present the associated copy insertion transformation that uses the points-to information to insert explicit copies when necessary. The resulting JavaScript program respects the MATLAB value semantics and we show that it performs fewer run-time copies than some alternative approaches.
- Published
- 2016
- Full Text
- View/download PDF
35. DangDone
- Author
-
Bihuan Chen, Xuandong Li, Lingzhang Wang, Lingyun Situ, Fengjuan Gao, Yang Liu, Yu Wang, and Jianhua Zhao
- Subjects
0301 basic medicine ,021110 strategic, defence & security studies ,Computer science ,0211 other engineering and technologies ,Spec# ,Program transformation ,02 engineering and technology ,Parallel computing ,03 medical and health sciences ,030104 developmental biology ,Software bug ,Dangling pointer ,TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS ,Pointer (computer programming) ,computer ,computer.programming_language ,Compile time - Abstract
Dangling pointers have become an important class of software bugs that can lead to use-after-free and double-free vulnerabilities. So far, only a few approaches have been proposed to protect against dangling pointers, while most of them suffer from high overhead. In this paper, we propose a lightweight approach, named DangDone, to eliminate dangling pointers at compile time. Built upon the root cause of a dangling pointer, i.e., a pointer and its aliases are not nullified but the memory area they point to is deallocated, DangDone realizes the protection by inserting an intermediate pointer between the pointers (i.e., a pointer and its aliases) and the memory area they point to. Hence, nullifying the intermediate pointer will nullify the pointer and its aliases, which mitigates the vulnerabilities caused by dangling pointers. Experimental results have demonstrated that DangDone can protect target programs (i.e., the SPEC CPU benchmarks and the programs with known CVEs) with negligible runtime overhead (i.e., around 1% on average).
- Published
- 2018
- Full Text
- View/download PDF
36. [Research Paper] Obfuscating Java Programs by Translating Selected Portions of Bytecode to Native Libraries
- Author
-
Davide Pizzolotto and Mariano Ceccato
- Subjects
Java ,Computer science ,Programming language ,Program comprehension ,Program transformation ,020207 software engineering ,Java bytecode ,02 engineering and technology ,computer.software_genre ,Bytecode ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,020201 artificial intelligence & image processing ,Compiler ,computer ,Machine code ,computer.programming_language - Abstract
Code obfuscation is a popular approach to turn program comprehension and analysis harder, with the aim of mitigating threats related to malicious reverse engineering and code tampering. However, programming languages that compile to high level bytecode (e.g., Java) can be obfuscated only to a limited extent. In fact, high level bytecode still contains high level relevant information that an attacker might exploit. In order to enable more resilient obfuscations, part of these programs might be implemented with programming languages (e.g., C) that compile to low level machine-dependent code. In fact, machine code contains and leaks less high level information and it enables more resilient obfuscations. In this paper, we present an approach to automatically translate critical sections of high level Java bytecode to C code, so that more effective obfuscations can be resorted to. Moreover, a developer can still work with a single programming language, i.e., Java.
- Published
- 2018
- Full Text
- View/download PDF
37. Verification and Application of Program Transformations
- Author
-
Horpácsi, Dániel
- Subjects
Graph rewriting ,Programming language ,Computer science ,business.industry ,Semantics (computer science) ,Software development ,Program transformation ,Erlang (programming language) ,computer.file_format ,computer.software_genre ,Code refactoring ,Executable ,business ,computer ,Formal verification ,computer.programming_language - Abstract
Program transformations and refactorings are essential elements in software development. From the early days of refactoring, tool support has emerged to provide effortless and trustworthy assistance for quality-improvement, behaviour-preserving transformations of programs. Both academia and industry have great interest in researching and developing static analysis based bug detection and trustworthy behaviour-preserving transformations. Although refactoring tools are getting better day by day, there is room for improvement both in terms of accuracy and reliability. This dissertation investigates definition and verification methods for program transformations, which can help us build more extensible, more trustworthy and widely applied transformations systems. To advance dynamic verification techniques, a novel notation for L-attribute grammars is introduced, and is given a meaning in terms of data generator functions, which can be used in various ways in property-based testing. The document presents a case study, a grammar for Erlang, and its use in testing an Erlang analysis and transformation system. To address static, formal verification of transformations, a refactoring programming language is proposed as the specification formalism for executable and semi-automatically verifiable refactoring definitions. The language is based on context-sensitive conditional term rewriting, strategy programming and refactoring schemes. Last but not least, as a special application of graph rewriting and tool-assisted program transformation, the dissertation discusses implementation of language pre-compilers in refactoring systems. With this method, a portable closure semantics was added to the Erlang programming language, enabling code migration.
- Published
- 2018
- Full Text
- View/download PDF
38. Mixed Precision Tuning with Salsa
- Author
-
Nasrine Damouche, Matthieu Martel, and Université de Perpignan Via Domitia - UPVD (FRANCE)
- Subjects
060201 languages & linguistics ,Computer science ,Mixed Precision ,Numerical Accuracy ,06 humanities and the arts ,02 engineering and technology ,Mixed precision ,Computational science ,Program Transformation ,Autre ,0602 languages and literature ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Floating-point Arithmetic ,computer ,SALSA ,computer.programming_language - Abstract
Precision tuning consists of finding the least floating-point formats enabling a program to compute some results with an accuracy requirement. In mixed precision, this problem has a huge combinatory since any value may have its own format. Precision tuning has given rise to the development of several tools that aim at guarantying a desired precision on the outputs of programs doing floating-point computations, by minimizing the initial, over-estimated, precision of the inputs and intermediary results. In this article, we present an extension of our tool for numerical accuracy, Salsa, which performs precision tuning. Originally, Salsa is a program transformation tool based on static analysis and which improves the accuracy of floating-point computations. We have extended Salsa with a precision tuning static analysis. We present experimental results showing the efficiency of this new feature as well as the additional gains that we obtain by performing Salsa’s program transformation before the precision tuning analysis. We experiment our tool on a set of programs coming from various domains like embedded systems and numerical analysis.
- Published
- 2018
39. Almost first-class language embedding: taming staged embedded DSLs
- Author
-
ChibaShigeru and ScherrMaximilian
- Subjects
Java ,Programming language ,Computer science ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,Computer Graphics and Computer-Aided Design ,Metaprogramming ,First class ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Embedding ,computer ,Software ,computer.programming_language - Abstract
Embedded domain-specific languages (EDSLs), inheriting a general-purpose language's features as well as look-and-feel, have traditionally been second-class or rather non-citizens in terms of host-language design. This makes sense when one regards them to be on the same level as traditional, non-EDSL library interfaces. However, this equivalence only applies to the simplest of EDSLs. In this paper we illustrate why this is detrimental when moving on to EDSLs that employ staging, i.e. program reification, by example of various issues that affect authors and users alike. We believe that if EDSLs are to be considered a reliable, language-like interface abstraction, they require exceptional attention and design scrutiny. Instead of unenforceable conventions, we advocate the acceptance of EDSLs as proper, i.e. almost first-class, citizens while retaining most advantages of pure embeddings. As a small step towards this goal, we present a pragmatic framework prototype for Java. It is based on annotations that explicate and document membership to explicit EDSL entities. In a nutshell, our framework identifies (annotated) method calls and field accesses as EDSL terms and dynamically constructs an abstract-syntax representation, which is eventually passed to a semantics-defining back end implemented by the EDSL author.
- Published
- 2015
- Full Text
- View/download PDF
40. Description and Optimization of Abstract Machines in a Dialect of Prolog
- Author
-
José F. Morales, Manuel V. Hermenegildo, and Manuel Carro
- Subjects
FOS: Computer and information sciences ,Computer science ,Semantics (computer science) ,0102 computer and information sciences ,02 engineering and technology ,computer.software_genre ,01 natural sciences ,Theoretical Computer Science ,Prolog ,Artificial Intelligence ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,Implementation ,computer.programming_language ,Informática ,Computer Science - Programming Languages ,D.1.6 ,D.3.4 ,Programming language ,D.3.3 ,Program transformation ,Abstract machine ,Bytecode ,Computational Theory and Mathematics ,010201 computation theory & mathematics ,Hardware and Architecture ,Virtual machine ,020201 artificial intelligence & image processing ,computer ,Software ,Programming Languages (cs.PL) - Abstract
In order to achieve competitive performance, abstract machines for Prolog and related languages end up being large and intricate, and incorporate sophisticated optimizations, both at the design and at the implementation levels. At the same time, efficiency considerations make it necessary to use low-level languages in their implementation. This makes them laborious to code, optimize, and, especially, maintain and extend. Writing the abstract machine (and ancillary code) in a higher-level language can help tame this inherent complexity. We show how the semantics of most basic components of an efficient virtual machine for Prolog can be described using (a variant of) Prolog. These descriptions are then compiled to C and assembled to build a complete bytecode emulator. Thanks to the high level of the language used and its closeness to Prolog, the abstract machine description can be manipulated using standard Prolog compilation and optimization techniques with relative ease. We also show how, by applying program transformations selectively, we obtain abstract machine implementations whose performance can match and even exceed that of state-of-the-art, highly-tuned, hand-crafted emulators., 56 pages, 46 figures, 5 tables, To appear in Theory and Practice of Logic Programming (TPLP)
- Published
- 2015
- Full Text
- View/download PDF
41. Detecting broken pointcuts using structural commonality and degree of interest
- Author
-
Awais Rashid, Raffi Khatchadourian, Takuya Watanabe, and Hidehiko Masuhara
- Subjects
Java ,Computer science ,media_common.quotation_subject ,Aspect-oriented programming ,Pointcut ,Context (language use) ,02 engineering and technology ,Software_PROGRAMMINGTECHNIQUES ,Symbolic execution ,computer.software_genre ,Task (project management) ,Software ,0502 economics and business ,0202 electrical engineering, electronic engineering, information engineering ,Quality (business) ,media_common ,computer.programming_language ,Eclipse ,050208 finance ,business.industry ,Programming language ,05 social sciences ,Program transformation ,020207 software engineering ,Extension (predicate logic) ,Software maintenance ,Degree of interest ,Data mining ,Software_PROGRAMMINGLANGUAGES ,Software engineering ,business ,computer ,Software evolution ,Scope (computer science) - Abstract
Pointcut fragility is a well-documented problem in Aspect-Oriented Programming; changes to the base-code can lead to join points incorrectly falling in or out of the scope of pointcuts. Deciding which pointcuts have broken due to base-code changes is a daunting venture, especially in large and complex systems. We present an automated approach that recommends pointcuts that are likely to require modification due to a particular base-code change, as well as ones that do not. Our hypothesis is that join points selected by a pointcut exhibit common structural characteristics. Patterns describing such commonality are used to recommend pointcuts that have potentially broken with a degree of confidence as the developer is typing. The approach is implemented as an extension to the popular Mylyn Eclipse IDE plug-in, which maintains focused contexts of entities relevant to the task at hand using a Degree of Interest (DOI) model. We show that it is accurate in revealing broken pointcuts by applying it to multiple versions of several open source projects and evaluating the quality of the recommendations produced against actual modifications. We found that our tool made broken pointcuts 2.14 times more interesting in the DOI model than unbroken ones, with a p-value under 0.1, indicating a significant difference in final DOI value between the two kinds of pointcuts (i.e., broken and unbroken).
- Published
- 2017
- Full Text
- View/download PDF
42. Search-based Tier Assignment for Optimising Offline Availability in Multi-tier Web Applications
- Author
-
Wolfgang De Meuter, Joeri De Koster, Coen De Roover, Laure Philips, Faculty of Sciences and Bioengineering Sciences, Software Languages Lab, and Informatics and Applied Informatics
- Subjects
FOS: Computer and information sciences ,program transformation ,Computer Science - Programming Languages ,business.industry ,Computer science ,Rich Internet application ,Search-based software engineering ,Program transformation ,Information security ,Recommender system ,JavaScript ,computer.software_genre ,Search-Based Software Engineering ,Web application ,Rich Internet Applications ,business ,Software engineering ,Programmer ,computer ,Programming Languages (cs.PL) ,computer.programming_language ,multi-tier programming - Abstract
Web programmers are often faced with several challenges in the development process of modern, rich internet applications. Technologies for the different tiers of the application have to be selected: a server-side language, a combination of JavaScript, HTML and CSS for the client, and a database technology. Meeting the expectations of contemporary web applications requires even more effort from the developer: many state of the art libraries must be mastered and glued together. This leads to an impedance mismatch problem between the different technologies and it is up to the programmer to align them manually. Multi-tier or tierless programming is a web programming paradigm that provides one language for the different tiers of the web application, allowing the programmer to focus on the actual program logic instead of the accidental complexity that comes from combining several technologies. While current tierless approaches therefore relieve the burden of having to combine different technologies into one application, the distribution of the code is explicitly tied into the program. Certain distribution decisions have an impact on crosscutting concerns such as information security or offline availability. Moreover, adapting the programs such that the application complies better with these concerns often leads to code tangling, rendering the program more difficult to understand and maintain. We introduce an approach to multi-tier programming where the tierless code is decoupled from the tier specification. The developer implements the web application in terms of slices and an external specification that assigns the slices to tiers. A recommender system completes the picture for those slices that do not have a fixed placement and proposes slice refinements as well. This recommender system tries to optimise the tier specification with respect to one or more crosscutting concerns. This is in contrast with current cutting edge solutions that hide distribution decisions from the programmer. In this paper we show that slices, together with a recommender system, enable the developer to experiment with different placements of slices, until the distribution of the code satisfies the programmer's needs. We present a search-based recommender system that maximises the offline availability of a web application and a concrete implementation of these concepts in the tier-splitting tool Stip.js.
- Published
- 2017
43. Avoiding useless mutants
- Author
-
Márcio Ribeiro, Fabiano Cutigi Ferrari, André L. Santos, Melina Mongiovi, Ana Cavalcanti, José Carlos Maldonado, Rohit Gheyi, Leonardo Fernandes, and Luiz Carvalho
- Subjects
Java ,Programming language ,Computer science ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,Computer Graphics and Computer-Aided Design ,Set (abstract data type) ,020204 information systems ,Mutation testing ,Test suite ,0202 electrical engineering, electronic engineering, information engineering ,Code generation ,Data mining ,computer ,Software ,computer.programming_language - Abstract
Mutation testing is a program-transformation technique that injects artificial bugs to check whether the existing test suite can detect them. However, the costs of using mutation testing are usually high, hindering its use in industry. Useless mutants (equivalent and duplicated) contribute to increase costs. Previous research has focused mainly on detecting useless mutants only after they are generated and compiled. In this paper, we introduce a strategy to help developers with deriving rules to avoid the generation of useless mutants. To use our strategy, we pass as input a set of programs. For each program, we also need a passing test suite and a set of mutants. As output, our strategy yields a set of useless mutants candidates. After manually confirming that the mutants classified by our strategy as "useless" are indeed useless, we derive rules that can avoid their generation and thus decrease costs. To the best of our knowledge, we introduce 37 new rules that can avoid useless mutants right before their generation. We then implement a subset of these rules in the MUJAVA mutation testing tool. Since our rules have been derived based on artificial and small Java programs, we take our MUJAVA version embedded with our rules and execute it in industrial-scale projects. Our rules reduced the number of mutants by almost 13% on average. Our results are promising because (i) we avoid useless mutants generation; (ii) our strategy can help with identifying more rules in case we set it to use more complex Java programs; and (iii) our MUJAVA version has only a subset of the rules we derived.
- Published
- 2017
- Full Text
- View/download PDF
44. A Scala framework for supercompilation
- Author
-
Nathaniel Nystrom
- Subjects
Programming language ,Computer science ,Scala ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,JavaScript ,Abstract machine ,Partial evaluation ,Automated theorem proving ,020204 information systems ,0202 electrical engineering, electronic engineering, information engineering ,Compiler ,computer ,computer.programming_language ,Compile time - Abstract
Supercompilation is a program transformation technique that attempts to evaluate programs as much as possible at compile time. Supercompilation has been used for theorem proving, function inversion, and most notably optimization, especially of functional programs. However, the technique has numerous practical problems that prevent it from being applied in mainstream compilers. In this paper, we describe a framework that can be used for experimenting with supercompilation techniques. Our framework allows supercompilers to be constructed directly from an interpreter. The user specifies the interpreter using rewrite rules and the framework handles termination checking, generalization, and residualization. We demonstrate the approach by implementing a supercompiler for JavaScript.
- Published
- 2017
- Full Text
- View/download PDF
45. Incremental parametric syntax for multi-language transformation
- Author
-
Armando Solar-Lezama and James Koppel
- Subjects
Theoretical computer science ,Java ,Computer science ,Programming language ,Program transformation ,020207 software engineering ,0102 computer and information sciences ,02 engineering and technology ,Python (programming language) ,JavaScript ,computer.software_genre ,01 natural sciences ,Syntax ,Constructed language ,010201 computation theory & mathematics ,Abstract syntax ,0202 electrical engineering, electronic engineering, information engineering ,Compiler ,Abstract syntax tree ,computer ,computer.programming_language - Abstract
We present a new approach for building source-to-source transformations that can run on multiple programming languages, based on a new way of representing programs called incremental parametric syntax. We implement this approach in our Cubix system, and construct incremental parametric syntaxes for C, Java, JavaScript, Lua, and Python, demonstrating three multi-language program transformations that can run on all of them. Our evaluation shows that (1) once a transformation is written, relatively little work is required to configure it for a new language (2) transformations built this way output readable code which preserve the structure of the original, according to participants in our human study, and (3) despite dealing with many languages, our transformations can still handle language corner-cases, and pass 90% of compiler test suites.
- Published
- 2017
- Full Text
- View/download PDF
46. Intelligent agents via joint tabling of logic program abduction and updating
- Author
-
Ammar Fathin Sabili, Luís Moniz Pereira, and Ari Saptawijaya
- Subjects
Computer science ,business.industry ,Machine ethics ,Program transformation ,Context (language use) ,computer.software_genre ,Prolog ,Intelligent agent ,Knowledge-based systems ,Knowledge base ,Artificial intelligence ,business ,computer ,Logic programming ,computer.programming_language - Abstract
Reasoning is an important aspect for an intelligent agent to come to a rational decision. With the same importance is the ability of such an agent to adapt itself to the environment by learning new knowledge from its observations. When the agent's knowledge base is represented by a logic program, goal-directed deliberative reasoning and the adaptive ability of such an agent can be achieved by abduction and updating on logic programs, respectively. Furthermore, the tabling feature in logic programming, which affords solutions reuse rather than recomputing them, enables an agent to make an immediate decision based on past reasoning, thus avoiding repetitive deliberative reasoning. Joint tabling of logic program abduction and updating is an approach first proposed by Pereira and Saptawijaya, motivated by its application in machine ethics, enabling an agent to make moral decisions, using their system Qualm. In this paper, we provide a complete program transformation which has not been detailed on that approach. We also resolve previously unidentified issues with respect to its implementation aspects. A prototype, Qualm∗, is implemented as a proof of concept using XSB Prolog. Furthermore, an application is detailed, using Qualm”, emphasizing the importance of joint tabling of logic program abduction and updating, in the context of intelligent agents, specifically in ambient intelligence for eldercare.
- Published
- 2017
- Full Text
- View/download PDF
47. Supporting Analysis of SQL Queries in PHP AiR
- Author
-
David Anderson and Mark Hills
- Subjects
SQL ,Parsing ,Database ,Computer science ,InformationSystems_DATABASEMANAGEMENT ,Program transformation ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,Program analysis ,Scripting language ,Web page ,0202 electrical engineering, electronic engineering, information engineering ,Code (cryptography) ,020201 artificial intelligence & image processing ,Algorithm design ,computer ,computer.programming_language - Abstract
The code behind dynamic webpages often includes calls to database libraries, with queries formed using a combination of static text and values computed at runtime. In this paper, we describe our work on a program analysis for extracting models of database queries that can compactly represent all queries that could be used in a specific database library call. We also describe our work on parsing partial queries, with holes representing parts of the query that are computed dynamically. Implemented in Rascal as part of the PHP AiR framework, the goal of this work is to enable empirical research on database usage in PHP scripts, to support developer tools for understanding existing queries, and to support program transformation tools to evolve existing systems and to improve the security of existing code.
- Published
- 2017
- Full Text
- View/download PDF
48. Automated Refactoring of Legacy Java Software to Default Methods
- Author
-
Hidehiko Masuhara and Raffi Khatchadourian
- Subjects
Class (computer programming) ,Java ,Computer science ,Interface (Java) ,business.industry ,Programming language ,Program transformation ,020207 software engineering ,02 engineering and technology ,Static analysis ,computer.software_genre ,Inheritance (object-oriented programming) ,Program analysis ,Software ,Code refactoring ,Software design pattern ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Software engineering ,business ,computer ,Implementation ,computer.programming_language ,Eclipse - Abstract
Java 8 default methods, which allow interfaces to contain (instance) method implementations, are useful for the skeletal implementation software design pattern. However, it is not easy to transform existing software to exploit default methods as it requires analyzing complex type hierarchies, resolving multiple implementation inheritance issues, reconciling differences between class and interface methods, and analyzing tie-breakers (dispatch precedence) with overriding class methods to preserve type-correctness and confirm semantics preservation. In this paper, we present an efficient, fully-automated, type constraint-based refactoring approach that assists developers in taking advantage of enhanced interfaces for their legacy Java software. The approach features an extensive rule set that covers various corner-cases where default methods cannot be used. To demonstrate applicability, we implemented our approach as an Eclipse plug-in and applied it to 19 real-world Java projects, as well as submitted pull requests to popular GitHub repositories. The indication is that it is useful in migrating skeletal implementation methods to interfaces as default methods, sheds light onto the pattern's usage, and provides insight to language designers on how this new construct applies to existing software.
- Published
- 2017
49. A high-level synthesis approach optimizing accumulations in floating-point programs using custom formats and operators
- Author
-
Florent de Dinechin, Steven Derrien, Yohann Uguen, Software and Cognitive radio for telecommunications (SOCRATE), Inria Grenoble - Rhône-Alpes, Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-CITI Centre of Innovation in Telecommunications and Integration of services (CITI), Institut National des Sciences Appliquées de Lyon (INSA Lyon), Institut National des Sciences Appliquées (INSA)-Université de Lyon-Institut National des Sciences Appliquées (INSA)-Université de Lyon-Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National des Sciences Appliquées de Lyon (INSA Lyon), Institut National des Sciences Appliquées (INSA)-Université de Lyon-Institut National des Sciences Appliquées (INSA)-Université de Lyon, Energy Efficient Computing ArchItectures with Embedded Reconfigurable Resources (CAIRN), ARCHITECTURE (IRISA-D3), Institut de Recherche en Informatique et Systèmes Aléatoires (IRISA), Université de Bretagne Sud (UBS)-Institut National des Sciences Appliquées - Rennes (INSA Rennes), Institut National des Sciences Appliquées (INSA)-Université de Rennes (UNIV-RENNES)-Institut National des Sciences Appliquées (INSA)-Université de Rennes (UNIV-RENNES)-Institut National de Recherche en Informatique et en Automatique (Inria)-École normale supérieure - Rennes (ENS Rennes)-Centre National de la Recherche Scientifique (CNRS)-Université de Rennes 1 (UR1), Université de Rennes (UNIV-RENNES)-CentraleSupélec-IMT Atlantique Bretagne-Pays de la Loire (IMT Atlantique), Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)-Université de Bretagne Sud (UBS)-Institut National des Sciences Appliquées - Rennes (INSA Rennes), Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)-Institut de Recherche en Informatique et Systèmes Aléatoires (IRISA), Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)-Inria Rennes – Bretagne Atlantique, Institut National de Recherche en Informatique et en Automatique (Inria), ANR-13-INSE-0007,MetaLibm,Générateurs de code pour les fonctions mathématiques et les filtres(2013), Université de Lyon-Institut National des Sciences Appliquées (INSA)-Université de Lyon-Institut National des Sciences Appliquées (INSA)-Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National des Sciences Appliquées de Lyon (INSA Lyon), Université de Lyon-Institut National des Sciences Appliquées (INSA)-Université de Lyon-Institut National des Sciences Appliquées (INSA), Inria Rennes – Bretagne Atlantique, Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-ARCHITECTURE (IRISA-D3), Université de Rennes (UR)-Institut National des Sciences Appliquées - Rennes (INSA Rennes), Institut National des Sciences Appliquées (INSA)-Institut National des Sciences Appliquées (INSA)-Université de Bretagne Sud (UBS)-École normale supérieure - Rennes (ENS Rennes)-Institut National de Recherche en Informatique et en Automatique (Inria)-CentraleSupélec-Centre National de la Recherche Scientifique (CNRS)-IMT Atlantique (IMT Atlantique), Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)-Université de Rennes (UR)-Institut National des Sciences Appliquées - Rennes (INSA Rennes), Institut National des Sciences Appliquées (INSA)-Institut National des Sciences Appliquées (INSA)-Université de Bretagne Sud (UBS)-École normale supérieure - Rennes (ENS Rennes)-CentraleSupélec-Centre National de la Recherche Scientifique (CNRS)-IMT Atlantique (IMT Atlantique), and Institut Mines-Télécom [Paris] (IMT)-Institut Mines-Télécom [Paris] (IMT)
- Subjects
[INFO.INFO-AR]Computer Science [cs]/Hardware Architecture [cs.AR] ,Floating point ,[INFO.INFO-PL]Computer Science [cs]/Programming Languages [cs.PL] ,Computer science ,[INFO.INFO-AO]Computer Science [cs]/Computer Arithmetic ,Hardware description language ,Program transformation ,Parallel computing ,computer.software_genre ,Compiler ,Programmer ,Field-programmable gate array ,computer ,Massively parallel ,Critical path method ,computer.programming_language - Abstract
Many case studies have demonstrated the potential of Field-Programmable Gate Arrays (FPGAs) as accelerators for a wide range of applications. FPGAs offer massive parallelism and programmability at the bit level. This enables programmers to exploit a range of techniques that avoid many bottlenecks of classical von Neumann computing. However, development costs for FPGAs are orders of magnitude higher than classical programming. A solution would be the use of High-Level Synthesis (HLS) tools, which use C as a hardware description language. However, the C language was designed to be executed on general purpose processors, not to generate hardware. Its datatypes and operators are limited to a small number (more or less matching the hardware operators present in mainstream processors), and HLS tools inherit these limitations. To better exploit the freedom offered by hardware and FPGAs, HLS vendors have enriched the C language with integer and fixed-point types of arbitrary size. Still, the operations on these types remain limited to the basic arithmetic and logic ones. In floating point, the current situation is even worse. The operator set is limited, and the sizes are restricted to 32 and 64 bits. Besides, most recent compilers, including the HLS ones, attempt to follow established standards, in particular C11 and IEEE-754. This ensures bit-exact compatibility with software, but greatly reduces the freedom of optimization by the compiler. For instance, a floating point addition is not associative even though its real equivalent is. In the present work we attempt to give the compiler more freedom. For this, we sacrifice the strict respect of the IEEE-754 and C11 standards, but we replace it with the strict respect of a high-level accuracy specification expressed by the programmer through a pragma. The case study in this work is a program transformation that applies to floating-point additions on a loop's critical path. It decomposes them into elementary steps, resizes the corresponding subcomponents to guarantee some user-specified accuracy, and merges and reorders these components to improve performance. The result of this complex sequence of optimizations could not be obtained from an operator generator, since it involves global loop information. For this purpose, we used a compilation flow involving one or several source-to-source transformations operating on the code given to HLS tools (Figure 1).The proposed transformation already works very well on 3 of the 10 FPMarks where it improves both latency and accuracy by an order of magnitude for comparable area. For 2 more benchmarks, the latency is not improved (but not degraded either) due to current limitations of HLS tools. This defines short-term future work. The main result of this work is that HLS tools also have the potential to generate efficient designs for handling floating-point computations in a completely non-standard way. In the longer term, we believe that HLS flows can not only import application-specific operators from the FPGA literature, they can also improve them using high-level, program-level information.
- Published
- 2017
- Full Text
- View/download PDF
50. A study on Migrating Flash files to HTML5/JavaScript
- Author
-
Yogesh Maheshwari and Y. Raghu Reddy
- Subjects
021103 operations research ,HTML5 ,Computer science ,Programming language ,Rich Internet application ,0211 other engineering and technologies ,Program transformation ,02 engineering and technology ,Animation ,JavaScript ,computer.software_genre ,ActionScript ,Flash (photography) ,Scratch ,computer ,computer.programming_language - Abstract
Over the past few years, there is a significant shift from web to mobile devices. In addition, the success of HTML5 has negatively impacted the usage and support for Adobe Flash. This has resulted in unmaintained Flash assets and code bases. In this paper, we discuss the feasibility of a semi-automated technique to transform Flash based animations to HTML5 and JavaScript against re-writing the same animations from scratch. Writing animations from scratch in JavaScript is a time taking effort due to adherence to aesthetic details of the animation, domain knowledge and enumeration of all states. Our approach addresses these challenges by providing techniques to transform the Small Web Format (SWF) files to JavaScript. We validate our approach by conducting an experimental study to measure the efforts for a set of animations with respect to transformation from scratch, and transformation using our proposed approach. The results showed that our approach has the potential to significantly bridge the process of Flash to HTML5 migration.
- Published
- 2017
- Full Text
- View/download PDF
Catalog
Discovery Service for Jio Institute Digital Library
For full access to our library's resources, please sign in.