License
when quoting this document, please refer to the following
DOI: 10.4230/LIPIcs.ICLP.2011.62
URN: urn:nbn:de:0030-drops-31718
URL: http://drops.dagstuhl.de/opus/volltexte/2011/3171/

Zombori, Zsolt ; Csorba, János ; Szeredi, Péter

Static Type Checking for the Q Functional Language in Prolog

pdf-format:
Dokument 1.pdf (459 KB)


Abstract

We describe an application of Prolog: a type checking tool for the Q functional language. Q is a terse vector processing language, a descendant of APL, which is getting more and more popular, especially in financial applications. Q is a dynamically typed language, much like Prolog. Extending Q with static typing improves both the readability of programs and programmer productivity, as type errors are discovered by the tool at compile time, rather than through debugging the program execution. We designed a type description syntax for Q and implemented a parser for both the Q language and its type extension. We then implemented a type checking algorithm using constraints. As most built-in function names of Q are overloaded, i.e. their meaning depends on the argument types, a quite complex system of constraints had to be implemented. Prolog proved to be an ideal implementation language for the task at hand. We used Definite Clause Grammars for parsing and Constraint Handling Rules for the type checking algorithm. In the paper we describe the main problems solved and the experiences gained in the development of the type checking tool.

BibTeX - Entry

@InProceedings{zombori_et_al:LIPIcs:2011:3171,
  author =	{Zsolt Zombori and J{\'a}nos Csorba and P{\'e}ter Szeredi},
  title =	{{Static Type Checking for the Q Functional Language in Prolog}},
  booktitle =	{Technical Communications of the 27th International Conference on Logic Programming (ICLP'11) },
  pages =	{62--72},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-939897-31-6},
  ISSN =	{1868-8969},
  year =	{2011},
  volume =	{11},
  editor =	{John P. Gallagher and Michael Gelfond},
  publisher =	{Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{http://drops.dagstuhl.de/opus/volltexte/2011/3171},
  URN =		{urn:nbn:de:0030-drops-31718},
  doi =		{http://dx.doi.org/10.4230/LIPIcs.ICLP.2011.62},
  annote =	{Keywords: logic programming, types, static type checking, constraints, CHR, DCG}
}

Keywords: logic programming, types, static type checking, constraints, CHR, DCG
Seminar: Technical Communications of the 27th International Conference on Logic Programming (ICLP'11)
Issue date: 2011
Date of publication: 27.06.2011


DROPS-Home | Fulltext Search | Imprint Published by LZI