Express the query of Exercise 13.22 in Datalog.
What will be an ideal response?
Here the student needs to explore the arithmetic operators of Datalog. We use the usual operator is, which evaluates arithmetic expressions.
First, we de?ne the transitive closure of DirectFlight:
Flight(?F,?T,?Dist) :- DirectFlight(?F,?T,?Dist).
Flight(?F,?T,?D) :-
DirectFlight(?F,?I,?D1), Flight(?I,?T,?D2),
?D is ?D1+?D2.
The required query is now
?- Flight(?F,?T,?Dist), ?Dist < 10000.
You might also like to view...
For security reasons, the path in a URL normally represents a(n) ________ on the server.
a. Actual directory. b. Virtual directory. c. File. d. None of the above.
The ________ data type holds items that can have one of two possible values
A) Number B) Yes/No C) Memo D) Text
When a thumbnail is right-clicked, the Rename Layout option appears on the shortcut menu only when the ________ is displayed
Fill in the blank(s) with correct word
Selection, bubble, and insertion are simple sort methods that work well for small- and medium-sized arrays.
Answer the following statement true (T) or false (F)