문제

Is it possible to pose a query such as

?- X(C). 

that can return all the predicates that have arity 1? In general, is it possible to refer to a predicate name by using a variable?

도움이 되었습니까?

해결책

current_predicate(X/1). shows predicates with arity 1.

You can use call to call a goal from a variable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top