Finding the position of an element within a nested list in Prolog

后端 未结 0 502
既然无缘
既然无缘 2020-12-14 02:32

For example:

?- position([[b,c,f],[a,d,g],[h,e]],c,P)
P=1
?- position([[b,c,f],[a,d,g],[h,e]],g,P)
P=2 

I\'ve been looking at the nth0/3 pred

相关标签:
回答
  • 消灭零回复
提交回复
热议问题