Learning to Reason with Third-Order Tensor Products