XQuery in the functional-logic language toy

  • Authors:
  • Jesus M. Almendros-Jiménez;Rafael Caballero;Yolanda García-Ruiz;Fernando Sáenz-Pérez

  • Affiliations:
  • Dpto. de Lenguajes y Computación, Universidad de Almería;Departamento de Sistemas Informáticos y Computación, Universidad Complutense de Madrid;Departamento de Sistemas Informáticos y Computación, Universidad Complutense de Madrid;Departamento de Ingeniería del Software e Inteligencia Artificial, Universidad Complutense de Madrid, Spain

  • Venue:
  • WFLP'11 Proceedings of the 20th international conference on Functional and constraint logic programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper presents an encoding of the XML query language XQuery in the functional-logic language TOY. The encoding is based on the definition of for-let-where-return constructors by means of TOY functions, and uses the recently proposed XPath implementation for this language as a basis. XQuery expressions can be executed in TOY obtaining sequences of XML elements as answers. Our setting exploits the non-deterministic nature of TOY by retrieving the elements of the XML tree once at a time when necessary. We show that one of the advantages of using a rewriting-based language for implementing XQuery is that it can be used for optimizing XQuery expressions by query rewriting. With this aim, XQuery expressions are converted into higher order patterns that can be analyzed and modified by TOY functions.