6 research outputs found

    Context unification with one context variable

    Get PDF
    AbstractThe context unification problem is a generalization of standard term unification. It consists of finding a unifier for a set of term equations containing first-order variables and context variables. In this paper we analyze the special case of context unification where the use of at most one context variable is allowed and show that it is in NP. The motivation for investigating this subcase of context unification is interprocedural program analysis for programs described using arbitrary terms, generalizing the case where terms were restricted to using unary function symbols. Our results imply that the redundancy problem is in coNP, and that the finite redundancy property holds in this case. We also exhibit particular cases where one context unification is polynomial

    Context unification is in PSPACE

    Full text link
    Contexts are terms with one `hole', i.e. a place in which we can substitute an argument. In context unification we are given an equation over terms with variables representing contexts and ask about the satisfiability of this equation. Context unification is a natural subvariant of second-order unification, which is undecidable, and a generalization of word equations, which are decidable, at the same time. It is the unique problem between those two whose decidability is uncertain (for already almost two decades). In this paper we show that the context unification is in PSPACE. The result holds under a (usual) assumption that the first-order signature is finite. This result is obtained by an extension of the recompression technique, recently developed by the author and used in particular to obtain a new PSPACE algorithm for satisfiability of word equations, to context unification. The recompression is based on performing simple compression rules (replacing pairs of neighbouring function symbols), which are (conceptually) applied on the solution of the context equation and modifying the equation in a way so that such compression steps can be in fact performed directly on the equation, without the knowledge of the actual solution.Comment: 27 pages, submitted, small notation changes and small improvements over the previous tex

    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)

    One Context Unification Problems Solvable in Polynomial Time

    Get PDF

    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
    corecore