It's possible to abstract the structure of the argument. However, it's not really possible to do so correctly without knowing the details of arguments for specific systems. I've formalized two versions of the argument here, in Agda, but I'll explain roughly how they work below.
As with realizability, I'll use partial applicative systems and partial combinatory algebras as abstract computational systems.
- A PAS is a set $\cal A$ with a partial binary operation $\cdot : \cal A → A \rightharpoonup A$, where the operation is an abstraction of applying a computation (the left argument) to some input (the right argument). In my formalization, I use an alternate definition where we iterate the binary operation to have a partial interpretation of formal terms in $0$ variables, $\mathsf{Tm}_{\mathcal{A}} \rightharpoonup \cal A$. (Also note that I write $f \cdot x \cdot y$ to mean $(f \cdot x) \cdot y$)
- A PCA is a PAS that has representations of every formal applicative term over $\cal A$ with $n+1$ variables. This means that given an equation of the form:
$$\mathsf{C}\ x\ y\ \ldots = E$$
where $E$ is an expression built out of the variables $x, y, \ldots$, elements of $\cal A$, and application, there is an element $\sf c : \cal A$ such that $\mathsf{c} \cdot a \cdot b \cdot \ldots$ is equivalent to interpreting $E[x := a, y := b, \ldots]$ in the PAS. This is equivalent to assuming that representatives of the $\sf s$ and $\sf k$ combinators exist in $\cal A$, but much more convenient.
Lambda calculi naturally have this structure, but pretty much all computational systems (that I'm aware of) can fit into it. From combinatory completeness, we can define representations that will be needed later:
- $\newcommand{\true}{\mathsf{true}} \true\ x\ y = x$
- $\newcommand{\false}{\mathsf{false}} \false\ x\ y = y$
- $\newcommand{\id}{\mathsf{id}} \id\ x = x$
You can also look at this as allowing representatives of lambda expressions $λx\ y\ \ldots . E$ where the $λ$ binder occurs only once at the outermost level of the expression. Any other lambda expression must be turned into a sequence of combinator definitions.
It's also necessary for there to be $\newcommand{\Tm}{\mathsf{Tm}} ω : \Tm_{\cal A}$ such that evaluating $ω$ is undefined. From this we can get an element $Ω : \cal A$ such that $Ω \cdot a$ is always undefined (it is the representative of $λx. ω$, essentially). Being undefined in the PAS is the abstract equivalent of not halting, and there is nothing in the definition that actually forces any term to be undefined.
Given this setup, it's possible to copy the logic used to show that the halting problem for Turing machines is undecidable.
- Define a halting decider to be $\newcommand{\h}{\mathsf{h}} \h \in \cal A$ such that
- $\h \cdot a \cdot b$ is always defined and either $\true$ or $\false$
- if $\h \cdot a \cdot b$ is $\true$, then $a \cdot b$ is well-defined
- if $\h \cdot a \cdot b$ is $\false$ then $a \cdot b$ is undefined
- Define $δ \in \cal A$ to be the representative of $λ x. \h \cdot x \cdot x \cdot Ω \cdot \id \cdot \id$, and consider $δ \cdot δ$
- $δ \cdot δ$ is equivalent to $\h \cdot δ \cdot δ \cdot Ω \cdot \id \cdot \id$
- If $\h \cdot δ \cdot δ$ is $\true$, then the above expression is $\true \cdot Ω \cdot \id \cdot \id$ which is equivalent to $Ω \cdot \id$, which is undefined. This contradicts the second part of the halting decider specification.
- If $\h \cdot δ \cdot δ$ is $\false$, then the expression is instead well-defined with result $\id$. This contradicts the third part of the halting decider specification.
- Since the first part of the halting decider says that one of these cases must hold, it just cannot be the case that any $\h$ is a halting decider.
However, there's a problem with formulating the argument this way. If you instantiate to the lambda calculus, what it proves is:
- There is no total term $\h$ such that if $\h\ x\ y = \true$ then $x\ y$ normalizes, and if $\h\ x\ y = \false$ then $x\ y$ doesn't normalize.
But this is a weak result. In the lambda calculus, all that $\h$ can do is apply $x$ and $y$ to things, and by considering $\h\ Ω\ Ω$, we can tell that it actually must not apply its arguments at all if it successfully yields $\true$ or $\false$. So, the first part of the halting decider specification ensures that $\h$ is effectively a constant function.
So, for a version of the argument appropriate to the lambda calculus, we need more structure:
- Suppose we have a quotation $\newcommand{\Q}{\mathsf{Q}} \Q : \Tm_{\cal A} → \cal A$ that represents terms over $\cal A$ as elements of $\cal A$. This can be any function subject to the requirements below. So $\Q\ a$ could give structural information about $a : \cal A$, not just structure about the term
- Suppose there is an evaluation element $\newcommand{\ev}{\mathsf{ev}} \ev : \cal A$, such that $\ev \cdot \Q(e)$ is equivalent to the interpretation of $e$. So if $e$ is well-defined with result $a$, then $\ev \cdot \Q(e) = a$, and if $e$ diverges, then $\ev \cdot \Q(e)$ diverges. How $\ev$ behaves on values not in the image of $\Q$ is unspecified and doesn't matter.
- Suppose there is an element $\newcommand{\q}{\mathsf{q}} \q : \cal A$ that implements quotation internally, in the sense that $\q \cdot \Q(e) = \Q(\Q(e))$. How $\q$ behaves on values not in the image of $\Q$ is again unspecified.
Now we can copy the logic of the halting argument for lambda calculi as the following:
- Define a halting decider $\h : \cal A$ to be such that:
- $\h \cdot \Q(a) \cdot \Q(b)$ is always $\true$ or $\false$ (behavior on other values is unspecified)
- if $\h \cdot \Q(a) \cdot \Q(b)$ is $\true$, then $a \cdot b$ is well-defined
- if $\h \cdot \Q(a) \cdot \Q(b)$ is $\false$ then $a \cdot b$ is undefined
- Define $δ : \cal A$ to be the representative of $λx. \ev \cdot (\h \cdot x \cdot (\q \cdot x) \cdot \Q(ω) \cdot \Q(\id))$, and consider $δ \cdot \Q(δ)$
- $δ \cdot \Q(δ)$ is equivalent to $\ev \cdot (\h \cdot \Q(δ) \cdot (\q \cdot \Q(δ)) \cdot \Q(ω) \cdot \Q(\id))$
- If $\h \cdot \Q(δ) \cdot \Q(\Q(δ))$ is $\true$, then the above expression is equivalent to $\ev \cdot \Q(ω)$ which is undefined (remember, $\q \cdot \Q(δ) = \Q(\Q(δ))$). This contradicts the second portion of the halting decider specification.
- If $\h \cdot \Q(δ) \cdot \Q(\Q(δ))$ is $\false$, then the expression is instead equivalent to $\ev \cdot \Q(\id)$ which is defined with value $\id$. This contradicts the third portion of the halting decider specification.
- Again, the first portion of the halting decider specification requires that one of these two cases holds. So, it just cannot be the case that $\h$ is a halting decider.
When instantiated appropriately, this is the interesting version of the halting problem for lambda terms. It's possible to encode the lambda term data structure in the lambda calculus so that the terms can be decomposed and analyzed (I've written an Agda formalization of this here), and it meets the specification for quotation above. Then the abstract argument above instantiates to a refutation of a non-trivial notion of halting deciders in lambda calculi.
The Turing machine PCA is based on encoding already. So it can easily meet the quotation specification above by something like representing every machine (code) by itself, and evaluation being the identity (or possibly something a little more complicated, but not much). Real programming languages can use strings or data structures and an interpreter for representing themselves and evaluation. General recursive functions in arithmetic should be similar to Turing machines.
I'm not certain what you get by choosing something like a domain model or similar. In general there are examples that do not satisfy the premises above. For instance, there are PCAs where application is always well defined, so there is no notion of 'not-halting' in the first place (at least, within the above specifications). There might also be PCAs where the quotation specification doesn't make sense, and I'm uncertain if there is a more general argument for those. I don't think it's the case that every abstract 'computational system' has a well-defined self-undecidable halting problem. But, the above should cover a lot of the foundational ones typically considered.