Question: Consider the ( directed ) network on the left - hand side, below. We could represent this network with the set of Prolog statements on
Consider the directed network on the lefthand side, below. We could represent this network with the set of Prolog statements on the righthand side, below.
ink
ink
ink
ink
link
link
link
link
link
Now, given this network, we say that there is a connection from a node to a node if we can get from to via a series of links. For example, in this network, there is a connection from a to d and a connection from to etc.
s Formulate the appropriate Prolog rule connection which is true if there is a connection from to as described above note that this rule will be recursive. Test this rule out on the above network, to see if it is working correctly.
Once it is working correctly, you will note that, eg the query connectionae will give true multiple times. This means something, actually. this mean?
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
