  We present a new average-based robustness score for Signal Temporal Logic
(STL) and a framework for optimal control of a dynamical system under STL
constraints. By averaging the scores of different specifications or subformulae
at different time points, our new definition highlights the frequency of
satisfaction, as well as how robustly each specification is satisfied at each
time point. We show that this definition provides a better score for how well a
specification is satisfied. Its usefulness in monitoring and control synthesis
problems is illustrated through case studies.
