Question: You should use SWI Prolog software to write your code. Q 3 ( 2 0 pts ) . Use Prolog to represent a simple directed
You should use SWI Prolog software to write your code.
Q pts Use Prolog to represent a simple directed graph. Define edges between nodes in a
graph using edge if there is and edge from a to
Add the edges of the graph above as the facts. Write a rule to check if there is a path between
two nodes. Write queries to check if there is a path from to from to from to from
to e from fto a
Q pts Write a Prolog code to return the length of a list. Run a query to get the length of
Write your query and Prolog answer to your Word document.
Q pts Write a Prolog code to check whether given three values satisfy the triangle
inequality or nor. It states that, for any triangle with sides of lengths and the following
inequalities must hold: Run five queries to check whether the
following triplets satisfy triangle inequality or not:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
