Regular languages as local functions with small alphabets