Express the query of Exercise 13.19 in Datalog.

What will be an ideal response?


First, we de?ne the transitive closure of DirectFlight:


Flight(?F,?T) :- DirectFlight(?F,?T).
Flight(?F,?T) :- DirectFlight(?F,?I), Flight(?I,?T).


Then we de?ne the required query:

FlightsWithTwoOrMoreStops(?F,?T) :-
DirectFlight(?F,?S1),
DirectFlight(?S1,?S2),
Flight(?S2,?T).

Computer Science & Information Technology

You might also like to view...

Explain how an administrator can see a detailed display of the kernel's version number.

What will be an ideal response?

Computer Science & Information Technology

For what is the Atanasoft–Berry Computer best known?

a. It was the first computer to use vacuum tubes instead of mechanical switches. b. It was the first computer to use the binary system. c. It was the first computer to incorporate a magnetic tape system. d. It was the first computer used as a mechanical calculator.

Computer Science & Information Technology

Shill bidding at an auction occurs when a fraudster accepts payment for an item and then fails to deliver it

Indicate whether the statement is true or false.

Computer Science & Information Technology

A data ____ table describes the fields you plan to maintain in a table.

A. structure B. definition C. map D. linked

Computer Science & Information Technology