Retrieval of individual solutions from encapsulated search with a potentially infinite search space
Constraint-logic object-oriented programming facilitates the development of applications that occasionally solve search problems. To that end it is possible to define constraints imperatively on-the-fly, using conditions over free variables. As a result, the search space is defined dynamically at runtime, based on the evaluation of such conditions in control structures. Consequently, the search space can - intentionally or by accident - become infinitely large if recursion and/or loops are involved. It is therefore desirable that the corresponding encapsulated search can be controlled by application developers. To that end, we discuss mechanisms for encapsulating such a search space and retrieving solutions from it. Our implementation for Muli is based on an appropriately extended symbolic Java virtual machine and it leverages the Java Stream API to provide a control mechanism that integrates well with object-oriented programs. Moreover, we show how our language Muli behaves for some example programs.