The idea of pervasive computing is that information processing will become part of everyday life, and will be available everywhere, making computing so natural to the point of being
invisible
in the ambient. An important concept that arises with pervasive computing is
context awareness
. Context is any information that can be used to characterize an entity. Based on contextual information, applications can dynamically adapt themselves to the environments in which they operate. The Calculus of Context-aware Ambients (CCA) is an untyped formal language used to describe mobile and context-aware pervasive applications. The CCA extends the Ambient Calculus by providing new features, such as context-guarded action and process abstraction, allowing to model contexts and context-aware computations. In this work, we define a type system for the CCA, called
CCA
T
, with the focus in the communication between processes and in the correct use of process abstraction and contexts, extending previous works on the definition of type systems for mobile computing. Moreover, we prove that the proposed type system has the subject reduction property (or type preservation). We also model a hospital scenario using
CCA
T
to demonstrate the use of the proposed type system.