A Type System for Tom

Extending a given language with new dedicated features is a general and quite used approach to make the programming language more adapted to problems. Being closer to the application, this leads to less programming flaws and easier maintenance. But of course one would still like to perform program a...

Full description

Bibliographic Details
Main Authors: Claude Kirchner, Pierre-Etienne Moreau, Cláudia Tavares
Format: Article
Language:English
Published: Open Publishing Association 2010-03-01
Series:Electronic Proceedings in Theoretical Computer Science
Online Access:http://arxiv.org/pdf/1003.4799v1
id doaj-304256fc04a34abfb5d110e18db45a52
record_format Article
spelling doaj-304256fc04a34abfb5d110e18db45a522020-11-25T00:00:30ZengOpen Publishing AssociationElectronic Proceedings in Theoretical Computer Science2075-21802010-03-0121Proc. RULE 2009516310.4204/EPTCS.21.5A Type System for TomClaude KirchnerPierre-Etienne MoreauCláudia TavaresExtending a given language with new dedicated features is a general and quite used approach to make the programming language more adapted to problems. Being closer to the application, this leads to less programming flaws and easier maintenance. But of course one would still like to perform program analysis on these kinds of extended languages, in particular type checking and inference. In this case one has to make the typing of the extended features compatible with the ones in the starting language. The Tom programming language is a typical example of such a situation as it consists of an extension of Java that adds pattern matching, more particularly associative pattern matching, and reduction strategies. This paper presents a type system with subtyping for Tom, that is compatible with Java's type system, and that performs both type checking and type inference. We propose an algorithm that checks if all patterns of a Tom program are well-typed. In addition, we propose an algorithm based on equality and subtyping constraints that infers types of variables occurring in a pattern. Both algorithms are exemplified and the proposed type system is showed to be sound and complete. http://arxiv.org/pdf/1003.4799v1
collection DOAJ
language English
format Article
sources DOAJ
author Claude Kirchner
Pierre-Etienne Moreau
Cláudia Tavares
spellingShingle Claude Kirchner
Pierre-Etienne Moreau
Cláudia Tavares
A Type System for Tom
Electronic Proceedings in Theoretical Computer Science
author_facet Claude Kirchner
Pierre-Etienne Moreau
Cláudia Tavares
author_sort Claude Kirchner
title A Type System for Tom
title_short A Type System for Tom
title_full A Type System for Tom
title_fullStr A Type System for Tom
title_full_unstemmed A Type System for Tom
title_sort type system for tom
publisher Open Publishing Association
series Electronic Proceedings in Theoretical Computer Science
issn 2075-2180
publishDate 2010-03-01
description Extending a given language with new dedicated features is a general and quite used approach to make the programming language more adapted to problems. Being closer to the application, this leads to less programming flaws and easier maintenance. But of course one would still like to perform program analysis on these kinds of extended languages, in particular type checking and inference. In this case one has to make the typing of the extended features compatible with the ones in the starting language. The Tom programming language is a typical example of such a situation as it consists of an extension of Java that adds pattern matching, more particularly associative pattern matching, and reduction strategies. This paper presents a type system with subtyping for Tom, that is compatible with Java's type system, and that performs both type checking and type inference. We propose an algorithm that checks if all patterns of a Tom program are well-typed. In addition, we propose an algorithm based on equality and subtyping constraints that infers types of variables occurring in a pattern. Both algorithms are exemplified and the proposed type system is showed to be sound and complete.
url http://arxiv.org/pdf/1003.4799v1
work_keys_str_mv AT claudekirchner atypesystemfortom
AT pierreetiennemoreau atypesystemfortom
AT claudiatavares atypesystemfortom
AT claudekirchner typesystemfortom
AT pierreetiennemoreau typesystemfortom
AT claudiatavares typesystemfortom
_version_ 1725444719731802112