3 research outputs found
A characterization of F-complete type assignments
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
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