Manifest Contracts for Datatypes

التفاصيل البيبلوغرافية
العنوان: Manifest Contracts for Datatypes
المؤلفون: Taro Sekiyama, Yuki Nishida, Atsushi Igarashi
المصدر: POPL
بيانات النشر: ACM, 2015.
سنة النشر: 2015
مصطلحات موضوعية: business.industry, Semantics (computer science), Computer science, Programming language, Type (model theory), Translation (geometry), computer.software_genre, Software, Simple (abstract algebra), TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS, Algebraic data type, business, Programmer, computer, Type constructor
الوصف: We study algebraic data types in a manifest contract system, a software contract system where contract information occurs as refinement types. We first compare two simple approaches: refinements on type constructors and refinements on data constructors. For example, lists of positive integers can be described by {l:int list | for_all (lambda y. y > 0) l} in the former, whereas by a user-defined datatype pos_list with cons of type {x:int | x > 0} X pos_list -> pos_list in the latter. The two approaches are complementary: the former makes it easier for a programmer to write types and the latter enables more efficient contract checking. To take the best of both worlds, we propose (1) a syntactic translation from refinements on type constructors to equivalent refinements on data constructors and (2) dynamically checked casts between different but compatible datatypes such as int list and pos_list. We define a manifest contract calculus to formalize the semantics of the casts and prove that the translation is correct.
DOI: 10.1145/2676726.2676996
URL الوصول: https://explore.openaire.eu/search/publication?articleId=doi_________::c18fd60ba5a386ed7de97c05ad51c524
https://doi.org/10.1145/2676726.2676996
Rights: CLOSED
رقم الانضمام: edsair.doi...........c18fd60ba5a386ed7de97c05ad51c524
قاعدة البيانات: OpenAIRE