Merge pull request #56 from Echtzeitsysteme/feature/adds-test-for-missing-patternsumexpr-in-obj

Adds a test case for the compiler error of the missing PatternSumExpr in the objectives
This commit is contained in:
Maximilian Kratz 2023-11-15 15:17:01 +01:00 committed by GitHub
commit 05ebc3ef60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gipsl.all.build.objectivepatternsumbug</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.emoflon.gips.gipsl.ui.gipsNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17

View file

@ -0,0 +1,16 @@
Manifest-Version: 1.0
Automatic-Module-Name: gipsl.all.build.objectivemappingbug
Bundle-ManifestVersion: 2
Bundle-Name: gipsl.all.build.objectivemappingbug
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Import-Package: test.suite.gips.utils
Bundle-SymbolicName: gipsl.all.build.objectivepatternsumbug;singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.emoflon.ibex.common,
org.emoflon.ibex.gt,
org.emoflon.gips.core,
org.emoflon.ibex.gt.democles,
org.emoflon.ibex.gt.hipe,
gipsl.all.build.model

View file

@ -0,0 +1,5 @@
source.. = src/,\
src-gen/
bin.includes = META-INF/,\
.,\
plugin.xml

View file

@ -0,0 +1,49 @@
package "gipsl.all.build.objectivepatternsumbug"
import "platform:/resource/gipsl.all.build.model/model/Model.ecore"
config {
solver := GLPK [home:="fu", license:="bar"];
timeLimit := true [value := 10.0];
randomSeed := true [value := 0];
presolve := true;
debugOutput := true;
}
rule moveVnodeMapping {
v : VirtualNode {
-- -host -> s1
++ -host -> s2
}
s1 : SubstrateNode
s2 : SubstrateNode
}
pattern findVnodeMapping {
s : SubstrateNode
v : VirtualNode {
-host -> s
}
}
mapping move with moveVnodeMapping;
constraint -> global {
mappings.move->count() == 1
}
//
// This objective triggers a compiler error in the generated code.
// It does not need a test method, etc.
//
objective o -> mapping::move {
patterns.findVnodeMapping
->filter(m | m.nodes().s == self.nodes().s1)
->count()
// The following self.value() multiplication is a workaround
* self.value()
}
global objective : max {
o
}