Various forms of data aggregates, e.g., arrays, lists, sets, etc., are usually provided by programming languages, either as primitive entities or as additional features made available by standard libraries. In conventional programming languages these data structures are usually specified by completely and precisely enumerating all their constituent elements. Conversely, in (constraint) logic programming languages it is common to deal with partially specified aggregates where either some elements or some parts of the aggregate are left unknown. In this paper we consider the case where partially specified aggregates can occur in a conventional O-O programming language. Specifically, we consider partially specified lists and sets as provided by the Java library JSetL. The definition of such data structures is strongly based on the notion of logical (or constrained) variable usually provided by languages and libraries to support constraint programming. We show through simple examples using Java and JSetL how partially specified lists and sets, along with a few basic constraints over them, can be conveniently exploited in a number of common programming problems.
Programming with Partially Specified Aggregates in Java / Bergenti, Federico; Chiarabini, Luca; Rossi, Gianfranco. - In: COMPUTER LANGUAGES, SYSTEMS & STRUCTURES. - ISSN 1477-8424. - 37:4(2011), pp. 178-192. [10.1016/j.cl.2011.07.002]
Programming with Partially Specified Aggregates in Java
BERGENTI, Federico;CHIARABINI, Luca;ROSSI, Gianfranco
2011-01-01
Abstract
Various forms of data aggregates, e.g., arrays, lists, sets, etc., are usually provided by programming languages, either as primitive entities or as additional features made available by standard libraries. In conventional programming languages these data structures are usually specified by completely and precisely enumerating all their constituent elements. Conversely, in (constraint) logic programming languages it is common to deal with partially specified aggregates where either some elements or some parts of the aggregate are left unknown. In this paper we consider the case where partially specified aggregates can occur in a conventional O-O programming language. Specifically, we consider partially specified lists and sets as provided by the Java library JSetL. The definition of such data structures is strongly based on the notion of logical (or constrained) variable usually provided by languages and libraries to support constraint programming. We show through simple examples using Java and JSetL how partially specified lists and sets, along with a few basic constraints over them, can be conveniently exploited in a number of common programming problems.File | Dimensione | Formato | |
---|---|---|---|
reprint_CLSS11.pdf
non disponibili
Tipologia:
Documento in Post-print
Licenza:
NON PUBBLICO - Accesso privato/ristretto
Dimensione
236.69 kB
Formato
Adobe PDF
|
236.69 kB | Adobe PDF | Visualizza/Apri Richiedi una copia |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.