Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section4.2: Charts, Sparklines, And Data Bars
Problem 6QC
icon
Related questions
Question
Consider the following Prolog program: edge(a, b). edge(c, d). edge(a, c). edge(c, b). edge(X, Y) :- edge(Y, X). path(X, X). path(X, Y) :- edge(Z, Y), path(X, Z).

Note that this program is nearly identical to one presented in lecture except for the inclusion of the extra rule:

edge(X, Y) :- edge(Y, X).

The intent is that, with this additional rule, the program should model an undirected (as opposed to directed) graph.

(a) Execute the query: ?- edge(a,b). What response do you get?
(b) Execute the query ?- edge(b,a). What response do you get?
(c) Execute the query ?- edge(a, d). What response do you get? And why?
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Sorting
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage