## A Survey of Binary Search

If you think you know everything you need to know about binary search, but have not read Netty van Gasteren and Wim Feijen’s note The Binary Search Revisited, you should.

Skip to content
# Program Derivation

## A Survey of Binary Search

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

## Determining List Steepness in a Homomorphism

## The Windowing Technique for Longest Segment Problems

## Longest Segment Satisfying Suffix and Overlap-Closed Predicates

## On a Basic Property for the Longest Prefix Problem

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

## Tail-Recursive, Linear-Time Fibonacci

## Algebra of programming using dependent types

## A Simple Exercise using the Modular Law

If you think you know everything you need to know about binary search, but have not read Netty van Gasteren and Wim Feijen’s note The Binary Search Revisited, you should.

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.

A list of numbers is called *steep* if each element is larger than the sum of elements to its right. It is an example we often use when we talk about tupling. Can we determine the steepness of a list by a list homomorphism?

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

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.

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

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]

How can I introduce accumulating parameters to derive the linear-time, tail recursive implementation of

S-C. Mu, H-S. Ko, and P. Jansson. Algebra of programming using dependent types. In *Mathematics of Program Construction 2008*, LNCS 5133, pp 268-283. July 2008.

Superseded by the extended version for *Journal of Functional Programming*.

[PDF]

Prove the following property in point-free style:

$S\; \subseteq \; C\; .\; S\; \Leftarrow \; R\; \subseteq \; C\; .\; R\; \wedge \; S\; \subseteq \; R$