declare % at least N elements of the finite set M map to the same value by F proc {AtLeastInEquiv N F M} D = {Dictionary.new} Satisfied in % first fill the dictionary with possible elements of M for X in {FS.reflect.upperBoundList M} do K = {F X} in D.K := X|{Dictionary.condGet D K nil} end % map each entry to a boolean saying whether it is satisfied Satisfied = {Map {Dictionary.items D} fun {$ Xs} Bs = {Map Xs fun {$ X} {FS.reified.isIn X M} end} in {FD.reified.sum Bs '>=:' N} end} % at least one of the entries has N elements belonging to M {FD.sum Satisfied '>=:' 1} end proc {Script M} M = {FS.var.upperBound 1#1000} {FS.card M 7} {AtLeastInEquiv 3 fun {$ X} X mod 100 end M} {FS.distribute naive [M]} end {ExploreOne Script}