The goal is to take a binary space, say 64 bits, and make certain parts of it "valid" and certain parts "invalid", then increment, starting at 0, through that space, avoiding the invalid areas.
Space is made "invalid" by applying an arbitrary number of arbitrary rules. For instance "if bits 2 and 49 are set, that number is invalid", etc..
Space unaffected by rules is considered "valid".
The easy way to do this is simply apply all the rules every time you increment. But this is unrealistic for a 64 bit space with even a few rules, it takes forever. For larger bit spaces and or alot of/complex rules, same problem.
So a much more efficient method is needed. Something that takes very few instructions and the end result is essentially only incrementing to numbers that are in valid space.
I would imagine this has already been figured out in a thesis somewhere and is probably used every day in file systems or something common.