Question: using Prolog TUTORIAL 1 Start a new file in your text editor (call it family.pl), and copy and paste the above program into it. We
TUTORIAL 1 Start a new file in your text editor (call it "family.pl"), and copy and paste the above program into it. We can now formulate some queries (try entering these yourself): - Was George I the parent of Charles I? Query: parent (charles1, george1). - Who was Charles I's parent? Query: parent (charlesi, Parent). - Who were the children of Charles 1 ? Query: parent (Child, charlesi). Try adding the following rules to the program, and check the results: - M is the mother of P if she is a parent of P and is female - F is the father of P if he is a parent of P and is male - X is a sibling of Y if they both have the same parent. Remember that "and" in Prolog is represented using a comma. Also, the connection between predicates should be made by sharing variables (and not by embedding one predicate inside another)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
