-
A Dataflow Analysis for Comparing and Reordering Predicate Arguments
Authors:
Gonzague Yernaux,
Wim Vanhoof
Abstract:
In this work, which is done in the context of a (moded) logic programming language, we devise a data-flow analysis dedicated to computing what we call argument profiles. Such a profile essentially describes, for each argument of a predicate, its functionality, i.e. the operations in which the argument can be involved during an evaluation of the predicate, as well as how the argument contributes to…
▽ More
In this work, which is done in the context of a (moded) logic programming language, we devise a data-flow analysis dedicated to computing what we call argument profiles. Such a profile essentially describes, for each argument of a predicate, its functionality, i.e. the operations in which the argument can be involved during an evaluation of the predicate, as well as how the argument contributes to the consumption and/or construction of data values. While the computed argument profiles can be useful for applications in the context of program understanding (as each profile essentially provides a way to better understand the role of the argument), they more importantly provide a way to discern between arguments in a manner that is more fine-grained than what can be done with other abstract characterizations such as types and modes. This is important for applications where one needs to identify correspondences between the arguments of two or more different predicates that need to be compared, such as during clone detection. Moreover, since a total order can be defined on the abstract domain of profiles, our analysis can be used for rearranging predicate arguments and order them according to their functionality, constituting as such an essential ingredient for predicate normalization techniques.
△ Less
Submitted 30 August, 2023;
originally announced August 2023.
-
Pre-proceedings of the 31st International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR 2021)
Authors:
Emanuele De Angelis,
Wim Vanhoof
Abstract:
This volume constitutes the pre-proceedings of the 31st International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR 2021), held on 7-8th September 2021 as a hybrid (blended) meeting, both in-person (at the Teachers' House in Tallinn, Estonia) and virtual, and co-located with the 23rd International Symposium on Principles and Practice of Declarative Programming (PPDP 2021).…
▽ More
This volume constitutes the pre-proceedings of the 31st International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR 2021), held on 7-8th September 2021 as a hybrid (blended) meeting, both in-person (at the Teachers' House in Tallinn, Estonia) and virtual, and co-located with the 23rd International Symposium on Principles and Practice of Declarative Programming (PPDP 2021). After discussion at the symposium papers will go through a second round of refereeing and selection for the formal proceedings.
△ Less
Submitted 31 August, 2021; v1 submitted 21 July, 2021;
originally announced July 2021.
-
Anti-unification of Unordered Goals
Authors:
Gonzague Yernaux,
Wim Vanhoof
Abstract:
Anti-unification in logic programming refers to the process of capturing common syntactic structure among given goals, computing a single new goal that is more general called a generalization of the given goals. Finding an arbitrary common generalization for two goals is trivial, but looking for those common generalizations that are either as large as possible (called largest common generalization…
▽ More
Anti-unification in logic programming refers to the process of capturing common syntactic structure among given goals, computing a single new goal that is more general called a generalization of the given goals. Finding an arbitrary common generalization for two goals is trivial, but looking for those common generalizations that are either as large as possible (called largest common generalizations) or as specific as possible (called most specific generalizations) is a non-trivial optimization problem, in particular when goals are considered to be \textit{unordered} sets of atoms. In this work we provide an in-depth study of the problem by defining two different generalization relations. We formulate a characterization of what constitutes a most specific generalization in both settings. While these generalizations can be computed in polynomial time, we show that when the number of variables in the generalization needs to be minimized, the problem becomes NP-hard. We subsequently revisit an abstraction of the largest common generalization when anti-unification is based on injective variable renamings, and prove that it can be computed in polynomially bounded time.
△ Less
Submitted 20 October, 2021; v1 submitted 1 July, 2021;
originally announced July 2021.
-
An SMT-Based Concolic Testing Tool for Logic Programs
Authors:
Sophie Fortz,
Fred Mesnard,
Etienne Payet,
Gilles Perrouin,
Wim Vanhoof,
German Vidal
Abstract:
Concolic testing mixes symbolic and concrete execution to generate test cases covering paths effectively. Its benefits have been demonstrated for more than 15 years to test imperative programs. Other programming paradigms, like logic programming, have received less attention. In this paper, we present a concolic-based test generation method for logic programs. Our approach exploits SMT-solving for…
▽ More
Concolic testing mixes symbolic and concrete execution to generate test cases covering paths effectively. Its benefits have been demonstrated for more than 15 years to test imperative programs. Other programming paradigms, like logic programming, have received less attention. In this paper, we present a concolic-based test generation method for logic programs. Our approach exploits SMT-solving for constraint resolution. We then describe the implementation of a concolic testing tool for Prolog and validate it on some selected benchmarks.
△ Less
Submitted 17 February, 2020;
originally announced February 2020.
-
Anti-unification in Constraint Logic Programming
Authors:
Gonzague Yernaux,
Wim Vanhoof
Abstract:
Anti-unification refers to the process of generalizing two (or more) goals into a single, more general, goal that captures some of the structure that is common to all initial goals. In general one is typically interested in computing what is often called a most specific generalization, that is a generalization that captures a maximal amount of shared structure. In this work we address the problem…
▽ More
Anti-unification refers to the process of generalizing two (or more) goals into a single, more general, goal that captures some of the structure that is common to all initial goals. In general one is typically interested in computing what is often called a most specific generalization, that is a generalization that captures a maximal amount of shared structure. In this work we address the problem of anti-unification in CLP, where goals can be seen as unordered sets of atoms and/or constraints. We show that while the concept of a most specific generalization can easily be defined in this context, computing it becomes an NP-complete problem. We subsequently introduce a generalization algorithm that computes a well-defined abstraction whose computation can be bound to a polynomial execution time. Initial experiments show that even a naive implementation of our algorithm produces acceptable generalizations in an efficient way. Under consideration for acceptance in TPLP.
△ Less
Submitted 24 July, 2019;
originally announced July 2019.
-
A Symbolic Execution Algorithm for Constraint-Based Testing of Database Programs
Authors:
Michaël Marcozzi,
Wim Vanhoof,
Jean-Luc Hainaut
Abstract:
In so-called constraint-based testing, symbolic execution is a common technique used as a part of the process to generate test data for imperative programs. Databases are ubiquitous in software and testing of programs manipulating databases is thus essential to enhance the reliability of software. This work proposes and evaluates experimentally a symbolic ex- ecution algorithm for constraint-based…
▽ More
In so-called constraint-based testing, symbolic execution is a common technique used as a part of the process to generate test data for imperative programs. Databases are ubiquitous in software and testing of programs manipulating databases is thus essential to enhance the reliability of software. This work proposes and evaluates experimentally a symbolic ex- ecution algorithm for constraint-based testing of database programs. First, we describe SimpleDB, a formal language which offers a minimal and well-defined syntax and seman- tics, to model common interaction scenarios between pro- grams and databases. Secondly, we detail the proposed al- gorithm for symbolic execution of SimpleDB models. This algorithm considers a SimpleDB program as a sequence of operations over a set of relational variables, modeling both the database tables and the program variables. By inte- grating this relational model of the program with classical static symbolic execution, the algorithm can generate a set of path constraints for any finite path to test in the control- flow graph of the program. Solutions of these constraints are test inputs for the program, including an initial content for the database. When the program is executed with respect to these inputs, it is guaranteed to follow the path with re- spect to which the constraints were generated. Finally, the algorithm is evaluated experimentally using representative SimpleDB models.
△ Less
Submitted 23 January, 2015;
originally announced January 2015.
-
A Direct Symbolic Execution of SQL Code for Testing of Data-Oriented Applications
Authors:
Michaël Marcozzi,
Wim Vanhoof,
Jean-Luc Hainaut
Abstract:
Symbolic execution is a technique which enables automatically generating test inputs (and outputs) exercising a set of execution paths within a program to be tested. If the paths cover a sufficient part of the code under test, the test data offer a representative view of the program's actual behaviour, which notably enables detecting errors and correcting faults. Relational databases are ubiquitou…
▽ More
Symbolic execution is a technique which enables automatically generating test inputs (and outputs) exercising a set of execution paths within a program to be tested. If the paths cover a sufficient part of the code under test, the test data offer a representative view of the program's actual behaviour, which notably enables detecting errors and correcting faults. Relational databases are ubiquitous in software, but symbolic execution of pieces of code that manipulate them remains a non-trivial problem, particularly because of the complex structure of such databases and the complex behaviour of SQL statements. In this work, we define a direct symbolic execution for database manipulation code and integrate it with a more traditional symbolic execution of normal program code. The database tables are represented by relational symbols and the SQL statements by relational constraints over these symbols and the symbols representing the normal variables of the program. An algorithm based on these principles is presented for the symbolic execution of Java methods that implement business use cases by reading and writing in a relational database, the latter subject to data integrity constraints. The algorithm is integrated in a test generation tool and experimented over sample code. The target language for the constraints produced by the tool is the SMT-Lib standard and the used solver is Microsoft Z3. The results show that the proposed approach enables generating meaningful test data, including valid database content, in reasonable time. In particular, the Z3 solver is shown to be more scalable than the Alloy solver, used in our previous work, for solving relational constraints.
△ Less
Submitted 21 January, 2015;
originally announced January 2015.
-
Static Application-Level Race Detection in STM Haskell using Contracts
Authors:
Romain Demeyer,
Wim Vanhoof
Abstract:
Writing concurrent programs is a hard task, even when using high-level synchronization primitives such as transactional memories together with a functional language with well-controlled side-effects such as Haskell, because the interferences generated by the processes to each other can occur at different levels and in a very subtle way. The problem occurs when a thread leaves or exposes the shared…
▽ More
Writing concurrent programs is a hard task, even when using high-level synchronization primitives such as transactional memories together with a functional language with well-controlled side-effects such as Haskell, because the interferences generated by the processes to each other can occur at different levels and in a very subtle way. The problem occurs when a thread leaves or exposes the shared data in an inconsistent state with respect to the application logic or the real meaning of the data. In this paper, we propose to associate contracts to transactions and we define a program transformation that makes it possible to extend static contract checking in the context of STM Haskell. As a result, we are able to check statically that each transaction of a STM Haskell program handles the shared data in a such way that a given consistency property, expressed in the form of a user-defined boolean function, is preserved. This ensures that bad interference will not occur during the execution of the concurrent program.
△ Less
Submitted 10 December, 2013;
originally announced December 2013.
-
A Test Automation Framework for Mercury
Authors:
Peter Biener,
François Degrave,
Wim Vanhoof
Abstract:
This paper presents a test automation framework for Mercury programs. We developed a method that generates runnable Mercury code from a formalized test suite, and which code provides a report on execution about the success of test cases. We also developed a coverage tool for the framework, which identifies and provide a visualization of the reached parts of the program when executing a given test…
▽ More
This paper presents a test automation framework for Mercury programs. We developed a method that generates runnable Mercury code from a formalized test suite, and which code provides a report on execution about the success of test cases. We also developed a coverage tool for the framework, which identifies and provide a visualization of the reached parts of the program when executing a given test suite.
△ Less
Submitted 20 September, 2010;
originally announced September 2010.
-
Proceedings of the 17th Workshop on Logic-based methods in Programming Environments (WLPE 2007)
Authors:
Patricia Hill,
Wim Vanhoof
Abstract:
This volume contains the papers presented at WLPE 2007: the 17th Workshop on Logic-based Methods in Programming Environments on 13th September, 2007 in Porto, Portugal. It was held as a satellite workshop of ICLP 2007, the 23th International Conference on Logic Programming.
This volume contains the papers presented at WLPE 2007: the 17th Workshop on Logic-based Methods in Programming Environments on 13th September, 2007 in Porto, Portugal. It was held as a satellite workshop of ICLP 2007, the 23th International Conference on Logic Programming.
△ Less
Submitted 19 December, 2007;
originally announced December 2007.
-
Proceedings of the 16th Workshop in Logic-based Methods in Programming Environments (WLPE2006)
Authors:
Wim Vanhoof,
Susana Munoz-Hernandez
Abstract:
This volume contains the papers presented at WLPE'06: the 16th Workshop on Logic-based Methods in Programming Environments held on August 16, 2006 in the Seattle Sheraton Hotel and Towers, Seattle, Washington (USA). It was organised as a satellite workshop of ICLP'06, the 22th International Conference on Logic Programming.
This volume contains the papers presented at WLPE'06: the 16th Workshop on Logic-based Methods in Programming Environments held on August 16, 2006 in the Seattle Sheraton Hotel and Towers, Seattle, Washington (USA). It was organised as a satellite workshop of ICLP'06, the 22th International Conference on Logic Programming.
△ Less
Submitted 24 January, 2007;
originally announced January 2007.
-
Fingerprinting Logic Programs
Authors:
Alexander Serebrenik,
Wim Vanhoof
Abstract:
In this work we present work in progress on functionality duplication detection in logic programs. Eliminating duplicated functionality recently became prominent in context of refactoring. We describe a quantitative approach that allows to measure the ``similarity'' between two predicate definitions. Moreover, we show how to compute a so-called ``fingerprint'' for every predicate. Fingerprints c…
▽ More
In this work we present work in progress on functionality duplication detection in logic programs. Eliminating duplicated functionality recently became prominent in context of refactoring. We describe a quantitative approach that allows to measure the ``similarity'' between two predicate definitions. Moreover, we show how to compute a so-called ``fingerprint'' for every predicate. Fingerprints capture those characteristics of the predicate that are significant when searching for duplicated functionality. Since reasoning on fingerprints is much easier than reasoning on predicate definitions, comparing the fingerprints is a promising direction in automated code duplication in logic programs.
△ Less
Submitted 12 January, 2007;
originally announced January 2007.
-
Offline Specialisation in Prolog Using a Hand-Written Compiler Generator
Authors:
Michael Leuschel,
Jesper Joergensen,
Wim Vanhoof,
Maurice Bruynooghe
Abstract:
The so called ``cogen approach'' to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that the cogen approach is also applicable to the specialisation of logic programs (also called partial deduction) and leads to effective specialisers.…
▽ More
The so called ``cogen approach'' to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that the cogen approach is also applicable to the specialisation of logic programs (also called partial deduction) and leads to effective specialisers. Moreover, using good binding-time annotations, the speed-ups of the specialised programs are comparable to the speed-ups obtained with online specialisers. The paper first develops a generic approach to offline partial deduction and then a specific offline partial deduction method, leading to the offline system LIX for pure logic programs. While this is a usable specialiser by itself, it is used to develop the cogen system LOGEN. Given a program, a specification of what inputs will be static, and an annotation specifying which calls should be unfolded, LOGEN generates a specialised specialiser for the program at hand. Running this specialiser with particular values for the static inputs results in the specialised program. While this requires two steps instead of one, the efficiency of the specialisation process is improved in situations where the same program is specialised multiple times. The paper also presents and evaluates an automatic binding-time analysis that is able to derive the annotations. While the derived annotations are still suboptimal compared to hand-crafted ones, they enable non-expert users to use the LOGEN system in a fully automated way. Finally, LOGEN is extended so as to directly support a large part of Prolog's declarative and non-declarative features and so as to be able to perform so called mixline specialisations.
△ Less
Submitted 7 August, 2002;
originally announced August 2002.