From Reasoning to Learning: A Survey on Hypothesis Discovery and Rule Learning with Large Language Models