Background.
- The language is PCF, with observable types $\text{bool}$ and $\text{nat}$.
- $\text{eval}$ is the partial function on PCF terms such that $\text{eval}(M) = N$ iff $N$ is the unique normal form of $M$.
- observational equivalence: for all contexts $C[ ]$ such that $C[M]$ and $C[N]$ are closed terms of observable type, we have that $\text{eval}(C[M]) \simeq \text{eval}(C[N]$.
Questions.
- Show that if programs (closed terms of observable type) $M$ and $N$ are operationally equivalence, $\text{eval}(M) \simeq \text{eval}(N)$.
- Assuming that all programs with no normal form are observationally (aka operationally) equivalent, show that if $M$,$N$ are programs such that $\text{eval}(M) \simeq \text{eval}(N)$, $M$ and $N$ are observationally equivalent.
Attempts.
Suppose that $M$, $N$ are operationally equivalent and consider the empty context. Pasting in $M$, $N$ we have that $\text{eval}(M) \simeq \text{eval}(N)$ by definition.
Let $C[]$ be such that $C[M]$, $C[N]$ are programs. (a) If $\text{eval}(M)$ is defined, ie $M$ has a normal form $K$, then $N$ has the same normal form. Non-deterministic reduction is the same as deterministic reduction for \text{eval} function (by his statement on p. 75), hence we choose to reduce the $M$ and $N$ portions of $C[M]$, $C[N]$ to $C[K]$ first. This leaves us with $C[M]$ and $C[N]$ both stepping to $C[K]$. Then if $C[K]$ has a normal form $Z$, $C[M]$ and $C[N]$ both step to $Z$ and we are done. Else, $C[K]$ has no normal form, and hence neither $C[M]$ nor $C[N]$ do (for suppose that $C[M]$ has a normal form, by confluence, so does $C[K]$). (b) given that $M$, $N$ have no normal forms, $C[M]$ and $C[N]$ do not have normal forms either.
Problem: I don't think (b) is true: since pcf is Turing-complete, we can write $Y$ combinator. We can also write a function $t:$ that takes arbitrarily many arguments and returns $1$. So $Y$ combinator has no nf, but $C[] = t([])$ does have a normal form. Is there a better way to go about completeing this problem?