The composition of Fregean thoughts