Send
Close Add comments:
(status displays here)
Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
A6: Asmt#6: Prolog family tree
You are not logged in. Go to
Login page.
You need to login before you can view more content.(content omitted that requires login)
4. A6: Prolog family tree
175: Asmt#6: Prolog family tree , Name: ___________________________
CS 340, Fall 2019, York College of Pennsylvania
178, 40 points, 2019-11-08 (due by midnight)
5. Problem to solve
There is no document required for this assignment.
6. Program requirement
Create a Prolog program, with file extension
.pro, that meets the following requirements.
Include a fact database (intensional Datalog database) of your specific family tree, using the facts male, female, and parent. This database should include immediate members of your family, to include at least three generations. All names of people in your family tree should be string literals.
Include a rule database (extensional Datalog database) for a generic family tree. Include rules for the following.: grandfather, grandmother, grandson, granddaughter, cousin, niece and nephew.
Include a query that will list all pairs of cousins in your family tree. Explain your output for the query.
Include an explanatory program comment before each group of facts on the line before the first fact.
Include an explanatory program comment for each rule on the line before the rule.
7. Program comments
Comments should be interspersed above each domain group and each constrain group explaining what is being done or what constraint is being specified.
8. Result comment
Note: You need to run the program, then copy-paste the output to the program before submission.
9. Multi-line comments
In Prolog, a multi-line comment starts with a "
/*" and ends with a "
*/" as in the following.
% This is a single line comment
/*
This is a
multi-line
comment.
*/
10. Comment guidelines
The begin comment "/*" and end comment "*/" should be on separate lines and not combined with other text.
The single line comment starts with a "%" and continues until the end of the line. Such comments should be on a line by themselves and not combined with other parts of a Prolog program.
11. Prolog code
Create a Prolog program using TuProlog to solve the requirements.
The
prints predicate should appear at the top and be used for printing as in the examples in the notes.
Your program should include the following line at the bottom.
:- solve(go).
12. Required file attachment
Attach the Prolog file, extension
pro, (and only one Prolog file) to your email message.
Submit by sending an email to
rsnyder9@ycp.edu from your YCP email address/account that has the above file as an attachment.
The subject line should be the following (and only the following).
198
13. General comments
Here are some general comments.
Some students did not include the cousins output (in comments).
Some students did not include the cousins explanation (in comments).
14. Scoring rubric
CS 340 - A6 : Asmt#6: Prolog family tree
Your grade: _ / 40
[LATE] Late or redo penalty: _ / -40
fact database with comments: _ / 10
rule database with comments: _ / 10
cousins query and output: _ / 10
cousins output explanation: _ / 10
Comments:
15. End of page