Increasing widespread use of sensor and networking technologies are yielding ubiquitous sensors and applications that pervade daily life. At the same time, context-aware pervasive computing has experienced tremendous developments in terms of context modelling and reasoning, and applications. Such developments coupled with a cloud computing model are yielding sensor-cloudlets and context-cloudlets based on sensors and applications deployed as services that can be harnessed in applications on-demand, ad-hoc and on a pay-per-use model. Sensor-cloudlets and context-cloudlets depend on and adapt to the available resources at the time, and involve context-aware systems (including sensors) that need to be dynamically composed as needed. This paper first outlines current trends and key issues and challenges in sensor-cloudlets and context-cloudlets. We then present a key contribution of this paper, which is an application of an abstract model of context-aware systems for specifying compositions of context-aware systems used in sensor-cloudlets and context-cloudlets. We show how expressions in our formalism can be embedded into a programming language (which we show via an example extending the logic programming language Prolog). We then present numerous examples illustrating applications expressed in our extended Prolog language. We also show how compositions specified in our formalism supports estimating the reliability and cost of using such compositions of resources in computations, in a well-defined semantics. Finally, we describe meta-level control operators on evaluation of queries posed to compositions of resources and specify a service-based interface on context-aware systems. We conclude with issues to be tackled in the future.