We achieve this by defining weight functions that output zero if any of the input vectors is not one-hot.
we define the weight function of the production rule A BC as: where are one-hot vectors (which are zero everywhere with the exception of a single 1 at the x-th index of a x , the y-th index of b y , and the z-th index of c z ) and Θ A BC is multiplied sequentially by c, b, and a.