A maximum principle for hybrid optimal control problems | Synapse