In semantics, mathematical logic and related disciplines, the principle of compositionality (also known as semantic compositionalism) is the principle that the meaning of a complex expression is determined by the meanings of its constituent expressions and the rules used to combine them. The principle is also called Frege's principle, because Gottlob Frege is widely credited for the first modern formulation of it. However, the principle has never been explicitly stated by Frege, and arguably it was already assumed by George Boole decades before Frege's work.
While widely adopted in formal semantic theory, the principle of compositionality faces challenges from linguistic phenomena such as contextuality, idiomatic expressions, and quotations, which appear to defy straightforward compositional analysis.