460 research outputs found
Program transformation for development, verification, and synthesis of programs
This paper briefly describes the use of the program transformation methodology for the development of correct and efficient programs. In particular, we will refer to the case of constraint logic programs and, through some examples, we will show how by program transformation, one can improve, synthesize, and verify programs
Program Transformation for Development, Verification, and Synthesis of Software
In this paper we briefly describe the use of the program transformation methodology for the development of correct
and efficient programs. We will consider, in particular,
the case of the transformation and the development of constraint logic programs
Folding Transformation Rules for Constraint Logic Programs
We consider the folding transformation rule for constraint
logic programs. We propose an algorithm for applying the folding rule in the case where the constraints are linear equations and inequations over the rational or the real numbers. Basically, our algorithm consists in reducing a rule application to the solution of one or more systems
of linear equations and inequations. We also introduce two variants of the folding transformation rule. The first variant combines the folding rule with the clause splitting rule, and the second variant eliminates the existential variables of a clause, that is, those variables which occur in the body of the clause and not in its head. Finally, we present the algorithms for applying these variants of the folding rule
An iterative approach to precondition inference using constrained Horn clauses
We present a method for automatic inference of conditions on the initial
states of a program that guarantee that the safety assertions in the program
are not violated. Constrained Horn clauses (CHCs) are used to model the program
and assertions in a uniform way, and we use standard abstract interpretations
to derive an over-approximation of the set of unsafe initial states. The
precondition then is the constraint corresponding to the complement of that
set, under-approximating the set of safe initial states. This idea of
complementation is not new, but previous attempts to exploit it have suffered
from the loss of precision. Here we develop an iterative specialisation
algorithm to give more precise, and in some cases optimal safety conditions.
The algorithm combines existing transformations, namely constraint
specialisation, partial evaluation and a trace elimination transformation. The
last two of these transformations perform polyvariant specialisation, leading
to disjunctive constraints which improve precision. The algorithm is
implemented and tested on a benchmark suite of programs from the literature in
precondition inference and software verification competitions.Comment: Paper presented at the 34nd International Conference on Logic
Programming (ICLP 2018), Oxford, UK, July 14 to July 17, 2018 18 pages, LaTe
COLAB : a hybrid knowledge representation and compilation laboratory
Knowledge bases for real-world domains such as mechanical engineering require expressive and efficient representation and processing tools. We pursue a declarative-compilative approach to knowledge engineering. While Horn logic (as implemented in PROLOG) is well-suited for representing relational clauses, other kinds of declarative knowledge call for hybrid extensions: functional dependencies and higher-order knowledge should be modeled directly. Forward (bottom-up) reasoning should be integrated with backward (top-down) reasoning. Constraint propagation should be used wherever possible instead of search-intensive resolution. Taxonomic knowledge should be classified into an intuitive subsumption hierarchy. Our LISP-based tools provide direct translators of these declarative representations into abstract machines such as an extended Warren Abstract Machine (WAM) and specialized inference engines that are interfaced to each other. More importantly, we provide source-to-source transformers between various knowledge types, both for user convenience and machine efficiency. These formalisms with their translators and transformers have been developed as part of COLAB, a compilation laboratory for studying what we call, respectively, "vertical\u27; and "horizontal\u27; compilation of knowledge, as well as for exploring the synergetic collaboration of the knowledge representation formalisms. A case study in the realm of mechanical engineering has been an important driving force behind the development of COLAB. It will be used as the source of examples throughout the paper when discussing the enhanced formalisms, the hybrid representation architecture, and the compilers
Poly-controlled partial evaluation and its application to resource-aware program specialization
La Evaluación Parcial es una técnica automática para la optimización de programas. Su objetivo principal es el
de especializar un programa con respecto a parte de sus datos de entrada, los que se conocen como datos estáticos.
La calidad del código generado por la evaluación parcial de programas lógicos depende, en gran medida, de la estrategia de control que se haya empleado. Desafortunadamente, aún estamos lejos de contar con una estrategia de control suficientemente sofisticada como para
comportarse de manera óptima para cualquier programa.
La principal contribución de esta tesis es el desarrollo de la Evaluación Parcial Policontrolada, un novedoso entorno para la evaluación parcial de programas lógicos, el cual es policontrolado en el sentido de que puede tomar en cuenta conjuntos de reglas de control global y local, en lugar de emplear una única combinación predeterminada (como es el caso de la evaluación parcial tradicional). Este entorno es más flexible que los enfoques existentes, ya que permite asignar diferentes reglas de control local y global a
diferentes patrones de llamada. De este modo, es posible obtener programas especializados que no pueden ser generados usando evaluación parcial tradicional. En consecuencia, el entorno de evaluación parcial policontrolada puede
generar conjuntos de programas especializados, en lugar de un único programa. A través de técnicas auto-ajustables, es posible hacer que este enfoque sea completamente automático. Dichas técnicas permiten medir la calidad de los diferentes programas especializados obtenidos. Este entorno es consciente de los recursos, en el sentido de que
cada una de las soluciones obtenidas a través de la evaluación parcial policontrolada es valorada utilizando funciones de adecuación, las que pueden tener en cuenta factores tales como el tamaño de los programas especializados, o la cantidad de memoria que consumen,
además de la velocidad del programa especializado que es el factor habitualmente considerado en otros entornos de evaluación parcial.
Este entorno de evaluación parcial policontrolada ha sido implementado en el sistema CiaoPP, y evaluado con numerosos programas de prueba. Los resultados experimentales muestran que nuestra propuesta obtiene en muchos casos mejores especializaciones que aquellas generadas usando la evaluación parcial tradicional, especialmente cuando la especialización es consciente de los recursos.
Otra de las principales contribuciones de esta tesis es la
presentación de una visión unificada del problema de eliminar la polivarianza superflua en la evaluación parcial y en la especialización abstracta múltiple, a través del uso de un paso de minimización, el cual agrupa versiones equivalentes de predicados. Este paso se puede aplicar en la especialización de cualquier programa Prolog, inclusive aquellos que contienen llamadas a predicados predefinidos o predicados externos. Además, ofrecemos la posibilidad de agrupar versiones que no sean estrictamente equivalentes, con el propósito de obtener programas más pequeños
Transformations of CCP programs
We introduce a transformation system for concurrent constraint programming
(CCP). We define suitable applicability conditions for the transformations
which guarantee that the input/output CCP semantics is preserved also when
distinguishing deadlocked computations from successful ones and when
considering intermediate results of (possibly) non-terminating computations.
The system allows us to optimize CCP programs while preserving their intended
meaning: In addition to the usual benefits that one has for sequential
declarative languages, the transformation of concurrent programs can also lead
to the elimination of communication channels and of synchronization points, to
the transformation of non-deterministic computations into deterministic ones,
and to the crucial saving of computational space. Furthermore, since the
transformation system preserves the deadlock behavior of programs, it can be
used for proving deadlock freeness of a given program wrt a class of queries.
To this aim it is sometimes sufficient to apply our transformations and to
specialize the resulting program wrt the given queries in such a way that the
obtained program is trivially deadlock free.Comment: To appear in ACM TOPLA
- …