2016-06-13 6 views

答えて

4

これはSWIを使用してのために働くかもしれません:

find_functor(Functor, Args):- 
length(Args, Len), 
current_functor(Functor, Len), 
Functor \=':', % Dismiss :/2 
Term =.. [Functor|Args], 
predicate_property(Term, number_of_rules(0)), % It's a fact 
\+ predicate_property(Term, imported_from(_)), % not from a module 
clause(Term, true). 

、あなたが問い合わせることができ

?- find_functor(Functor, [a,b]). 
Functor = functor ; 
Functor = functor2