Skip to content
Snippets Groups Projects
Commit b4eb388f authored by Mario Wenzel's avatar Mario Wenzel
Browse files

path3 for souffle

parent af0116ca
No related branches found
No related tags found
No related merge requests found
//
// par - "parent"/"edge" relation
//
.decl par (n:number, m:number)
.input par(IO=file, filename="INSTANCE")
// par(1,2).
// par(2,3).
//.decl path2 (n:number, m:number) output
.decl path3 (n:number, m:number)
//.output path2(IO=stdout)
.printsize path3
path3(X, Y) :- par(X, A), par(A, B), par(B, Y).
//
// par - "parent"/"edge" relation
//
.decl par (n:number, m:number)
.input par(IO=file, filename="INSTANCE")
// par(1,2).
// par(2,3).
//.decl path2 (n:number, m:number) output
.decl path2 (n:number, m:number)
.decl path3 (n:number, m:number)
//.output path2(IO=stdout)
.printsize path3
path2(X, Y) :- par(X, Z), par(Z, Y).
path3(X, Y) :- path2(X, Z), par(Z, Y).
//
// par - "parent"/"edge" relation
//
.decl par (n:number, m:number)
.input par(IO=file, filename="INSTANCE")
// par(1,2).
// par(2,3).
//.decl path2 (n:number, m:number) output
.decl path2 (n:number, m:number)
.decl path3 (n:number, m:number)
//.output path2(IO=stdout)
.printsize path3
path2(X, Y) :- par(X, Z), par(Z, Y).
path3(X, Y) :- par(X, Z), path2(Z, Y).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment