Skip to content

Commit

Permalink
fix bug isDisjoined
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Wagner committed Mar 7, 2024
1 parent 8bcfcd3 commit 64fe9e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/org/rascalmpl/library/Set.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,10 @@ isDisjoined({{1,2}, {1,4}, {1,6}});
}
public bool isDisjoined(set[set[&T]] sets) {
list[set[&T]] setsAsList = toList(sets);
pairs = {};
for (elem1 <- setsAsList) {
for (elem2 <- setsAsList[1..]) {
if (elem1 & elem2 != {}) return false;

for (elem1 <- [0..size(setsAsList)-1]) {
for (elem2 <- [elem1+1..size(setsAsList)]) {
if (setsAsList[elem1] & setsAsList[elem2] != {}) return false;
}
}

Expand Down

0 comments on commit 64fe9e7

Please sign in to comment.