Boolean network representation of a continuous-time system and finite-horizon optimal control: application to the single-gene regulatory system for the lac operon