Transformational programming and the paragraph problem

From MaRDI portal





The problem of breaking paragraphs into lines can be formulated as an optimisation problem: the best arrangement of lines is one which minimises a certain definition of waste. Starting with a specification of this kind, we present a complete derivation, based on transformational programming, of two linear-time algorithms for the problem. The difference between the algorithms reflects different assumptions about the algebraic properties of waste functions: one algorithm employs a greedy strategy, while the other uses dynamic programming. Both algorithms are expressed as purely functional programs, and the advantages of a functional notation are illustrated in the derivations.











This page was built for publication: Transformational programming and the paragraph problem

Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q1067769)