1: Search and Optimisation Streams
2:
3: This library defines a bunch of streams (infinite lists),
4: for search and optimisation.
5:
6: A stream is a never-ending source of values. In our case,
7: a stream is implemented as a Javascript function with no
8: arguments. This is a "thunk", or a computation-in-waiting.
9: Whenever we like, we can call the function and it returns
10: the next value for us. Calling the function again will
11: return the next value, and so on. The next value of a
12: stream can depend arbitrarily on the previous values, but
13: it cannot depend on any future values. This is enabled by
14: making all streams either pure functions, or closures.
15:
16: Search is the problem of constructing suitable inputs for
17: a function, such that it gives a known output. This is
18: somewhat the inverse of most computations, which take
19: inputs and generate unknown outputs. Usually, as is the
20: case in this library, the output we want is boolean true,
21: and the function is some user-defined measure of
22: acceptibility. We usually require the user supplies the
23: domain of values as well (eg. booleans, integers, strings,
24: etc.), or at least some enumerating function.
25:
26: Optimisation is a generalisation of search. Instead of
27: requiring a specific value, we use an ordered co-domain
28: (for example, numbers), and construct values which give
29: higher and higher acceptibility.
30:
31: This library provides many basic streams (for example
32: "zeros" and "ones", which give values 0, 0, 0, ... and
33: 1, 1, 1, ... respectively), as well as a wealth of
34: combinators to produce new streams (for example,
35: interleave(zeros(), ones()) gives 0, 1, 0, 1, 0, 1, ...)
36: and stream-building functions (for example constant, where
37: constant(x) gives x, x, x, ...).
38:
39: By using the common framework of streams, we build up from
40: these basic building blocks to quite elaborate
41: metaheuristic search/optimisation algorithms, including
42: genetic algorithms and virtual machine enumerators.
Generated by git2html.