×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Prolog rule query

Prolog rule query

Prolog rule query

(OP)
/* The structure of a market analysis unit takes the form:
analysis_unit(Principal, Analysts, Coordinator).
Analysts is an arbitrarily long list of staff_member structures,
but excludes the staff_member structures for Principal and
Coordinator.
staff_member structures take the form:
staff_member(Surname,Initial,cv(Open_cases,Title,Market_area)).
*/
analysis_unit(staff_member(fox,m,cv(10,dr,technology)),
[staff_member(lamb,d,cv(9,mr,pharmaceuticals)),
staff_member(bird,s,cv(5,ms,manufacturing))],
staff_member(swift,p,cv(5,mrs,pharmaceuticals))).

analysis_unit(staff_member(bing,m,cv(9,mrs,home_entertainment)),
[staff_member(bing,k,cv(6,mr,home_entertainment)),
staff_member(bing,l,cv(5,mr,home_entertainment)),
staff_member(bing,m,cv(4,ms,home_entertainment))],
staff_member(bing,a,cv(3,mr,home_entertainment))).

analysis_unit(staff_member(bessemer,p,cv(15,miss,transport)),
[staff_member(bunsen,e,cv(10,mr,public_sector)),
staff_member(liebig,b,cv(6,mr,shipping))],
staff_member(schott,e,cv(3,mrs,shipping))).

analysis_unit(staff_member(reeves,r,cv(8,dr,agriculture)),
[staff_member(shankley,f,cv(7,dr,automotive)),
staff_member(banks,b,cv(5,miss,healthcare)),
staff_member(stiles,m,cv(4,mr,publishing)),
staff_member(bonetti,j_p,cv(4,dr,diy))],
staff_member(moore,e,cv(7,ms,media))).

Im meant to find the surname of any principal in whose analysis unit all staff members have
the same surname and the same market area.

I keep bringing back 3 answers i.e the surname Bing which is the correct answer.

Any feedback/help would be much appreciated.

Regards

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close