Intersection_chk/2

As the example at intersection/3 named What is wrong with intersection/3 and friends? explains, the set manipulation based on unification is dubious. If you need sets, use library(ordsets). That has ord_intersect/2 which just tests that two sets intersect.

Alternatively you may choose for hash tables balanced trees to represent sets, depending non what you need to do with them.

1 Like