He agreed with John.
He agreed with John being the leader.
He agreed with the person representing the union.
This could mean that he agreed with the person, or agreed that the person could represent the union. If the object is unique, such as
He agreed with John representing the union.
This isnt
He agreed with the particular John who was representing the union.
So it must be
He agreed with the representation of the union by John.
He agreed with the person representing the union that the situation was not ideal.
The clause trumps any other meaning, but the clause can be very far away, requiring that we set up a context to search for it.
He agreed with the person from head office representing the electrical union covering half our work force that the situation was not ideal.
This is an example of the Relation Octopus, where the relation has arms which interact.
We have
They agreed.
They agreed the bridge should be closed.
They agreed that the bridge should be closed.
They agreed with John.
This is the same as They and John agreed a subject group.
They agreed with John being leader.
They agreed with John from accounting, with no experience, being made leader.
They agreed with the lawyer representing the union.
Are they agreeing with the lawyer who is representing the union, or agreeing that the union can be represented by the lawyer? This ambiguity does not arise if the participial adds no specificity, as
They agreed with John representing the union.
A comma can signal a definite participial
They agreed with John, representing the union.
Or a clause
They agreed with John, representing the union was difficult.
They agreed with the lawyer representing the union that the bridge should be closed.
They agreed with the lawyer representing the union that the court had disqualified.
Need to distinguish between relative pronoun clauses and clausal pronoun clauses.
Some other prepositions -
They agreed on John.
They agreed on John being the leader.
They agreed on the price.
(they were both involved in determining the price)They agreed to the demands.
(they agreed to accept the demands)They agreed to John being the leader.
The necessity for switching alternatives on and off requires us to make a model of ToAgree, then have the model sit at the relation and use the context (the presence or absence of a clausal clause, the issue of specificity of a participial) to resolve what is meant. There will be other relations requiring this detailed approach, but how many? A few or even a few tens out of a few thousand relations can be easily handled.