Wow,Thomas,you are a genius.Thank you :D :D The "DCG" is perfectly solved beyond my expectation. And I have tested the ";" again.There is a problem here.When I define such a predicate: class predicates fact:(integer N, integer Res) procedure (i,o). clauses fact(N, F) :- (N<=1,F=1...