3 research outputs found

    A characterization of F-complete type assignments

    Get PDF
    AbstractThe aim of this paper is to investigate the soundness and completeness of the intersection type discipline (for terms of the (untyped Ī»-calculus) with respect to the F-semantics (F-soundness and F-completeness).As pointed out by Scott, if D is the domain of a Ī³-model, there is a subset F of D whose elements are the ā€˜canonicalā€™ representatives of functions. The F-semantics of types takes into account that theintuitive meaning of ā€œĻƒā†’Ļ„ā€ is ā€˜the type of functions with domain Ļƒ and range Ļ„ā€™ and interprets Ļƒā†’Ļ„ as a subset of F.The type theories which induce F-complete type assignments are characterized. It follows that a type assignment is F-complete iff equal terms get equal types and, whenever M has a type Ļ•āˆ§Ļ‰n, where Ļ• is a type variable and Ļ• is the ā€˜universalā€™ type, the term Ī»z1ā€¦znā€¦Mz1ā€¦zn has type Ļ•. Here we assume that z1ā€¦z.n do not occur free in M

    XQTC: A Static Type-Checker for XQuery Using Backward Type Inference

    Get PDF
    We present a novel technique and a tool for static type-checking of XQuery programs. The tool looks for errors in the program by jointly analyzing the source code of the program, input and output schemas that respectively describe the sets of documents admissible as input and as output of the program. The crux and the novelty of our results reside in the joint use of backward type inference and a two-way logic to represent inferred tree type portions. This allowed us to design and implement a type-checker for XQuery which is more precise and supports a larger XQuery fragment compared to the approaches previously proposed in the literature; in particular compared to the only few actually implemented static type-checkers such as the one in Galax. The whole system uses compilers and a satisfiability solver for deciding containment for two-way regular tree expressions. Our tool takes an XQuery program and two schemas Sin and Sout as input. If the program is found incorrect, then it automatically generates a counter-example valid w.r.t. Sin and such that the program produces an invalid output w.r.t Sout. This counter-example can be used by the programmer to fix the program.Nous preĢsentons une technique nouvelle et un outil pour le controĢ‚le de type statique des programmes XQuery. L'outil recherche les erreurs dans le programme en analysant aĢ€ la fois le code source du programme et les scheĢmas d'entreĢe et de sortie qui deĢcrivent respectivement les ensembles de documents admissibles en entreĢe et en sortie. L'originaliteĢ de nos reĢsultats reĢside dans l'utilisation conjointe de l'infeĢrence de type arrieĢ€re et d'une logique avec programmes inverses pour repreĢsenter des fragments de types d'arbre. Cela nous a permis de concevoir et de reĢaliser un controĢ‚leur de type pour XQuery qui est plus preĢcis et supporte un fragment de XQuery plus large que les approches proposeĢes preĢceĢdemment dans la litteĢrature, en particulier si on se reĢfeĢ€re aux quelques controĢ‚leurs de type statiques effectivement reĢaliseĢs, tel que celui de Galax. L'ensemble du systeĢ€me utilise des compilateurs et un solveur pour deĢcider de l'inclusion des expressions d'arbres reĢgulieĢ€res bi-directionnelles. Notre outil prend en entreĢe un programme XQuery et deux scheĢmas Sin et Sout. Si le programme est reconnu incorrect, l'outil engendre automatiquement un contre-exemple valide vis-aĢ€-vis de Sin et tel que le programme produise un reĢsultat invalide vis-aĢ€-vis de Sout. Ce contre-exemple peut alors eĢ‚tre utiliseĢ par le programmeur pour corriger son programme
    corecore