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

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section4.2: Charts, Sparklines, And Data Bars
Problem 6QC
icon
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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Computational Systems
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage