This package provides library(memo), a tool for memoising deterministic
predicates in memory or persistently on the file system.
It also includes library(typedef), which provides support for defining
algebraic data types that hook into the type-checking framework of
library(error).

The debug messages should indicate that repeated computations are being
avoided, even for failing goals, like sqrt1(-4.0,X), and computations
that throw exceptions, like sqrt2(-4.0,X).

Changes in v0.5

memo/1 and memo/2 are now steadfast with respect to output arguments in the
memoised goal. This means that instead of throwing an exception if an
output argument is nonvar on entry, the computation proceeeds _exactly_ as
if it were unbound, followed by a final semi-deterministic unification.
Any side-effects of calling the memoised computation (ie the memoisation of
the result) goes ahead even if the output arguments do not unify and the
call as a whole fails.
An alternative approach would be to abort the memoisation if the output
values do not unify with those provided on input.

Changes in v0.4

memo/1 now behaves differently if the memoised predicate fails or throws
an exception, in which case the result will now NOT be stored. This is probably
the more useful behaviour on the whole, because failures and exceptions
are more likely to be due to bugs rather than any inherent partiality in the
function being computed.

Changes in v0.3

The library now has a notion of 'current evaluation mode', which applies when
memoised predicates are called directly by their original names. In the previous
version, this resulted in a call to memo/1, i.e., strict mode checking is done,
previously stored computations are checked, and a new computation done if
necessary and the result stored. In v0.3, the current mode can be 'memo',
'browse' or 'compute', which result in calls to memo/1, browse/1 or compute/1
respectively. The initial mode is 'memo', retaining backwards compatibility with
v0.2. The only way to affect the mode is to use call_with_mode(Mode,Goal), which
calls an arbitrary goal in an environment with the evaluation mode set to Mode.
There is no way to globally set the evaluation-mode -- this is an intentional
design decision to ensure that any goal given at the top level ?- prompt always
behaves the same way.