diff options
Diffstat (limited to 'subprojects/store-query/src/main/java/tools/refinery/store/query/literal/Reduction.java')
-rw-r--r-- | subprojects/store-query/src/main/java/tools/refinery/store/query/literal/Reduction.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/Reduction.java b/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/Reduction.java new file mode 100644 index 00000000..ee155a9a --- /dev/null +++ b/subprojects/store-query/src/main/java/tools/refinery/store/query/literal/Reduction.java | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/> | ||
3 | * | ||
4 | * SPDX-License-Identifier: EPL-2.0 | ||
5 | */ | ||
6 | package tools.refinery.store.query.literal; | ||
7 | |||
8 | public enum Reduction { | ||
9 | /** | ||
10 | * Signifies that a literal should be preserved in the clause. | ||
11 | */ | ||
12 | NOT_REDUCIBLE, | ||
13 | |||
14 | /** | ||
15 | * Signifies that the literal may be omitted from the cause (if the model being queried is nonempty). | ||
16 | */ | ||
17 | ALWAYS_TRUE, | ||
18 | |||
19 | /** | ||
20 | * Signifies that the clause with the literal may be omitted entirely. | ||
21 | */ | ||
22 | ALWAYS_FALSE; | ||
23 | |||
24 | public Reduction negate() { | ||
25 | return switch (this) { | ||
26 | case NOT_REDUCIBLE -> NOT_REDUCIBLE; | ||
27 | case ALWAYS_TRUE -> ALWAYS_FALSE; | ||
28 | case ALWAYS_FALSE -> ALWAYS_TRUE; | ||
29 | }; | ||
30 | } | ||
31 | } | ||