9 research outputs found

    Unification and Matching on Compressed Terms

    Full text link
    Term unification plays an important role in many areas of computer science, especially in those related to logic. The universal mechanism of grammar-based compression for terms, in particular the so-called Singleton Tree Grammars (STG), have recently drawn considerable attention. Using STGs, terms of exponential size and height can be represented in linear space. Furthermore, the term representation by directed acyclic graphs (dags) can be efficiently simulated. The present paper is the result of an investigation on term unification and matching when the terms given as input are represented using different compression mechanisms for terms such as dags and Singleton Tree Grammars. We describe a polynomial time algorithm for context matching with dags, when the number of different context variables is fixed for the problem. For the same problem, NP-completeness is obtained when the terms are represented using the more general formalism of Singleton Tree Grammars. For first-order unification and matching polynomial time algorithms are presented, each of them improving previous results for those problems.Comment: This paper is posted at the Computing Research Repository (CoRR) as part of the process of submission to the journal ACM Transactions on Computational Logic (TOCL)

    Unification on Compressed Terms

    Get PDF
    First-order term unification is an essential concept in areas like functional and logic programming, automated deduction, deductive databases, artificial intelligence, information retrieval, compiler design, etc. We build upon recent developments in grammar-based compression mechanisms for terms and investigate algorithms for first-order unification and matching on compressed terms. We prove that the first-order unification of compressed terms is decidable in polynomial time, and also that a compressed representation of the most general unifier can be computed in polynomial time. Furthermore, we present a polynomial time algorithm for first-order matching on compressed terms. Both algorithms represent an improvement in time complexity over previous results [GGSS09, GGSS08]. We use several known results on the tree grammars used for compression, called singleton tree grammars (STG)s, like polynomial time computability of several subalgorithmms: certain grammar extensions, deciding equality of represented terms, and generating their preorder traversal. An innovation is a specialized depth of an STG that shows that unifiers can be represented in polynomial spac

    Linear Compressed Pattern Matching for Polynomial Rewriting (Extended Abstract)

    Full text link
    This paper is an extended abstract of an analysis of term rewriting where the terms in the rewrite rules as well as the term to be rewritten are compressed by a singleton tree grammar (STG). This form of compression is more general than node sharing or representing terms as dags since also partial trees (contexts) can be shared in the compression. In the first part efficient but complex algorithms for detecting applicability of a rewrite rule under STG-compression are constructed and analyzed. The second part applies these results to term rewriting sequences. The main result for submatching is that finding a redex of a left-linear rule can be performed in polynomial time under STG-compression. The main implications for rewriting and (single-position or parallel) rewriting steps are: (i) under STG-compression, n rewriting steps can be performed in nondeterministic polynomial time. (ii) under STG-compression and for left-linear rewrite rules a sequence of n rewriting steps can be performed in polynomial time, and (iii) for compressed rewrite rules where the left hand sides are either DAG-compressed or ground and STG-compressed, and an STG-compressed target term, n rewriting steps can be performed in polynomial time.Comment: In Proceedings TERMGRAPH 2013, arXiv:1302.599

    On Unification Modulo One-Sided Distributivity: Algorithms, Variants and Asymmetry

    Full text link
    An algorithm for unification modulo one-sided distributivity is an early result by Tid\'en and Arnborg. More recently this theory has been of interest in cryptographic protocol analysis due to the fact that many cryptographic operators satisfy this property. Unfortunately the algorithm presented in the paper, although correct, has recently been shown not to be polynomial time bounded as claimed. In addition, for some instances, there exist most general unifiers that are exponentially large with respect to the input size. In this paper we first present a new polynomial time algorithm that solves the decision problem for a non-trivial subcase, based on a typed theory, of unification modulo one-sided distributivity. Next we present a new polynomial algorithm that solves the decision problem for unification modulo one-sided distributivity. A construction, employing string compression, is used to achieve the polynomial bound. Lastly, we examine the one-sided distributivity problem in the new asymmetric unification paradigm. We give the first asymmetric unification algorithm for one-sided distributivity

    Variants of unification considering compression and context variables

    Get PDF
    Term unification is a basic operation in several areas of computer science, specially in those related to logic. Generally speaking, it consists on solving equations over expressions called terms. Depending on the kind of variables allowed to occur in the terms and under which conditions two terms are considered to be equal, several frameworks of unification such as first-order unification, higher-order unification, syntactic unification, and unification modulo theories can be distinguished. Moreover, other variants of term unification arise when we consider nontrivial representations for terms. In this thesis we study variants of the classic first-order syntactic term unification problem resulting from the introduction of context variables, i.e. variables standing for contexts, and/or assuming that the input is given in some kind of compressed representation. More specifically, we focus on two of such compressed representations: the well-known Directed Acyclic Graphs (DAGs) and Singleton Tree Grammars (STGs). Similarly as DAGs allow compression by exploiting the reusement of repeated instances of a subterm in a term, STGs are a grammar-based compression mechanism based on the reusement of repeated (multi)contexts. An interesting property of the STG formalism is that many operations on terms can be efficiently performed directly in their compressed representation thus taking advantage of the compression also when computing with the represented terms. Although finding a minimal STG representation of a term is computationally difficult, this limitation has been successfully overcome is practice, and several STG-compressors for terms are available. The STG representation has been applied in XML processing and analysis of Term Rewrite Systems. Moreover, STGs are a very useful concept for the analysis of unification problems since, roughly speaking, allow to represent solutions in a succinct but still efficiently verifiable form.La unificaci贸 de termes 茅s una operaci贸n b谩sica en diverses 脿rees de la inform谩tica, especialment en aquelles relacionades amb la l贸gica. En termes generals, consisteix en resoldre equacions sobre expressions anomenades termes. Depenent del tipus de variables que apareguin en els termes i de sota quines condicions dos termes s贸n considerats iguals, podem definir diverses variants del problema d'unificaci贸 de termes. A m茅s a m茅s, altres variants del problema d'unificaci贸 de termes sorgeixen quan considerem representacions no trivials per als termes. S'estudia variants del problema cl脿ssic d'unificaci贸 sint谩ctica de primer ordre resultants de la introducci贸 de variables de context i/o de l'assumpci贸 de que l'entrada 茅s donada en format comprimit. Ens centrem en l'estudi de dues representacions comprimides: els grafs dirigits ac铆clics i les gram脿tiques d'arbre singlet贸. Similarment a com els grafs dirigits ac铆clics permeten compressi贸 mitjan莽ant el re煤s d'inst脿ncies repetides d'un mateix subterme, les gram脿tiques d'arbres singlet贸 s贸n un sistema de compressi贸 basat en el re煤s de (multi)contexts. Una propietat interessant d'aquest formalisme 茅s que moltes de les operacions comuns sobre termes es poden realizar directament sobre la versi贸 comprimida d'aquests de forma eficient, sense cap mena de descompressi贸 pr猫via. Tot i que trobar una representaci贸 minimal d'un terme amb una gram谩tica singlet贸 茅s una tasca computacionalment dif铆cil, aquesta limitaci贸 ha estat resolta de forma satisfact貌ria en la pr脿ctica, hi ha disponibles diversos compressors per a termes. La representaci贸 de termes amb gram脿tiques singlet贸 ha estat 煤til per al processament de documents XML i l'an脿lisi de sistemes de reescriptura de termes. Les gram脿tiques singlet贸 s贸n concepte molt 煤til per a l'an脿lisi de problemas d'unificaci贸, ja que permeten representar solucions de forma comprimida sense renunciar a que puguin ser verificades de forma eficient. A la primera part d'aquesta tesi s'estudien els problemas d'unificaci贸 i matching de primer ordre sota l'assumpci贸 de que els termes de l'entrada s贸n representats fent servir gram脿tiques singlet贸. Presentem algorismes de temps polin貌mic per a aquests problemas, aix铆 com propostes d'implementacions i resultats experimentals. Aquests resultats s'utilitzen m茅s endevant en aquesta tesi per a l'an脿lisi de problemes d'unificaci贸 i matching amb variables de contexte i entrada comprimida. A la resta d'aquesta tesi ens centrem en variants d'unificaci贸 amb variables de contexte, que s贸n un cas particular de variables d'ordre superior. M茅s concretament, a la segona part d'aquesta tesi, ens centrem en un cas particular d'unificaci贸 de contextes on nom猫s es permet una sola variable de context en l'entrada. Aquest problema s'anomena "one context unification". Mostrem que aquest problema es pot resoldre en temps polin貌mic indeterminista, no nom茅s quan els termes de l'entrada s贸n representats de forma expl铆cita, sino tamb茅 quan es representen fent servir grafs dirigits ac铆clics i gram脿tiques singlet贸. Tamb茅 presentem un resultat parcial recent en la tasca de trobar un algorisme de temps polin貌mic per a one context unification. Al final de la tesi, estudiem el problema de matching per a entrades amb variables de contexte, que 茅s un cas particular d'unificaci贸 on nom茅s un dels dos termes de cada equaci贸 t茅 variables. En contrast amb el problema general, matching de contextes ha estat classificat com a problema NP-complet. Mostrem que matching de contextes 茅s NP-complet fins i tot quan es fan servir gram脿tiques com a formalisme de representaci贸 de termes. Aix貌 implica que afegir compressi贸 no ens porta a un augment dr脿stic de la complexitat del problema. Tamb茅 demostrem que la restricci贸 de matching de contextes on el nombre de variables de contexte est脿 afitat per una constant fixa del problema es pot resoldre en temps polin貌mic, fins i tot quan es fan servir grafs dirigits ac铆clics com formalisme de representaci贸 de terme

    Unification and matching on compressed terms

    No full text
    Term unification plays an important role in many areas of computer science, especially in those related to logic. The universal mechanism of grammar-based compression for terms, in particular the so-called singleton tree grammars (STGAs), have recently drawn considerable attention. Using STGs, terms of exponential size and height can be represented in linear space. Furthermore, the term representation by directed acyclic graphs (dags) can be efficiently simulated. The present article is the result of an investigation on term unification and matching when the terms given as input are represented using different compression mechanisms for terms such as dags and singleton tree grammars. We describe a polynomial time algorithm for context matching with dags, when the number of different context variables is fixed for the problem. For the same problem, NP-completeness is obtained when the terms are represented using the more general formalism of singleton tree grammars. For first-order unification and matching polynomial time algorithms are presented, each of them improving previous results for those problems.Peer Reviewe

    Unification on Compressed Terms

    No full text
    First-order term unification is an essential concept in areas like functional and logic programming, automated deduction, deductive databases, artificial intelligence, information retrieval, compiler design, etc. We build upon recent developments in grammar-based compression mechanisms for terms and investigate algorithms for first-order unification and matching on compressed terms. We prove that the first-order unification of compressed terms is decidable in polynomial time, and also that a compressed representation of the most general unifier can be computed in polynomial time. Furthermore, we present a polynomial time algorithm for first-order matching on compressed terms. Both algorithms represent an improvement in time complexity over previous results [GGSS09, GGSS08]. We use several known results on the tree grammars used for compression, called singleton tree grammars (STG)s, like polynomial time computability of several subalgorithmms: certain grammar extensions, deciding equality of represented terms, and generating their preorder traversal. An innovation is a specialized depth of an STG that shows that unifiers can be represented in polynomial spac
    corecore