A database of Prolog facts for a group of people contains the following two types of facts: male([, , .. ] ). emale([, , ... ] ). ge( , ) E.g., male([alex, tom, vic, ..]). E.g., female([ann, sara, ella, ..]). E.g. age(ann, 66). For these facts write the following rules (you may use Prolog library functions): person(, ). gender(, gender>). oldest(, , ). neanAgeM(). count(, , ). Find the name and the age of a person Find the name and the gender (male or female) Find the name/age/gender of the oldest person Find the mean age of male people Find the number of male, female, and total people
A database of Prolog facts for a group of people contains the following two types of facts: male([, , .. ] ). emale([, , ... ] ). ge( , ) E.g., male([alex, tom, vic, ..]). E.g., female([ann, sara, ella, ..]). E.g. age(ann, 66). For these facts write the following rules (you may use Prolog library functions): person(, ). gender(, gender>). oldest(, , ). neanAgeM(). count(, , ). Find the name and the age of a person Find the name and the gender (male or female) Find the name/age/gender of the oldest person Find the mean age of male people Find the number of male, female, and total people
Chapter4: Analyzing And Charting Financial Data
Section4.2: Charts, Sparklines, And Data Bars
Problem 6QC
Related questions
Question
![A database of Prolog facts for a group of people contains the following two types of facts:
male([<name>, <name>, ... ] ).
female ([<name>, <name>, ... ] ).
age(<name> , <years>)
E.g., male([alex, tom, vic, ...]).
E.g., female([ann, sara, ella, ..]).
E.g. age(ann, 66).
For these facts write the following rules (you may use Prolog library functions):
person(<name>, <age>).
gender(<name>, gender>).
oldest(<name>, <age>, <gender>).
meanAgeM(<mean age>).
count(<male>, <female>, <total>).
Find the name and the age of a person
Find the name and the gender (male or female)
Find the name/age/gender of the oldest person
Find the mean age of male people
Find the number of male, female, and total people](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4f5c7d21-e0e1-478f-8fe8-1bf4008ab0f1%2Fce41e9dc-37ec-42f8-81ff-2dd2d5a39143%2Fww06qt_processed.png&w=3840&q=75)
Transcribed Image Text:A database of Prolog facts for a group of people contains the following two types of facts:
male([<name>, <name>, ... ] ).
female ([<name>, <name>, ... ] ).
age(<name> , <years>)
E.g., male([alex, tom, vic, ...]).
E.g., female([ann, sara, ella, ..]).
E.g. age(ann, 66).
For these facts write the following rules (you may use Prolog library functions):
person(<name>, <age>).
gender(<name>, gender>).
oldest(<name>, <age>, <gender>).
meanAgeM(<mean age>).
count(<male>, <female>, <total>).
Find the name and the age of a person
Find the name and the gender (male or female)
Find the name/age/gender of the oldest person
Find the mean age of male people
Find the number of male, female, and total people
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage