diff options
Diffstat (limited to 'subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/pquery/rewriter/RefineryPBodyNormalizer.java')
-rw-r--r-- | subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/pquery/rewriter/RefineryPBodyNormalizer.java | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/pquery/rewriter/RefineryPBodyNormalizer.java b/subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/pquery/rewriter/RefineryPBodyNormalizer.java deleted file mode 100644 index ed85a843..00000000 --- a/subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/pquery/rewriter/RefineryPBodyNormalizer.java +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2004-2010 Gabor Bergmann and Daniel Varro | ||
3 | * Copyright (c) 2023 The Refinery Authors <https://refinery.tools/> | ||
4 | * This program and the accompanying materials are made available under the | ||
5 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
6 | * http://www.eclipse.org/legal/epl-v20.html. | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.store.query.viatra.internal.pquery.rewriter; | ||
10 | |||
11 | import org.eclipse.viatra.query.runtime.matchers.context.IQueryMetaContext; | ||
12 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
13 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PDisjunction; | ||
14 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.PBodyCopier; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.PBodyNormalizer; | ||
17 | |||
18 | import java.util.LinkedHashSet; | ||
19 | import java.util.Set; | ||
20 | |||
21 | public class RefineryPBodyNormalizer extends PBodyNormalizer { | ||
22 | public RefineryPBodyNormalizer(IQueryMetaContext context) { | ||
23 | super(context); | ||
24 | } | ||
25 | |||
26 | @Override | ||
27 | public PDisjunction rewrite(PDisjunction disjunction) { | ||
28 | Set<PBody> normalizedBodies = new LinkedHashSet<>(); | ||
29 | for (PBody body : disjunction.getBodies()) { | ||
30 | PBodyCopier copier = new RefineryPBodyCopier(body, getTraceCollector()); | ||
31 | PBody modifiedBody = copier.getCopiedBody(); | ||
32 | normalizeBody(modifiedBody); | ||
33 | normalizedBodies.add(modifiedBody); | ||
34 | modifiedBody.setStatus(PQuery.PQueryStatus.OK); | ||
35 | } | ||
36 | return new PDisjunction(normalizedBodies); | ||
37 | } | ||
38 | } | ||