If I had the predicate cat(dog(cow(a,b,c)))
, how I can transform this into cat(dog(cow([a,b,c])))
?
I was thinking about the system s predicate =..
but it doesn t end properly, because I obtain cat([dog([cow([a,b,c])])])
, and that s not that I want :(
The patch needs to fix also other similar case as dog(cat(a,b,c))
into dog(cat([a,b,c]))
.
任何人都有想法? Or maybe I m与运营商做过错......
我的想法是:
animal(X) :- atomic(X).
animal(X) :- atomic([]).
cow(X) :-
animal(X),
cow([X|List]).
dog(X) :-
animal(X),
dog([X|List]).
cat(X) :-
animal(X),
cat([X|List]).
感谢