Prior work on finding domain-theoretic suprema of equivalent total functions? In slightly more down-to-earth terms, this question is sort of about lazy evaluation in functional programming - except that it's more ambitious in general than just seeking what a typical Haskell programmer would consider "least-strict". If the previous sentence made no sense to you, don't worry, ignore it.

In domain theory, we examine posets, and for the purposes of this question we will consider a poset to represent the set of possible partially-specified values of a type in a non-strict programming language, such that two partial values $x$ and $y$ are ordered as $x \sqsubseteq y$ iff $y$ is $x$ "plus zero or more extra bits of information". In other words, $x \sqsubseteq y$ iff y is a version of $x$ where zero or more of the "holes" or "thunks" (if any) have been filled in.

We can (and do) extend this partial order to Scott-continuous functions, by stipulating that $f \sqsubseteq g$ iff for all $x$, $f(x) \sqsubseteq g(x)$.

However, note that in the case of Scott-continuous functions, $f$ can be $\sqsubseteq$ $g$ even if $g$ is distinguishable from $f$ but does not provide any extra information. This can be the case if $g$ provides the same information "more parsimoniously" (or "more lazily", depending on how you want to look at it).

My question is this: If $f$ is a Scott-continuous computable function, and is "total" (i.e. the elements of its domain are all finite, and it takes "fully-defined" values to "fully-defined" values), have techniques been developed for computing a maximal $h$ such that $f \sqsubseteq h$?

Of course, if the domain of $f$ is a finite set, one can just represent $f$ as a lookup table and then use elementary deduction to compute $h$. It's not necessarily efficient in practice, but it yields the correct answer. But what about functions over infinite domains?
My question is this: If f is a Scott-continuous computable function, and is &quot;total&quot; (i.e. the elements of its domain are all finite, and it takes &quot;fully-defined&quot; values to &quot;fully-defined&quot; values), have techniques been developed for computing a maximal h such that f⊑h?
Of course, if the domain of f is a finite set, one can just represent f as a lookup table and then use elementary deduction to compute h. It's not necessarily efficient in practice, but it yields the correct answer. But what about functions over infinite domains?

Scott-continuity rules out the lookup table approach. For a concrete counterexample, let's start with the Sierpinksi domain $O = \{\bot, \top\}$, with order $\bot \sqsubseteq \top$.
Intuitively, think of $\bot$ as nontermination, and $\top$ as termination. In Haskell terms, think of this as the domain interpreting expressions of type $()$ -- i.e., you either get back a unit or the expression fails to terminate. We'll also use $2$, the booleans, and $2_\bot$, the pointed booleans.
Now, suppose you have $f : O \to 2_\bot$. You can't continuously complete this function, even though there are only a finite number of possible $f$'s! The intuitive reason is that when you run $f(\bot)$, there's no finite waiting period sufficiently long enough to decide that its return value is bottom -- if there were, then I could give you a function that spins for one second longer, and then returns the opposite of whatever you completed the function to. (Prove that any continuous $h : (O \to 2_\bot) \to (O \to 2)$ must return a constant function independent of its argument $f$.)
Don't think of bottom as an extra element of the domain of values. This will lead you astray. Instead, think of elements of the domain as observations of a computation. Really do think of sitting in front of a terminal, waiting for your program to print something. Bottom represents your observation when the program is still running and hasn't printed anything to the screen -- it represents observing nothing.
The best book I know for developing the right intuitions is Steve Vickers' Topology via Logic. It's a short and easy read, but your domain-fu will go way up for reading it.