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.
Computer Science & Information Technology
You might also like to view...
A(n) ________ is a special kind of variable used to refer to one of the pieces of data provided in a method
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology
The _____________ is the FSMO that holds the only writeable copy of the Active Directory schema
a. RID master b. PDC emulator c. Infrastructure master d. None of the above.
Computer Science & Information Technology