License
when quoting this document, please refer to the following
DOI: 10.4230/LIPIcs.ICLP.2012.119
URN: urn:nbn:de:0030-drops-36150
URL: http://drops.dagstuhl.de/opus/volltexte/2012/3615/

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

Static Type Inference for the Q language using Constraint Logic Programming

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


Abstract

We describe an application of Prolog: a type inference 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 map the task of type inference onto a constraint satisfaction problem and use constraint logic programming, in particular the Constraint Handling Rules extension of Prolog. We determine the possible type values for each program expression and detect inconsistencies. 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.

BibTeX - Entry

@InProceedings{zombori_et_al:LIPIcs:2012:3615,
  author =	{Zsolt Zombori and J{\'a}nos Csorba and P{\'e}ter Szeredi},
  title =	{{Static Type Inference for the Q language using Constraint Logic Programming}},
  booktitle =	{Technical Communications of the 28th International Conference on Logic Programming (ICLP'12)},
  pages =	{119--129},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-939897-43-9},
  ISSN =	{1868-8969},
  year =	{2012},
  volume =	{17},
  editor =	{Agostino Dovier and V{\'i}tor Santos Costa},
  publisher =	{Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{http://drops.dagstuhl.de/opus/volltexte/2012/3615},
  URN =		{urn:nbn:de:0030-drops-36150},
  doi =		{http://dx.doi.org/10.4230/LIPIcs.ICLP.2012.119},
  annote =	{Keywords: logic programming, types, static type checking, CSP, CHR, Q language}
}

Keywords: logic programming, types, static type checking, CSP, CHR, Q language
Seminar: Technical Communications of the 28th International Conference on Logic Programming (ICLP'12)
Issue date: 2012
Date of publication: 27.07.2012


DROPS-Home | Fulltext Search | Imprint Published by LZI