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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple prolog problem (beginner need urgent help)

Status
Not open for further replies.

alfredao2000

Technical User
Dec 29, 2010
1
GB
Hey, I am trying to learn prolog but i have few problems. I have some excercises to practice but as i said i have problems with it. Its pretty basic for the specialists but as I said already I am complete beginner.

Ok let me describe my problem:
I have got a database of facts:
bank_income(bank, income)
bank_employees(bank, no_of_employees)
bank_society_1(bank)
bank_society_2(bank)

And now what I need to do is:
1. add up the total income for all of the banks from bank_income(bank, income)
2. show if the entered bank is member of the bank_society_1(bank), bank_society_2(bank),neither or is not a bank.
3. function that displays if the banks are in order of income - bank_income(bank, income)
4. function that displays if the banks are in order of number of employees - bank_employees(bank, no_of_employees).

I hope that you will be able to help me. It will help me to understand it better on working examples, thank you for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top