[SOLVED] 代写 prolog database You will probably need to download a version of the programming language

30 $

File Name: 代写_prolog_database_You_will_probably_need_to_download_a_version_of_the_programming_language.zip
File Size: 894.9 KB

SKU: 6351512123 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


You will probably need to download a version of the programming language
Prolog. I recommend SWI Prolog because the documentation/tutorial is
excellent. https://www.swi-prolog.org/ (Links to an external site.)
There are two familial relations in this assignment: nth child and nth cousin, k
times removed.
For now, you’re going to write about your family. If necessary, make up some more family members so you can properly test these predicates. Include at least 4 generations, and at least 15 family members.
Remember that nth cousins share a common great^n-grandparent, where n is
the same for both cousins. If the common ancestor is n steps from cousin1 and k steps from cousin2, and n > k, then cousin1 and cousin2 are
kth cousins, n – k times removed. Now define predicates for the following familial relations:
• parent
• child
• sibling
• nth cousin
• nth cousin k-times-removed
• grandparent.
You will also need a way of discussing age (e.g., age(Mary,X)).
In your knowledge base, include as facts only the child relation, and age of each of at least 15 people in your family. Do not state as facts any other relations. For the sake of simplicity, do not use twins, triplets, etc., or find a way of specifying age that will distinguish everyone’s age.
Now (in script mode) query the program to find all pairs of nth cousins k times removed. Note that k and n are effectively bounded by the number of
generations in your geneology database. Your query should have 4 variables: N, K, and X and Y (the nth cousins k times removed). Your query should look like
|-? nthcousinkremoved(X,Y,N,K).
Next, still in script mode, find all kth children of each parent, where K is a variable, as is the variable for the kth child. Your query should look like |-? kthchild(C,P,K).
To submit

Your geneological database, your code, and the script of your queries. Also a brief statement of what you’ve learned.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 代写 prolog database You will probably need to download a version of the programming language
30 $