One potential solution is the use of implicit definitions (Rogers, 1997).
conversely, x's corresponding output position is labeled H if its predecessor is an H or if x is the last position and is an H. In this way, the ''shifting'' behavior is captured by determining the output label of each position via the predecessor of its corresponding input position.