MATHEMATICAL ENGINEERING TECHNICAL REPORTS Calculus of Minimals: Deriving Dynamic-Programming Algorithms based on Preservation of Monotonicity