Hybrid receding-horizon control: formulation and stability analysis