Lazy bindings are not considered during the evaluation of free variables with ($!)
Consider the following Curry program:
lb11 = f (error "bla")
where
f (id x) = seq x True
This program is translated into the following FlatCurry program
lb11 = lb11' (error "bla")
lb11' v1 = let v2 free
in cond (id v2 =:<= v1) (seq v2 True)
With PAKCS this program yields the expected error.
However, in KiCS2 it is evaluated to True
.
The reason for this bug seems to be the implementation of the ($!)
-operator, which directly applies the given function to a free variable instead of inspecting its bindings in the decision store first.
As a consequence the lazy bindings for v2 in the given example are not considered leading to the unexpected result True
.