Question: Remember the zip function of Haskell? It can be defined in Haskell as: zip:: [ a ] [ b ] [ ( a , b

Remember the zip function of Haskell? It can be defined in Haskell as:
zip::[a][b][(a,b)]
zip-[]=[]
zip[]-=[]
zip(x:xs)(y:ys)=(x,y): zip xsys
Formulate the appropriate Prolog rule zipp(xs,Ys,Zs) which is true if Zs is the result of "zipping" together xs and Ys. That is, the query zip([1,2,3],[4,5],[(1,4),(2,5)]). would evaluate to true, or the query zip([1,2],[4,5,6],Zs). would give Zs=[(1,4),(2,5)].
Hint: again, this rule will have two base cases and a recursive case analogous to the three cases of the above Haskell function.
 Remember the zip function of Haskell? It can be defined in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!