Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

concatenation of predicates (wihthout using lists)

My task is that given the following predicates
a('type1',5).
a('type1',7).
a('type1',8).
a('type2',9).
a('type2',3).
a('type2',11).

to consolidate the same type into a new predicates
a('type1','5 7 8').
a('type1','3 9 11').
( lets say the concatenation is based on numerical order)

... and I don't have LISTS in my implementation.

Is this possible?

Comments

  • List processing is one of the major powerful features of Prolog. Why would you want to not use it? At the very least, you'll want something like findall/3 to find the various 'type1's, and if you do avoid it, you'll wind up writing some atom concatenation predicates that work just like the existing list predicates.
Sign In or Register to comment.