The function ∆ can be defined recursively, where pr(n) is the grammar production at node n and preterm(n) returns true if n is a pre-terminal node.
we can employ any kind of valid kernel in this procedure as long as its gradients can be computed.