Completed

Prolog: test list membership without using built in libraries/logic

I need prolog logic that determines if two lists have any elements in common. For example, if I have a list containing numbers [2,4,5,6,8] and a second list containing numbers [1,3,5,6,9] this will return true because they have 5 and 6 in common. However, [1,2,3] and [5,6,8] will return false because there are no common elements between these lists.

ex:

?- similarity([2,4,5,6,8], [1,3,5,6,9]).

true.

?- similarity([1,2,3], [5,6,8]).

false.

NO BUILT IN LOGIC. that includes disjoint, membership, intersection, etc.

I NEED THIS ASAP, BY TOMORROW. thanks.

Skills: Prolog

See more: append 2 prolog, prolog append element to list, permutation prolog, prolog program to append a list with another list, prolog return list, prolog recursion list, prolog list functions, simple prolog exercises, list pages using html 401 transitional, updating custom list sharepoint using workflow, examples test loan repayments using excel, list services using effects, dynamic list box using ajax javascript, email list outlook using net 2005, select country list state using option list php, prepare test summary reports using qtp, email contact current list membership work conpanyhotmailcom, import contacts list hotmail using, fixture list team using html tags, getting contact list gmail using

About the Employer:
( 1 review ) huntsville, United States

Project ID: #19252121

Awarded to:

omalexsolutions

Hello there! I already implemented what you ask for in swi-prolog, I can give it to you right now. If it's another implementation of Prolog, I have to see if I can convert it, but in principle I should be able to. Hope More

$30 USD in 1 day
(1 Review)
0.2