Building on what Ian et. al. taught me last month about CHR, I have now answered another question using CHR on Stack Overflow.
I would appreciate feedback again this time. This program seems similar to the first one in many ways; I probably could have applied set intersection as Ian did in his solution to the other program but using select/3
made more sense to me. I have also applied Alan’s feedback about formatting, and I think it looks better.
Thanks for your time!