# Optimisation Problems

## A “Side-Swapping” Lemma Regarding Minimum, Using Enriched Indirect Equality

If every solution returned by `D`

is no better than some solution returned by `X`

, any optimal solution by `X`

must be no worse than some optimal solution by `D`

“What? How could this be true?” It turned out that the reasoning can be correct, and the proof uses indirect equality in an unusual way.

## The Windowing Technique for Longest Segment Problems

Reviewing Zantema’s “windowing” technique for computing the longest segment of the input that satisfies a suffix-closed predicate.

## Longest Segment Satisfying Suffix and Overlap-Closed Predicates

Translating Zantema’s work to Bird-Meertens style, to compute the longest consecutive segment of the input that satisfies a predicate that is suffix and overlap-closed.

## On a Basic Property for the Longest Prefix Problem

Giving a constructive proof for one of the essential properties in Hans Zantema’s Longest Segment Problems.

## Algebra of programming in Agda: dependent types for relational program derivation

S-C. Mu, H-S. Ko, and P. Jansson. Algebra of programming in Agda: dependent types for relational program derivation. In *Journal of Functional Programming*, Vol. 19(5), pp. 545-579. Sep. 2009. [PDF]

## AoPA — Algebra of Programming in Agda

The **AoPA** library allows one to encode Algebra of Programming style program derivation, both functional and relational, in Agda, accompanying the paper Algebra of Programming Using Dependent Types (MPC 2008) developed in co-operation with Hsiang-Shang Ko and Patrik Jansson.

## Maximum segment sum is back: deriving algorithms for two segment problems with bounded lengths

S-C. Mu. Maximum segment sum is back: deriving algorithms for two segment problems with bounded lengths. In *Partial Evaluation and Program Manipulation (PEPM ’08)*, pp 31-39. January 2008.

[PDF] [GZipped Postscript]

## Maximum Segment Sum, Agda Approved

To practise using the Logic.ChainReasoning module in Agda, Josh proved the foldr-fusion theorem, and I thought it would be an small exercise over the weekend to start off where he finished…

## The Pruning Theorem: Thinning Based on a Loose Notion of Monotonicity

Any preorder