How to build predicate-argument structures

Consider as an example the test sentence "dogs have fleas". "Have" is a two place predicate: "Ly.Lx.have(x,y)", while the semantics of "dogs" and "fleas" is just "dogs" and "fleas", respectively. The phrase structure rules are as follows:

S -> NP VP : a f
VP -> V NP : f a

In these rules, "f" stands for "function", and "a" stands for "argument". This is how you tell the parser which node's semantics get "applied" (that's my technical term) to which other node's semantics. For the rule VP -> V NP, we see that V is the "f", and NP is the "a". Since our lexicon looks like

dogs NP : dogs
fleas NP : fleas
have V : Ly.Lx.have(x,y)

we know that when we apply the phrase structure rule VP -> V NP, the "f" is the semantics of the verb: "Ly.Lx.have(x,y)", and the "a" is the semantics of the NP: "fleas". So the semantics of the VP node is "Ly.Lx.have(x,y)" applied to "fleas". The reduction of this looks like the following:

"Ly.Lx.have(x,y)" applied to "fleas"
= "Lx.have(x,y)", where y = "fleas"
= "Lx.have(x,fleas)"

So the semantics of the VP node is "Lx.have(x,fleas)". In the next phrase structure rule applied, S -> NP VP, the "f" and "a" are in the reverse order: here, it is the *second* daughter, VP, which is the function, and the NP which is its argument. Once we know this, however, the actual application of the function to the argument is virtually identical:

"Lx.have(x,fleas)" applied to "dogs"
= "have(x,fleas)", where x = "dogs"
= "have(dogs,fleas)"

This is the semantics of the mother S node, and therefore of the entire sentence.