Grammar-like functional rules for representing query optimization alternatives | Synapse