From discrete specifications to hybrid control