Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List problems

Status
Not open for further replies.

Samantha2323

Programmer
Joined
Apr 17, 2010
Messages
6
Location
US
Hello,

I am new in prolog ... I know how to solve simple list problems, but when it comes to complex problems I get stuck

I need to do this ... but I am stuck please guide how to start up

The map_pairs_to_kval_list predicate takes a list of <key,value> pairs and generates a list of values for each key, <key, val1, val2,...>, preserving the order of keys and values. For example:

?- map_pairs_to_kval_list([[jack,a], [jack,b], [jack,f], [jill,cplus],[jill,aminus],[jack,a],[jack,w],[jill,aminus]], X).
X = [[jack,a,b,f,a,w],[jill,cplus,aminus,aminus]]

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top