Compositionality is a principle in linguistics and logic stating that the meaning of a complex expression is determined by the meanings of its constituent expressions and the rules used to combine them. This principle underlies the systematic nature of language and is essential for understanding and generating novel sentences.