This paper characterizes the polynomial time learnability of TPk, the class of collections of at most k rst-order terms. A collection in TPk denes the union of the languages dened by each rst-order terms in the set. Unfortunately, the class TPk is not polynomial time learnable in most of learning frameworks under standard assumptions in computational complexity theory. To overcome this computational hardness, we relax the learning problem by allowing a learning algorithm to make membership queries. We present a polynomial time algorithm that exactly learns every concept in TPk using O(kn) equivalence and O(k2 n 1 maxfk;ng) membership queries, where n is the size of longest counterexample given so far. In the proof, we use a technique of replacing each restricted subset query by several membership queries under some condition on a set of function symbols. As corollaries, we obtain the polynomial time PAC-learnability and the polynomial time predictability of TPk when membership quer...