Making Large Language Models into World Models with Precondition and Effect Knowledge