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 t...
详细信息
ISBN:
(纸本)9783642225307;9783642225314
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.
We present outside-in conditional narrowing for orthogonal conditional term rewriting systems, and show the completeness of leftmost-outside-in conditional narrowing with respect to normalizable solutions. We consider...
详细信息
We present outside-in conditional narrowing for orthogonal conditional term rewriting systems, and show the completeness of leftmost-outside-in conditional narrowing with respect to normalizable solutions. We consider orthogonal conditional term rewriting systems whose conditions consist of strict equality only. Completeness results are obtained for systems both with and without extra variables. The result bears practical significance since orthogonal conditional term rewriting systems can be viewed as a computation model for functional-logic programming languages and leftmost-outside-in conditional narrowing is the computing mechanism for the model.
XPath is a well-known query language for finding and extracting information from XML documents. This paper shows how the characteristics of this domain-specific language fits very well into the functional-logic paradi...
详细信息
XPath is a well-known query language for finding and extracting information from XML documents. This paper shows how the characteristics of this domain-specific language fits very well into the functional-logic paradigm. The proposed framework allows the user to write XPath-like queries as first-class citizens of the functional-logic language TOY, using higher-order combinators for constructing the queries and non-determinism in order to obtain the different answers that XPath queries can return. The result is a very good example of cross-fertilization of two different areas. In the case of TOY, the users can now integrate XML queries in their programs without using any external library or ad hoc interface. In the case of XPath, the use of higher-order patterns allow us to define functions for easily processing the queries. In particular, the paper shows how to trace and debug erroneous queries, and how to detect that a query is a refinement of another query, which can be useful for improving the efficiency of query processing.
In this paper, we present an extended relational calculus for expressing queries in functional-logic deductive databases. This calculus is based on first-order logic and handles relation predicates, equalities and ine...
详细信息
In this paper, we present an extended relational calculus for expressing queries in functional-logic deductive databases. This calculus is based on first-order logic and handles relation predicates, equalities and inequalities over partially defined terms, and approximation equations. For the calculus formulas, we have studied syntactic conditions in order to ensure the domain independence property. Finally, we have studied its equivalence w.r.t. the original query language, which is based on equality and inequality constraints.
暂无评论