The general theory in compositional semantics: The meaning of a phrase is determined by combining the meanings of its subphrases, using rules which are driven by the syntactic structure.
Nothing close to a complete compositional semantics for English is known; not least because nothing close to a complete meaning representation is known. (That is to say, we don't know what the output is supposed to be.)
Sentence: "John ate a ripe apple."
Syntax tree :
S ---> NP ---> Name ---> John | |-> VP ---> Verb ---> ate | |-> NP ---> Det ---> a | |-> Adj ---> ripe | |-> Noun ---> apple
Person(p1). Name(p1,"John"). Ripe(o1). Apple(o1). Event(e1,Eat). Actor(e1,p1). Object(e1,o1).
"apple" ---> Content: Apple. "ate". --> Content: Eat. "John" --> Create symbol S. Assert Person(S) and Name(S,"John"). Denotation = S.
Given: NP ---> Name ---> W. Denotation(NP) = Denotation(W).
Given: NP ---> Det | |-> Adj | ... |-> Adj | |-> Noun. Create a new symbol S. For each Adj/Noun P, assert P.Content(S). Denotation(NP) = S.
Given: S ---> NP1 | |-> VP ---> Verb | |-> NP2 Create a new symbol E. Assert Event(E,Verb.Content). Assert Actor(E,Denotation(NP1)) Assert Object