From a155f6ba02e08a75ce6e474a86900b8363f506e8 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 29 Sep 2021 02:45:57 +0200 Subject: build: migration to Gradle 7 --- .../data/model/representation/TruthValue.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 store/src/main/java/org/eclipse/viatra/solver/data/model/representation/TruthValue.java (limited to 'store/src/main/java/org/eclipse/viatra/solver/data/model/representation/TruthValue.java') diff --git a/store/src/main/java/org/eclipse/viatra/solver/data/model/representation/TruthValue.java b/store/src/main/java/org/eclipse/viatra/solver/data/model/representation/TruthValue.java new file mode 100644 index 00000000..aeccde9e --- /dev/null +++ b/store/src/main/java/org/eclipse/viatra/solver/data/model/representation/TruthValue.java @@ -0,0 +1,44 @@ +package org.eclipse.viatra.solver.data.model.representation; + +public class TruthValue { + public static final TruthValue True = new TruthValue("true"); + public static final TruthValue False = new TruthValue("false"); + public static final TruthValue Unknown = new TruthValue("unknown"); + public static final TruthValue Error = new TruthValue("error"); + + private final String name; + protected TruthValue(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public static TruthValue toTruthValue(boolean value) { + if(value) return True; + else return False; + } + public boolean isConsistent() { + return this != Error; + } + public boolean isComplete() { + return this != Unknown; + } + public boolean must() { + return this == True || this == Error; + } + public boolean may() { + return this == True || this == Unknown; + } + + public TruthValue not() { + if(this == True) { + return False; + } else if(this == False) { + return True; + } else { + return this; + } + } +} -- cgit v1.2.3-70-g09d2