I was reading @_at's blog post about toki pona noun phrases and, thought that I, in the spirit of @zearen's post about underfilling, would make a similar discussion-oriented post about the semantics of phrases (not just noun phrases, at least also verb phrases) in toki pona.
Abstract algebra
First of all, the reason for the "algebra" in the title is that abstract algebra seems to me to be exactly the tool we need in order to formalize "how things combine together". And it can be very abstract indeed: rooted full binary trees whose leaves are members of a set are the free magma on that set, so any way of parsing a noun phrase into a (rooted and full) binary tree and then composing the elements together into a single value in a way where every internal node uses the same operation can be described algebraically.
However, we probably want something a bit more structured than just a magma. For example, we can consider "pi" as separating noun phrases into two "simple noun phrases", and we could interpret each simple noun phrase as the intersection of the semantic spaces of each of its words. Then, the algebra of simple noun phrases would be both commutative and associative: a commutative semigroup. If we consider "ijo" to be completely non-specific (for the record, I have no idea if this is actually reasonable, it's just for illustration purposes), then we have an identity element, which gets us from a (commutative) semigroup to a (commutative) monoid. Similar considerations apply to how simple noun phrases combine with each other.
In this way, we can think of the type of algebra we want based on the properties it satisfies. Even if we can't use intersection directly (consider "sitelen sitelen" which with intersection is no different from just "sitelen"), we probably still want simple noun phrases to be done with at least a semigroup. We can also go the other way: if ona's nasin distinguishes, say, "soweli jan" and "jan soweli", then we know that we don't have commutativity. As another example, the fact that people avoid multiple "pi" due to perceived ambiguity is an indication that the algebra of how simple noun phrases combine with each other might not be associative!
Special behavior of "ala"
I submit for your consideration an example that, if you consider it grammatical and it can mean what I'm trying to use it to mean, either shows that not even all simple noun phrases are restrictive, or that "ala" needs to be treated differently at the syntax level (which @_at already argued in the case of noun phrases without "pi"): "soweli pi jan ala", for non-person beasts. This time, "jan ala" cannot refer to the set of all "jan", instead (I propose), "ala" is a negation operator in some sense, most obviously but not necessarily set complementation, meaning that "soweli pi jan ala" would refer to the set of soweli which are not jan, which is what we (or at least I) wanted.