Yes, this is a bug. Thank you for catching it. I will fix it and issue
a version 5.1 of the standard library, and change Marmoset to use the
new version.
(Apparently this bug has already been fixed twice before, but the fix
was accidentally reverted when a different bug was fixed.)
Yes, the purpose of the boolean b is to make this code pass A4 even for
groups that do not yet have constant folding implemented in their
reachability checker.