Echtzeitsysteme / gips

Graph-Based (M)ILP Problem Specification Tool
https://gips.dev
GNU General Public License v3.0
3 stars 1 forks source link

Validator: `1 == self.nodes()... * 0` throws an exception #60

Open maxkratz opened 2 years ago

maxkratz commented 2 years ago

The validator throws an exception when comparing a static number with a multiplication that contains a node reference.

Example code:

constraint -> pattern::vnodeNotMapped {
    1 == self.nodes().vnode.resourceDemand * 0
}

Symptom:

java.lang.UnsupportedOperationException: Not yet implemented
    at org.emoflon.gips.gipsl.validation.GipslValidator.getNumberType(GipslValidator.java:1384)
    at org.emoflon.gips.gipsl.validation.GipslValidator.combine(GipslValidator.java:1309)
    at org.emoflon.gips.gipsl.validation.GipslValidator.getEvalTypeFromArithExpr(GipslValidator.java:847)
    at org.emoflon.gips.gipsl.validation.GipslValidator.getEvalTypeDelegate(GipslValidator.java:1221)
    at org.emoflon.gips.gipsl.validation.GipslValidator.getEvalTypeFromBoolExpr(GipslValidator.java:799)
    at org.emoflon.gips.gipsl.validation.GipslConstraintValidator.checkConstraint(GipslConstraintValidator.java:85)
    at org.emoflon.gips.gipsl.validation.GipslValidator.checkConstraint(GipslValidator.java:388)
maxkratz commented 2 years ago

May this gets only triggered if there is on = missing, e.g.:

constraint -> pattern::vnodeNotMapped {
    1 = self.nodes().vnode.resourceDemand * 0
}

TODO: Investigate this.