Pruning with improving sequences in lazy functional programs

  • Authors:
  • Hideya Iwasaki;Takeshi Morimoto;Yasunao Takano

  • Affiliations:
  • Graduate School of Informatics and Engineering, The University of Electro-Communications, Tokyo, Japan 182-8585;MNBI Inc., Tokyo, Japan 104-0033;Coma-Systems Co., Ltd., Tokyo, Japan 107-0052

  • Venue:
  • Higher-Order and Symbolic Computation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper presents a library based on improving sequences and demonstrates that they are effective for pruning unnecessary computations while retaining program clarity. An improving sequence is a monotonic sequence of approximation values of a final value that are improved gradually according to some ordering relation. A computation using improving sequences proceeds by demanding for the next approximation value. If an approximation value in the middle of the improving sequence has sufficient information to yield the result of some part of the program, the computations that produce the remaining values can be pruned. By combining suitable improving sequences and primitive functions defined for the sequences, we can write efficient programs in the same form as simple and naive programs. We give examples that show the effectiveness of improving sequences and show by program calculation that a simple minimax-like program using improving sequences implements a well-known branch-and-bound searching algorithm.