Magic Sets for the Bottom-Up Evaluation of Finitely Recursive Programs