Top-down Synthesis for Library Learning