Compositional Law Parsing with Latent Random Functions