We claim that programming within the logic programming paradigm suffers from lack of attention given to iteration and arrays. To convince the reader about their merits we present several examples of logic and constraint logic programs which use iteration and arrays instead of explicit recursion and lists. These programs are substantially simpler than their counterparts written in the conventional way. They are easier to write and to understand, are guaranteed to terminate and their declarative character makes it simpler to argue about their correctness. Iteration is implemented by means of bounded quantification.

, , ,
Department of Computer Science [CS]
Logic and language

Apt, K. (1995). Arrays, bounded quantification and iteration in logic and constraint logic programming. Department of Computer Science [CS]. CWI.