From c1d95995af58bc33dddfb80d9ddf00a9174ced6c Mon Sep 17 00:00:00 2001 From: Miles Vella <673-vella@users.noreply.gitlab.cs.uni-duesseldorf.de> Date: Fri, 14 Feb 2025 14:16:44 +0100 Subject: [PATCH] fix subset of bool compile and logic errors --- .../src/main/java/de/hhu/stups/btypes/BSet.java | 17 ++++++++++++++--- .../src/main/java/de/hhu/stups/btypes/BSet.java | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/btypes_big_integer/src/main/java/de/hhu/stups/btypes/BSet.java b/btypes_big_integer/src/main/java/de/hhu/stups/btypes/BSet.java index f190d5266..068d11a96 100755 --- a/btypes_big_integer/src/main/java/de/hhu/stups/btypes/BSet.java +++ b/btypes_big_integer/src/main/java/de/hhu/stups/btypes/BSet.java @@ -337,9 +337,9 @@ public class BSet<T> implements BObject, Set<T> { return result; } - public BBoolean subsetOfInteger() { + public BBoolean subsetOfBoolean() { for(T e : this) { - if(e instanceof BInteger) { + if(e instanceof BBoolean) { return new BBoolean(true); } else { return new BBoolean(false); @@ -349,7 +349,7 @@ public class BSet<T> implements BObject, Set<T> { } public BBoolean strictSubsetOfBoolean() { - return subsetOfBoolean(); + return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2); } public BBoolean notSubsetOfBoolean() { @@ -364,6 +364,17 @@ public class BSet<T> implements BObject, Set<T> { return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2); } + public BBoolean subsetOfInteger() { + for(T e : this) { + if(e instanceof BInteger) { + return new BBoolean(true); + } else { + return new BBoolean(false); + } + } + return new BBoolean(true); + } + public BBoolean strictSubsetOfInteger() { return subsetOfInteger(); } diff --git a/btypes_primitives/src/main/java/de/hhu/stups/btypes/BSet.java b/btypes_primitives/src/main/java/de/hhu/stups/btypes/BSet.java index 88d290907..281c01e07 100755 --- a/btypes_primitives/src/main/java/de/hhu/stups/btypes/BSet.java +++ b/btypes_primitives/src/main/java/de/hhu/stups/btypes/BSet.java @@ -353,7 +353,7 @@ public class BSet<T> implements Set<T>, BObject { } public BBoolean strictSubsetOfBoolean() { - return subsetOfBoolean(); + return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2); } public BBoolean notSubsetOfBoolean() { -- GitLab