Synthesizing world models for bilevel planning