Notably, z is unobserved, and we instead observe only the answer y, which is obtained by evaluating z on a world/database w. There are an exponential number of possible trees z, and usually dynamic programming can be used to efficiently search over trees.
in our learning setting (independent of the semantic formalism), we must enforce the global constraint that z produces y.