From 41f68094f0f2d699aa6d1a1189cb2fd346c5486d Mon Sep 17 00:00:00 2001 From: AdamZsofi Date: Thu, 29 Aug 2024 15:30:14 +0200 Subject: [PATCH] cleaning up before trace metadata --- .../algorithm/tracegeneration/MetaTrace.kt | 24 ------------------- .../tracegeneration/TraceGenerationChecker.kt | 7 ++---- .../tracegeneration/TraceMetadata.kt | 16 +++++++++++++ 3 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/MetaTrace.kt create mode 100644 subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceMetadata.kt diff --git a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/MetaTrace.kt b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/MetaTrace.kt deleted file mode 100644 index dd511ac8f1..0000000000 --- a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/MetaTrace.kt +++ /dev/null @@ -1,24 +0,0 @@ -package hu.bme.mit.theta.analysis.algorithm.tracegeneration - -import hu.bme.mit.theta.analysis.State -import hu.bme.mit.theta.analysis.algorithm.ArgNode -import java.util.* - -data class StateMetadata(val state: S, val id: Int, val coveringNodeId: Optional) - -class MetaTrace(nodes: List>) { - val stateMetadata: Map> = nodes.associateBy( - keySelector = { it.id }, - valueTransform = { node -> - val state = node.state - val id = node.id - if (node.coveringNode.isPresent) { - val coveringNodeId = node.coveringNode.get().id - StateMetadata(state, id, Optional.of(coveringNodeId)) - } - else { - StateMetadata(state, id, Optional.empty()) - } - } - ) -} diff --git a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceGenerationChecker.kt b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceGenerationChecker.kt index 5bd4822398..ab681b826a 100644 --- a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceGenerationChecker.kt +++ b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceGenerationChecker.kt @@ -4,15 +4,12 @@ import com.google.common.base.Preconditions import hu.bme.mit.theta.analysis.Prec import hu.bme.mit.theta.analysis.Trace import hu.bme.mit.theta.analysis.algorithm.* +import hu.bme.mit.theta.analysis.algorithm.arg.ArgNode +import hu.bme.mit.theta.analysis.algorithm.arg.ArgTrace import hu.bme.mit.theta.analysis.algorithm.cegar.Abstractor import hu.bme.mit.theta.analysis.expr.ExprAction import hu.bme.mit.theta.analysis.expr.ExprState -import hu.bme.mit.theta.analysis.utils.ArgVisualizer import hu.bme.mit.theta.common.logging.Logger -import hu.bme.mit.theta.common.visualization.Graph -import hu.bme.mit.theta.common.visualization.writer.GraphvizWriter -import java.io.FileWriter -import java.io.IOException import java.util.function.Consumer diff --git a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceMetadata.kt b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceMetadata.kt new file mode 100644 index 0000000000..78b2ba5e25 --- /dev/null +++ b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/tracegeneration/TraceMetadata.kt @@ -0,0 +1,16 @@ +package hu.bme.mit.theta.analysis.algorithm.tracegeneration + +import hu.bme.mit.theta.analysis.State + +/** + * Represents the metadata for a set of traces generated from an ARG + * The following information is created/collected here: + * - a unique identifier for each trace + * - a unique id for each state in each trace + * - coverages (how?) + */ +class TraceMetadata() { + fun addTrace() { + + } +}