Reinforcement Learning with Non-Markovian Rewards.