aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/logic/src/main/java/tools/refinery/logic/AbstractValue.java
blob: 0b5e0d012fe41d928a2bd8194ee0488bee5ed3a7 (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
/*
 * SPDX-FileCopyrightText: 2024 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package tools.refinery.logic;

import org.jetbrains.annotations.Nullable;

public interface AbstractValue<A extends AbstractValue<A, C>, C> {
	@Nullable
	C getConcrete();

	default boolean isConcrete() {
		return getConcrete() == null;
	}

	@Nullable
	C getArbitrary();

	default boolean isError() {
		return getArbitrary() == null;
	}

	A join(A other);

	A meet(A other);

	default boolean isRefinementOf(A other) {
		return equals(meet(other));
	}
}