% XY Example 2. Floyd's Algorithm % "Negation and Aggregates in Recursive Rules: the LDL++ Approach", DOOD 93. database ( { g(X:string, Y:string, C:integer) }). export delta(I, X, Y, C). delta(0, X, X, 0) <- g(X,_,_). delta(0, Y, Y, 0) <- g(_,Y,_). delta(J+1, X, Z, min_all) <- delta(J,X,Y,C1), g(Y,Z,C2), C=C1+C2, if (all(J,X,Z,C3) then C3>C). all(J+1, X, Z, C) <- all(J,X,Z,C), ~delta(J+1, X, Z, _). all(J, X, Z, C) <- delta(J, X, Z, C).