Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver has issues with enum types #15

Open
ArenBabikian opened this issue Jun 4, 2018 · 0 comments
Open

Solver has issues with enum types #15

ArenBabikian opened this issue Jun 4, 2018 · 0 comments
Labels

Comments

@ArenBabikian
Copy link
Collaborator

If a variable has an enum type and a value is specified for that variable in the .vql file (ex. FTObstacle.color(ob1, FTPickUpColor::Other);), the solver throws an exception when invoked, while the VIATRA Query Result view is able to show the matches without issues for the pattern. See below example for our FTPickUpColor enum class, which contains the ::Other literal:

Error occured (UnsupportedOperationException): Can not transform pattern "ca.mcgill.ecse.fairtracks.queries.movableObstacleNotColoredOther"! Reason: Unknown constant type: class ca.mcgill.ecse.fairtracks.fairtracksDsl.FTPickUpColor
    hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.RelationDefinitionIndexer.transformPattern(RelationDefinitionIndexer.java:204)
    hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.RelationDefinitionIndexer.generateRelationDefinitions(RelationDefinitionIndexer.java:65)
    hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternGenerator.transformBaseProperties(PatternGenerator.java:623)
    hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternProvider.generateQueries(PatternProvider.java:59)
    hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationMethodProvider.createModelGenerationMethod(ModelGenerationMethodProvider.java:56)
    hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner.solve(ViatraReasoner.java:89)
    hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:269)
    hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:137)
    hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:348)
    hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:116)
    hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:78)
    org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

After some debugging, we figured out that this line is causing the bug as it is not able to detect that the Enum variable we are using (FTPickUpColor::Other) are actually instances of the EEnum class.

Note that this only occurs when we specify a value for the Enum variable (ex. ::Other), and not when we declare the Enum variable (ex. as a parameter in a pattern).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant