Skip to content

Commit

Permalink
Combine min aggregate tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
remysucre committed May 31, 2022
1 parent 124b04d commit dd9c087
Show file tree
Hide file tree
Showing 23 changed files with 168 additions and 83 deletions.
4 changes: 1 addition & 3 deletions tests/semantic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ positive_test(logical)
positive_test(lrg_attr_id)
positive_test(lrg_rel_id1)
positive_test(lrg_rel_id2)
positive_test(min_aggregate)
positive_test(max_aggregate)
positive_test(sum_aggregate)
positive_test(negative_numbers)
positive_test(not_copy1)
positive_test(not_copy2)
Expand All @@ -149,6 +146,7 @@ positive_test(records6)
positive_test(records7)
positive_test(records8)
positive_test(records9)
positive_test(recursive_aggregate)
negative_test(recursive_unions)
negative_test(recursive_unions2)
positive_test(rel_copy_cycles)
Expand Down
3 changes: 0 additions & 3 deletions tests/semantic/max_aggregate/facts/edge.facts

This file was deleted.

16 changes: 0 additions & 16 deletions tests/semantic/max_aggregate/max_aggregate.dl

This file was deleted.

3 changes: 0 additions & 3 deletions tests/semantic/max_aggregate/path.csv

This file was deleted.

4 changes: 0 additions & 4 deletions tests/semantic/min_aggregate/facts/edge.facts

This file was deleted.

16 changes: 0 additions & 16 deletions tests/semantic/min_aggregate/min_aggregate.dl

This file was deleted.

Empty file.
Empty file.
16 changes: 0 additions & 16 deletions tests/semantic/min_aggregate/path.csv

This file was deleted.

15 changes: 15 additions & 0 deletions tests/semantic/recursive_aggregate/facts/dag.facts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
a b 1
a c 2
a d 3
a e 4
a f 4
b c 3
b d 2
b e 3
b f 3
c d 3
c e 4
c f 4
d e 5
d f 1
e f 6
36 changes: 36 additions & 0 deletions tests/semantic/recursive_aggregate/facts/graph.facts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
a a 1
a b 1
a c 2
a d 3
a e 4
a f 4
b a 1
b b 2
b c 3
b d 2
b e 3
b f 3
c a 2
c b 3
c c 4
c d 3
c e 4
c f 4
d a 3
d b 2
d c 3
d d 2
d e 5
d f 1
e a 4
e b 3
e c 4
e d 5
e e 6
e f 6
f a 4
f b 3
f c 4
f d 1
f e 6
f f 2
15 changes: 15 additions & 0 deletions tests/semantic/recursive_aggregate/max_path.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
e f 6
d e 5
d f 11
c d 3
c e 8
c f 14
b c 3
b d 2
b e 7
b f 13
a b 1
a c 4
a d 7
a e 12
a f 18
15 changes: 15 additions & 0 deletions tests/semantic/recursive_aggregate/min_path.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
a b 1
a c 2
a d 3
a e 4
a f 4
b c 3
b d 2
b e 3
b f 3
c d 3
c e 4
c f 4
d e 5
d f 1
e f 6
36 changes: 36 additions & 0 deletions tests/semantic/recursive_aggregate/min_path_c.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
a a 1
a b 1
a c 2
a d 3
a e 4
a f 4
b a 1
b b 2
b c 3
b d 2
b e 3
b f 3
c a 2
c b 3
c c 4
c d 3
c e 4
c f 4
d a 3
d b 2
d c 3
d d 2
d e 5
d f 1
e a 4
e b 3
e c 4
e d 5
e e 6
e f 6
f a 4
f b 3
f c 4
f d 1
f e 6
f f 2
35 changes: 35 additions & 0 deletions tests/semantic/recursive_aggregate/recursive_aggregate.dl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Souffle - A Datalog Compiler
// Copyright (c) 2016, The Souffle Developers. All rights reserved
// Licensed under the Universal Permissive License v 1.0 as shown at:
// - https://opensource.org/licenses/UPL
// - <souffle root>/licenses/SOUFFLE-UPL.txt

.decl dag(x:symbol, y:symbol, c:number)
.input dag

.decl max_path(x:symbol, y:symbol, c:number) btree_max
.output max_path

max_path(x, y, c) :- dag(x, y, c).
max_path(x, y, c1+c2) :- max_path(x, z, c1), dag(z, y, c2).

.decl min_path(x:symbol, y:symbol, c:number) btree_min
.output min_path

min_path(x, y, c) :- dag(x, y, c).
min_path(x, y, c1+c2) :- min_path(x, z, c1), dag(z, y, c2).

.decl sum_path(x:symbol, y:symbol, c:number) btree_sum
.output sum_path

sum_path(x, y, c) :- dag(x, y, c).
sum_path(x, y, c1+c2) :- sum_path(x, z, c1), dag(z, y, c2).

.decl graph(x:symbol, y:symbol, c:number)
.input graph

.decl min_path_c(x:symbol, y:symbol, c:number) btree_min
.output min_path_c

min_path_c(x, y, c) :- graph(x, y, c).
min_path_c(x, y, c1+c2) :- min_path_c(x, z, c1), graph(z, y, c2).
15 changes: 15 additions & 0 deletions tests/semantic/recursive_aggregate/sum_path.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
a b 1
a c 6
a d 15
a e 48
a f 84
b c 3
b d 8
b e 28
b f 63
c d 3
c e 12
c f 14
d e 5
d f 12
e f 6
3 changes: 0 additions & 3 deletions tests/semantic/sum_aggregate/facts/edge.facts

This file was deleted.

3 changes: 0 additions & 3 deletions tests/semantic/sum_aggregate/path.csv

This file was deleted.

16 changes: 0 additions & 16 deletions tests/semantic/sum_aggregate/sum_aggregate.dl

This file was deleted.

Empty file.
Empty file.

0 comments on commit dd9c087

Please sign in to comment.