Sum-product networks: A survey