Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider a database of facts that describe parent relationships as well as gender relationships. The predicate parent ( john , ann ) is interpreted as:
Consider a database of facts that describe parent relationships as well as gender relationships. The predicate parentjohnann is interpreted as: "John is a parent of Ann". The predicate malejohn is interpreted as: "John is a man". The predicate femaleann is interpreted as: "Ann is a woman".Create a prolog program relationshippl and include the following rules. parentjohnann parentjim,john parentfim,keithparentimnoraparentmary ann parentmarysylvia parentbriansylvia parentbrianbetty male keith male jim male brian femalesylvia femalebetty femaleann femalemaryNote that some things are not specified in the database above eg male johnNote that a true may be left blank if running on the gl server. Trailing false's after queries with two variables are okA points Add a Prolog predicate siblingX Y that is true if X and Y have the same mother or the same father. For instance user input is in
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started