reducer for the Shift AST format