The lub package

Lub is an experiment in computing least upper information bounds on
(partially defined) functional values. It provides a lub function
that is consistent with the unamb operator but has a more liberal
precondition. Where unamb requires its arguments to equal when
neither is bottom, lub is able to synthesize a value from the
partial information contained in both of its arguments.