Carlos Camarão
Universidade Federal de Minas Gerais
Network
Latest external collaboration on country level. Dive into details by clicking on the dots.
Publication
Featured researches published by Carlos Camarão.
principles and practice of declarative programming | 2004
Carlos Camarão; Lucília Figueiredo; Cristiano D. Vasconcellos
This article discusses the problem of constraint-set satisfiability (CSSAT) --- that is, the problem of determining whether a given constraint-set is satisfiable in a given typing context --- in the context of systems with support for overloading and parametric polymorphism. The paper reviews previous works on constraint-set satisfiability, showing that overloading policies used in order to guarantee decidability of CSSAT have been generally too restrictive. An algorithm is proposed that does not impose a severe restriction on possible overloadings and decides CSSAT in an expectedly vast majority of cases of practical interest. In cases for which satisfiability cannot be decided, a configurable limit on the number of iterations is used to guarantee termination.
international symposium on functional and logic programming | 1999
Carlos Camarão; Lucília Figueiredo
This article presents a type system based on the Damas-Milner system [DM82], that supports overloading. Types of overloaded symbols are constrained polymorphic types. The work is related to Haskell type classes [Wad89,NP93,HHJW96], System O [OWW95] and other similar type systems [Kae88,Smi91,Jon94,DCO96]. Restrictions imposed in these systems with respect to overloading are eliminated. User-defined global and local overloading is supported without restrictions. There is no need for declarations or annotations of any sort. No language construct is added in order to cope with overloading. The type system uses a context-dependent overloading policy, specified by a predicate used in a single inference rule. Overloading of functions defined over different type constructors is supported, as done with Haskell’s constructor classes. No monomorphism restriction is required in order to solve ambiguity problems. The system uses an open-world approach, in which new overloaded definitions can be introduced with types automatically reflecting the new definitions. The article also presents a type inference algorithm for the system, which is proved to be sound and to compute principal typings.
international conference of the chilean computer science society | 2001
Pedro Ivo Oliveira; Carlos Camarão
This work describes an implementation of a system for adapting the contents of HTML Web pages so that they can be shown adequately in mobile devices with WML microbrowsers. The article reports on the experience of using a lazy functional programming language and, in particular, compilation by composition of monadic combinators, in the development of a practical application in a modern and emerging technological area.
Brazilian Symposium on Programming Languages | 2016
Raul Lopes; Rodrigo Ribeiro; Carlos Camarão
We describe the formalization of a certified algorithm for regular expression parsing based on Brzozowski derivatives, in the dependently typed language Idris. The formalized algorithm produces a proof that an input string matches a given regular expression or a proof that no matching exists. A tool for regular expression based search in the style of the well known GNU grep has been developed with the certified algorithm, and practical experiments were conducted with this tool.
Science of Computer Programming | 2016
Carlos Camarão; Lucília Figueiredo; Rodrigo Ribeiro
A precise characterization of overloading resolution and ambiguity.Discussion of the standard as well as Haskells open-world definitions of ambiguity.Definition and discussion of an approach for ambiguity detection that is delayed until after overloading resolution. This paper considers the problem of ambiguity in Haskell-like languages. Overloading resolution is characterized in the context of constrained polymorphism by the presence of unreachable variables in constraints on the type of the expression. A new definition of ambiguity is presented, where existence of more than one instance for the constraints on an expression type is considered only after overloading resolution. This introduces a clear distinction between ambiguity and overloading resolution, makes ambiguity more intuitive and independent from extra concepts, such as functional dependencies, and enables more programs to type-check as fewer ambiguities arise.The paper presents a type system and a type inference algorithm that includes: a constraint-set satisfiability function, that determines whether a given set of constraints is entailed or not in a given context, focusing on issues related to decidability, a constraint-set improvement function, for filtering out constraints for which overloading has been resolved, and a context-reduction function, for reducing constraint sets according to matching instances. A standard dictionary-style semantics for core Haskell is also presented.
Proceedings of the 19th Brazilian Symposium on Programming Languages - Volume 9325 | 2015
Adelaine Gelain; Cristiano D. Vasconcellos; Carlos Camarão; Rodrigo Ribeiro
Nowadays the support of generalized algebraic data types GADTs in extensions of Haskell allows functions defined over GADTs to be written without the need for type annotations in some cases and requires type annotations in other cases. In this paper we present a type inference algorithm for GADTs that is based on a closed-world approach to overloading and uses anti-unification and constraint-set satisfiability to infer the relationship between the types of function arguments and result. Through some examples, we show how the proposed algorithm allows more functions defined over GADTs to be written without the need for type annotations.
Journal of the Brazilian Computer Society | 2013
Rodrigo Ribeiro; Carlos Camarão; Lucília Figueiredo
Algorithms for constraint set satisfiability and simplification of Haskell type class constraints are used during type inference in order to allow the inference of more accurate types and to detect ambiguity. Unfortunately, both constraint set satisfiability and simplification are in general undecidable, and the use of these algorithms may cause non-termination of type inference. This paper presents algorithms for these problems that terminate on any given input, based on the use of a criterion that is tested on each recursive step. The use of this criterion eliminates the need of imposing syntactic conditions on Haskell type class and instance declarations in order to guarantee termination of type inference in the presence of multi-parameter type classes, and allows program compilation without the need of compiler flags for lifting such restrictions. Undecidability of the problems implies the existence of instances for which the algorithm incorrectly reports unsatisfiability, but we are not aware of any practical example where this occurs.
Brazilian Symposium on Programming Languages | 2016
Rodrigo Ribeiro; Carlos Camarão; Lucília Figueiredo; Cristiano D. Vasconcellos
This paper explores an approach for allowing type classes to be optionally declared by programmers, i.e. programmers can overload symbols without declaring their types in type classes.
brazilian symposium on formal methods | 2015
Rodrigo Ribeiro; Carlos Camarão
Unification is the core of type inference algorithms for modern functional programming languages, like Haskell. As a first step towards a formalization of a type inference algorithm for such programming languages, we present a formalization in Coq of a type unification algorithm that follows classic algorithms presented in programming language textbooks.
Journal of the Brazilian Computer Society | 2013
Rodrigo Ribeiro; Lucília Figueiredo; Carlos Camarão
As computer programs become increasingly complex, techniques for ensuring trustworthiness of information manipulated by them become critical. In this work, we use the Coq proof assistant to formalise a