The Relation between Logic and Functional Languages: A Survey