aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/logic/src/main/java/tools/refinery/logic/term/bool/BoolTerms.java
blob: 5bdc32071ec0e1d76c0ac1d26cf6ceca77e07790 (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
32
33
34
35
/*
 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package tools.refinery.logic.term.bool;

import tools.refinery.logic.term.ConstantTerm;
import tools.refinery.logic.term.Term;

public final class BoolTerms {
	private BoolTerms() {
		throw new IllegalArgumentException("This is a static utility class and should not be instantiated directly");
	}

	public static Term<Boolean> constant(Boolean value) {
		return new ConstantTerm<>(Boolean.class, value);
	}

	public static Term<Boolean> not(Term<Boolean> body) {
		return new BoolNotTerm(body);
	}

	public static Term<Boolean> and(Term<Boolean> left, Term<Boolean> right) {
		return new BoolAndTerm(left, right);
	}

	public static Term<Boolean> or(Term<Boolean> left, Term<Boolean> right) {
		return new BoolOrTerm(left, right);
	}

	public static Term<Boolean> xor(Term<Boolean> left, Term<Boolean> right) {
		return new BoolXorTerm(left, right);
	}
}