cool reduction of CFG parsing into matrix multiplication