1,748 research outputs found
Termination of rewriting strategies: a generic approach
We propose a generic termination proof method for rewriting under strategies,
based on an explicit induction on the termination property. Rewriting trees on
ground terms are modeled by proof trees, generated by alternatively applying
narrowing and abstracting steps. The induction principle is applied through the
abstraction mechanism, where terms are replaced by variables representing any
of their normal forms. The induction ordering is not given a priori, but
defined with ordering constraints, incrementally set during the proof.
Abstraction constraints can be used to control the narrowing mechanism, well
known to easily diverge. The generic method is then instantiated for the
innermost, outermost and local strategies.Comment: 49 page
Combining Static and Dynamic Contract Checking for Curry
Static type systems are usually not sufficient to express all requirements on
function calls. Hence, contracts with pre- and postconditions can be used to
express more complex constraints on operations. Contracts can be checked at run
time to ensure that operations are only invoked with reasonable arguments and
return intended results. Although such dynamic contract checking provides more
reliable program execution, it requires execution time and could lead to
program crashes that might be detected with more advanced methods at compile
time. To improve this situation for declarative languages, we present an
approach to combine static and dynamic contract checking for the functional
logic language Curry. Based on a formal model of contract checking for
functional logic programming, we propose an automatic method to verify
contracts at compile time. If a contract is successfully verified, dynamic
checking of it can be omitted. This method decreases execution time without
degrading reliable program execution. In the best case, when all contracts are
statically verified, it provides trust in the software since crashes due to
contract violations cannot occur during program execution.Comment: Pre-proceedings paper presented at the 27th International Symposium
on Logic-Based Program Synthesis and Transformation (LOPSTR 2017), Namur,
Belgium, 10-12 October 2017 (arXiv:1708.07854
Non-linear Pattern Matching with Backtracking for Non-free Data Types
Non-free data types are data types whose data have no canonical forms. For
example, multisets are non-free data types because the multiset has
two other equivalent but literally different forms and .
Pattern matching is known to provide a handy tool set to treat such data types.
Although many studies on pattern matching and implementations for practical
programming languages have been proposed so far, we observe that none of these
studies satisfy all the criteria of practical pattern matching, which are as
follows: i) efficiency of the backtracking algorithm for non-linear patterns,
ii) extensibility of matching process, and iii) polymorphism in patterns.
This paper aims to design a new pattern-matching-oriented programming
language that satisfies all the above three criteria. The proposed language
features clean Scheme-like syntax and efficient and extensible pattern matching
semantics. This programming language is especially useful for the processing of
complex non-free data types that not only include multisets and sets but also
graphs and symbolic mathematical expressions. We discuss the importance of our
criteria of practical pattern matching and how our language design naturally
arises from the criteria. The proposed language has been already implemented
and open-sourced as the Egison programming language
Programming with narrowing: A tutorial
AbstractNarrowing is a computation implemented by some declarative programming languages. Research in the last decade has produced significant results on the theory and foundation of narrowing, but little has been published on the use of narrowing in programming. This paper introduces narrowing from a programmer’s viewpoint; shows, by means of examples, when, why and how to use narrowing in a program; and discusses the impact of narrowing on software development activities such as design and maintenance. The examples are coded in the programming language Curry, which provides narrowing as a first class feature
Towards a Framework for Proving Termination of Maude Programs
Maude es un lenguaje de programación declarativo basado en la lógica de reescritura
que incorpora muchas características que lo hacen muy potente. Sin
embargo, a la hora de probar ciertas propiedades computacionales esto conlleva
dificultades. La tarea de probar la terminación de sistemas de reesctritura
es de hecho bastante dura, pero aplicada a lenguajes de programación reales
se concierte en más complicada debido a estas características inherentes. Esto
provoca que métodos para probar la terminación de este tipo de programas
requieran técnicas específicas y un análisis cuidadoso. Varios trabajos han intentado
probar terminación de (un subconjunto de) programas Maude. Sin
embargo, todos ellos siguen una aproximación transformacional, donde el programa
original es trasformado hasta alcanzar un sistema de reescritura capaz
de ser manejado con las técnicas y herramientas de terminación existentes. En
la práctica, el hecho de transformar los sistemas originales suele complicar la
demostración de la terminación ya que esto introduce nuevos símbolos y reglas
en el sistema. En esta tesis, llevamos a cabo el problema de probar terminación
de (un subconjunto de) programas Maude mediante métodos directos.
Por un lado, nos centramos en la estrategia de Maude. Maude es un lenguaje
impaciente donde los argumentos de una función son evaluados siempre
antes de la aplicación de la función que los usa. Esta estrategia (conocida como
llamada por valor) puede provocar la no terminación si los programas no
están escritos cuidadosamente. Por esta razón, Maude (en concreto) incorpora
mecanismos para controlar la ejecución de programas como las anotaciones
sintácticas que están asociadas a los argumentos de los símbolos. En reescritura,
esta estrategia sería conocida como reescritura sensible al contexto
innermost (RSCI).
Por otro lado, Maude también incorpora la posibilidad de declarar atributos.Alarcón Jiménez, B. (2011). Towards a Framework for Proving Termination of Maude Programs [Tesis doctoral no publicada]. Universitat Politècnica de València. https://doi.org/10.4995/Thesis/10251/11003Palanci
- …