Generalized matching rules for aperiodic tilings