Ambiguity and context-dependent overloading.
dc.contributor.author | Ribeiro, Rodrigo Geraldo | |
dc.contributor.author | Figueiredo, Carlos Camarão de | |
dc.date.accessioned | 2017-07-27T15:42:43Z | |
dc.date.available | 2017-07-27T15:42:43Z | |
dc.date.issued | 2013 | |
dc.description.abstract | This paper discusses ambiguity in the context of languages that support context-dependent overloading, such as Haskell. A type system for a Haskell-like programming language that supports context-dependent overloading and follow the Hindley-Milner approach of providing contextfree type instantiation, allows distinct derivations of the same type for ambiguous expressions. Such expressions are usually rejected by the type inference algorithm, which is thus not complete with respect to the type system. Also, Haskell’s open world approach considers a definition of ambiguity that does not conform to the existence of two or more distinct type system derivations for the same type. The article presents an alternative approach, where the standard definition of ambiguity is followed. A type system is presented that allows only context-dependent type instantiation, enabling only one type to be derivable for each expression in a given typing context: the type of an expression can be instantiated only if required by the program context where the expression occurs. We define a notion of greatest instance type for each occurrence of an expression, which is used in the definition of a standard dictionary-passing semantics for core Haskell based on type system derivations, for which coherence is trivial. Type soundness is obtained as a result of disallowing all ambiguous expressions and all expressions involving unsatisfiability in the use of overloaded names. Following the standard definition of ambiguity, satisfiability is tested—i.e., “the world is closed” —if only if overloading is (or should have been) resolved, that is, if and only if there exist unreachable variables in the constraints on types of expressions. Nowadays, satisfiability is tested in Haskell, in the presence of multiparameter type classes, only upon the presence of functional dependencies or an alternative mechanism that specifies conditions for closing the world, and that may happen when there exist or not unreachable type variables in constraints. The satisfiability trigger condition is then given automatically, by the existence of unreachable variables in constraints, and does not need to be specified by programmers, using an extra mechanism. | pt_BR |
dc.identifier.citation | RIBEIRO, R. G.; FIGUEIREDO, C. C. de. Ambiguity and context-dependent overloading. Journal of the Brazilian Computer Society, v. 19, n. 3, p. 313-324, set. 2013. Disponível em: <https://link.springer.com/article/10.1007/s13173-013-0103-0>. Acesso em: 27 jul. 2017. | pt_BR |
dc.identifier.doi | https://doi.org/10.1007/s13173-013-0103-0 | |
dc.identifier.issn | 1678-4804 | |
dc.identifier.uri | http://www.repositorio.ufop.br/handle/123456789/8349 | |
dc.identifier.uri2 | https://link.springer.com/article/10.1007/s13173-013-0103-0 | pt_BR |
dc.language.iso | en_US | pt_BR |
dc.rights | restrito | pt_BR |
dc.subject | Type systems | pt_BR |
dc.subject | Semantics | pt_BR |
dc.title | Ambiguity and context-dependent overloading. | pt_BR |
dc.type | Artigo publicado em periodico | pt_BR |
Arquivos
Pacote original
1 - 1 de 1
Nenhuma Miniatura Disponível
- Nome:
- ARTIGO_AmbiguityContextDependent.pdf
- Tamanho:
- 1.01 MB
- Formato:
- Adobe Portable Document Format
Licença do pacote
1 - 1 de 1
Nenhuma Miniatura Disponível
- Nome:
- license.txt
- Tamanho:
- 924 B
- Formato:
- Item-specific license agreed upon to submission
- Descrição: