aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/logic/src/main/java/tools/refinery/logic/literal/Reduction.java
blob: 1f7d9a2fcd3ba0da66d4ed57f8dcedafd923ea8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package tools.refinery.logic.literal;

public enum Reduction {
	/**
	 * Signifies that a literal should be preserved in the clause.
	 */
	NOT_REDUCIBLE,

	/**
	 * Signifies that the literal may be omitted from the cause (if the model being queried is nonempty).
	 */
	ALWAYS_TRUE,

	/**
	 * Signifies that the clause with the literal may be omitted entirely.
	 */
	ALWAYS_FALSE;

	public Reduction negate() {
		return switch (this) {
			case NOT_REDUCIBLE -> NOT_REDUCIBLE;
			case ALWAYS_TRUE -> ALWAYS_FALSE;
			case ALWAYS_FALSE -> ALWAYS_TRUE;
		};
	}
}