Closed Elscha closed 6 years ago
So far not defined by the IVML language specification, or?
There is nothing defined for such situations. In some cases it works, in other not. As there is no clearly defined unpack function, I do not know how to make such collections compareable.
apply over individual elements does not help?
This problem would be solveable if at least #74 would work. However, the handling would not be very pretty :confused:
Also
project IVML {
version v0;
sequenceOf(String) strs1;
sequenceOf(refTo(String)) strs2;
strs2->apply(refTo(String) s, setOf(String) set = {} | set.add(s));
}
does not help.
why should this help, this is not a comparison
OK, that seems to work:
project IVML {
version v0;
setOf(String) strs1;
setOf(refTo(String)) strs2;
strs1 = strs2->apply(refTo(String) s; setOf(String) set = {} | set.add(refBy(s)));
}
However, the IVML Language Specification must be updated, as a comma is used to separate both parameter inside the apply instead of the semicolon
Fine. There shall be an updated description of apply, in particular for temporary declarators. Could you please check and, if require, update the spec?
Yes, I will do that.
Fixed the IVML Language Specification. However, the reasoner does not consider such constraints. In both models, the reasoner will detect no errors (only the second one should be valid):
project IVML {
version v0;
sequenceOf(String) array = {"Hello", " ", "World"};
setOf(refTo(String)) referedVars = {refBy(array[0]), refBy(array[2])};
setOf(String) orgVars;
referedVars->apply(refTo(String) itr;
setOf(String) tmpValues = {} | tmpValues.add(refBy(itr))).size() == 1;
}
project IVML {
version v0;
sequenceOf(String) array = {"Hello", " ", "World"};
setOf(refTo(String)) referedVars = {refBy(array[0]), refBy(array[2])};
setOf(String) orgVars;
referedVars->apply(refTo(String) itr;
setOf(String) tmpValues = {} | tmpValues.add(refBy(itr))).size() == 2;
}
Also in this case, no value will be assigned to orgVars
, even if this may be ok as it is questionable wehther a permanent assignment should be poosible:
project IVML {
version v0;
sequenceOf(String) array = {"Hello", " ", "World"};
setOf(refTo(String)) referedVars = {refBy(array[0]), refBy(array[2])};
setOf(String) orgVars;
// "Derefer" values
orgVars = referedVars->apply(refTo(String) itr;
setOf(String) tmpValues = {} | tmpValues.add(refBy(itr)));
}
Hi,
warum sollte in den ersten zwei Fällen was assigned werden - und was tut der reasoner da? Beim dritten sollte was passieren, liegt ggf. aber am EvaluationVisitor. Also sollten wir das erst mal prüfen. Kannst du aus dem dritten einen Testcase machen?
Viele Grüße, Holger
Hallo Holger,
bei den ersten beiden Fällen erstelle ich mittels des applys eine temporäre Liste, deren Länge ich überprüfe. Nach meinem Verständnis sollte die Läge 2 sein, womit im ersten Fall ein Fehler gefunden werden müsste. Ist für den dritten Fall tatsächlich das Assignment gewünscht (hatten wir ja gestern drüber gesprochen)? Dann kann ich den Testfall erstellen.
Mit freundlichen Grüßen Sascha El-Sharkawy
Found the failure in:
The error occurs if a reference value (for aValue
) is added to a container, which is not operating on references. I'm not realy sure how to handle it without breaking something else.
Original post: IVML parser correctly complains about type inequality ("he types of all parameters of operation '==' need to be compliant"). IVML design having explicit type operations for references requires in this situation refBy(.). New version of IVML to be committed warns about potential comparison flaws for unequal types (inspired by this issue).
Examples from 18 Jul 2016: Actual version of IVML reasoner handles these situations as expected. Commit for respective test cases will follow.
Collections operating on references and collections operating on the refered type are not compliant, e.g., situations like :
are rather hard to handle.
CC: @eichelbe