From b4eb388f65aa7823c5ca25ecc0bab8bfa21a514f Mon Sep 17 00:00:00 2001 From: Mario Wenzel <maweki@gmail.com> Date: Mon, 7 Oct 2019 14:47:30 +0200 Subject: [PATCH] path3 for souffle --- souffle/path3f.dl | 15 +++++++++++++++ souffle/path3l.dl | 17 +++++++++++++++++ souffle/path3r.dl | 17 +++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 souffle/path3f.dl create mode 100644 souffle/path3l.dl create mode 100644 souffle/path3r.dl diff --git a/souffle/path3f.dl b/souffle/path3f.dl new file mode 100644 index 0000000..99b7149 --- /dev/null +++ b/souffle/path3f.dl @@ -0,0 +1,15 @@ + +// +// 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). diff --git a/souffle/path3l.dl b/souffle/path3l.dl new file mode 100644 index 0000000..a2044d8 --- /dev/null +++ b/souffle/path3l.dl @@ -0,0 +1,17 @@ + +// +// 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). diff --git a/souffle/path3r.dl b/souffle/path3r.dl new file mode 100644 index 0000000..0f7f03f --- /dev/null +++ b/souffle/path3r.dl @@ -0,0 +1,17 @@ + +// +// 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). -- GitLab