Bug #6990

InternalCompilerError with SCL CHR rule definitions

Added by Jani Simomaa about 1 year ago. Updated 8 months ago.

Status:NewStart date:
Priority:4Due date:
Assignee:Hannu Niemistö% Done:

0%

Category:-Spent time:-
Target version:-
Release notes:
Tags: scl, CHR
Story points-
Velocity based estimate-

Description

When having the following CHR ruleset:

    when Connections ?startTerminals ?pipeTerminals ?endTerminals
         DN.Mapping.InputTerminal ?startTerminals ?startInputTerminals
         DN.Mapping.OutputTerminal ?startTerminals ?startOutputTerminals

         DN.Mapping.InputTerminal ?endTerminals ?endInputTerminals
         DN.Mapping.OutputTerminal ?endTerminals ?endOutputTerminals

         DN.Mapping.InputTerminal ?pipeTerminals ?pipeInputTerminals
         DN.Mapping.OutputTerminal ?pipeTerminals ?pipeOutputTerminals
    then MultiConnection ?startVertexName ?startOutputTerminals ?edgeName ?pipeInputTerminals ?endVertexName ?endOutputTerminals
         MultiConnection ?endVertexName ?endInputTerminals ?edgeName ?pipeOutputTerminals ?startVertexName ?startInputTerminals

then following exception is logged to console:

org.simantics.scl.compiler.common.exceptions.InternalCompilerError: Variable ?startVertexName (with type a) is not given value anywhere.
    at org.simantics.scl.compiler.elaboration.expressions.Variable.getVal(Variable.java:60)
    at org.simantics.scl.compiler.elaboration.expressions.EVariable.toVal(EVariable.java:72)
    at org.simantics.scl.compiler.elaboration.chr.plan.ClaimOp.generateCode(ClaimOp.java:32)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PreCommitOp.generateCode(PreCommitOp.java:22)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanContext.iterateList(PlanContext.java:61)
    at org.simantics.modeling.scl.GraphRelation.generateIterate(GraphRelation.java:145)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateRelationOp.generateCode(IterateRelationOp.java:42)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanContext.iterateList(PlanContext.java:61)
    at org.simantics.modeling.scl.GraphRelation.generateIterate(GraphRelation.java:145)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateRelationOp.generateCode(IterateRelationOp.java:42)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanContext.iterateList(PlanContext.java:61)
    at org.simantics.modeling.scl.GraphRelation.generateIterate(GraphRelation.java:145)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateRelationOp.generateCode(IterateRelationOp.java:42)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanContext.iterateList(PlanContext.java:61)
    at org.simantics.modeling.scl.GraphRelation.generateIterate(GraphRelation.java:145)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateRelationOp.generateCode(IterateRelationOp.java:42)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanContext.iterateList(PlanContext.java:61)
    at org.simantics.modeling.scl.GraphRelation.generateIterate(GraphRelation.java:145)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateRelationOp.generateCode(IterateRelationOp.java:42)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanContext.iterateList(PlanContext.java:61)
    at org.simantics.modeling.scl.GraphRelation.generateIterate(GraphRelation.java:145)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateRelationOp.generateCode(IterateRelationOp.java:42)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.plan.IterateConstraintOp.generateCode(IterateConstraintOp.java:84)
    at org.simantics.scl.compiler.elaboration.chr.plan.PlanRealizer.nextOp(PlanRealizer.java:23)
    at org.simantics.scl.compiler.elaboration.chr.CHRRuleset.generateCode(CHRRuleset.java:176)
    at org.simantics.scl.compiler.elaboration.expressions.ECHRRuleset.toVal(ECHRRuleset.java:51)
    at org.simantics.scl.compiler.elaboration.expressions.ESimpleLet.toVal(ESimpleLet.java:71)
    at org.simantics.scl.compiler.elaboration.expressions.ESimpleLet.toVal(ESimpleLet.java:71)
    at org.simantics.scl.compiler.elaboration.expressions.ESimpleLet.toVal(ESimpleLet.java:71)
    at org.simantics.scl.compiler.elaboration.expressions.ESimpleLet.toVal(ESimpleLet.java:71)
    at org.simantics.scl.compiler.elaboration.expressions.ESimpleLet.toVal(ESimpleLet.java:71)
    at org.simantics.scl.compiler.compilation.CodeGeneration.convertToSSA(CodeGeneration.java:169)
    at org.simantics.scl.compiler.compilation.SCLCompiler.compile(SCLCompiler.java:139)
    at org.simantics.scl.compiler.source.TextualModuleSource.compileModule(TextualModuleSource.java:86)
    at org.simantics.scl.compiler.module.repository.ModuleRepository$ModuleEntry.initModuleEntryAndAddListener(ModuleRepository.java:136)
    at org.simantics.scl.compiler.module.repository.ModuleRepository$ModuleEntry.access$0(ModuleRepository.java:127)
    at org.simantics.scl.compiler.module.repository.ModuleRepository.getModuleEntry(ModuleRepository.java:246)
    at org.simantics.scl.compiler.module.repository.ModuleRepository.getModule(ModuleRepository.java:223)
    at org.simantics.scl.ui.editor2.SCLAnnotationModel.updateAnnotations(SCLAnnotationModel.java:39)
    at org.simantics.scl.ui.editor2.SCLAnnotationModel.access$1(SCLAnnotationModel.java:38)
    at org.simantics.scl.ui.editor2.SCLAnnotationModel$1.notifyAboutUpdate(SCLAnnotationModel.java:34)
    at org.simantics.scl.compiler.module.repository.ModuleRepository$ModuleEntry.notifyAboutUpdate(ModuleRepository.java:100)
    at org.simantics.scl.osgi.internal.BundleModuleSource.checkUpdates(BundleModuleSource.java:124)
    at org.simantics.scl.osgi.internal.BundleModuleSource.update(BundleModuleSource.java:154)
    at org.simantics.scl.ui.editor2.SCLModuleEditor2DocumentProvider.doSaveDocument(SCLModuleEditor2DocumentProvider.java:90)
        ...

And the whole SCL-function is underlined with red in SCL module editor.

The message provided with the exception is quite descriptive and points to the root of the error but the error message provided to the user should be better

History

#1 Updated by Tuukka Lehtonen 8 months ago

  • Tags set to scl, CHR

Also available in: Atom PDF