In this paper, we propose a method allowing us to compare the result of an execution of a logic program and a specification of the intended semantics. This approach is particularly interesting when the set of answers cannot be computed in finite time with usual prolog interpreters. We compute, using a special operational mechanism, a finite set of rewrite rules synthesizing the whole set of answers w.r.t. a goal. Then, we use some tree tuple grammar based techniques to express the languages of the computed answers. An algorithm allows us to compare this language with the intended semantics language which is extracted from a user's specification. This method can be considered as a partial validation mechanism for logic programs.