You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a list of integers ints, consider the following expression:
ints all = 42
I would expect this expression to be True if and only if "for every item x in the list ints, it holds that x equals 42". However, for an empty list, the behaviour differs from this.
Example:
empty all = 42
Expected: Since empty does not have any items, this should be trivially True.
Actual: False
This is of course a contrived example, but this issue surfaced because of an issue in the CDM having to do with the PriceQuantityTriangulation function. Simplified:
type Foo:
a int (1..1)
func CheckFoo: // corresponds to the CDM function CashPriceQuantityNoOfUnitsTriangulation
inputs:
foo Foo (1..1)
output:
success boolean (0..1)
set success:
if foo -> a = 42
then True
// else empty
func CheckFoos: // corresponds to the CDM function PriceQuantityTriangulation
inputs:
foos Foo (0..*)
output:
success boolean (0..1)
set success:
foos
extract [
CheckFoo
] all = True
If any of the foos passed to CheckFoos has its attribute a set to 42, this behaves as expected. However, for example the call CheckFoos([Foo {a: 1}, Foo {a: 2}]) results in False, rather than the expected result True.
The text was updated successfully, but these errors were encountered:
Given a list of integers
ints
, consider the following expression:I would expect this expression to be
True
if and only if "for every itemx
in the listints
, it holds thatx
equals42
". However, for an empty list, the behaviour differs from this.Example:
Expected: Since
empty
does not have any items, this should be triviallyTrue
.Actual:
False
This is of course a contrived example, but this issue surfaced because of an issue in the CDM having to do with the
PriceQuantityTriangulation
function. Simplified:If any of the
foos
passed toCheckFoos
has its attributea
set to42
, this behaves as expected. However, for example the callCheckFoos([Foo {a: 1}, Foo {a: 2}])
results inFalse
, rather than the expected resultTrue
.The text was updated successfully, but these errors were encountered: