Efficient algorithm to determine if a lambda calculus term is equivalent to one without a given free variable

Consider the following problem: given a lambda calculus term $ t$ and free variable $ v$ determine whether $ \phi(t,v)$ , where $ \phi(t,v) := \exists t’. t’ \equiv t \land v \notin FV(t’)$ .

This problem is undecidable. To prove this, assume the contrary. For any Turing machine $ M$ , let $ t_M$ be a lambda calculus term that normalizes to $ \lambda x. x$ if $ M$ halts and diverges otherwise. Then determine whether $ \phi(t_M(\lambda x. (\lambda y. y))v, v)$ . If it is true, then $ M$ halts. Otherwise, it does not. This provides an algorithm to solve the halting problem, which is a contradiction.

On the other hand, it is semidecidable. For any $ t$ and $ v$ , simply enumerate the $ t’$ such that $ t’ \equiv t$ . If a $ t’$ is enumerated such that $ v \notin FV(t’)$ , output yes and halt. This algorithm outputs yes iff $ \phi(t, v)$ .

That said, this algorithm is not very efficient, since you have to use an enumeration that enumerates all $ t’$ such that $ t’ \equiv t$ . Is there an efficient algorithm to determine whether $ \phi(t,v)$ is true?

One thing one might consider is to normalize $ t$ , and then determine whether $ v$ is a free variable in the normal form of $ t$ . Although this is efficient, it is not correct. Consider the term $ t := \Omega((\lambda x. \lambda y. x)\Omega v)$ (where $ \Omega := (\lambda x. x x)(\lambda x. x x)$ ). $ t$ does not have a normal form. Yet, $ \phi(t,v)$ is true, since $ (\Omega \Omega) \equiv t \land v \notin FV(\Omega \Omega)$ .

Note also that normalizing $ t$ using and checking if $ v$ is free in the intermediate terms after each step will not work if one uses normal-order reduction or applicative order reduction. The counterexample for both is $ \phi(\Omega((\lambda x. \lambda y. x)\Omega v), v)$ , the same as before.

One approach would be to find some other efficient reduction strategy (perhaps depending on $ v$ ) that will eventually produce a term that does not contain $ v$ , if such a term exists. This potentially could solve $ \phi(\Omega((\lambda x. \lambda y. x)\Omega v), v)$ , since $ \Omega((\lambda x. \lambda y. x)\Omega v)$ can be reduced to $ \Omega((\lambda y. \Omega) v)$ which can be reduced to $ \Omega \Omega$ , which does not contain $ v$ . We need a strategy that works on arbitrary $ t$ though.

Alpha conversion does not make a difference. It appears that eta conversion is also irrelevant.

How to determine the genus and the number of poles in a ring $\mathbb{C}[t,t^{-1},u]/\langle u^m-p(t)\rangle$?

A pole of the finite polynomial $ p(t)=\sum_{i\in\mathbb{Z}}a_it^i$ is a point $ p_0$ such that $ p(p_0)=\infty$ .

I already know that when $ m=2$ , the genus $ g$ depends on the defining polynomial $ p(t)$ with degree $ d$ according to the formula $ $ g=\frac{d-1}{2}, $ $ equivalently $ $ 2g=\begin{cases} d-2 \textrm{ if $ d$ is even} \d-1 \textrm{ if $ d$ is odd.}\end{cases} $ $

After that, I have that the number $ n$ where poles are allowed depends on $ p(t)$ according to the formula $ n=4-r$ where $ r$ is the number of ramified points in $ \{0,\infty \}$ : $ 0$ is ramified exactly when the constant term $ a_0=0$ , and $ \infty$ is ramified exactly when the degree $ d$ is odd. Combining this information gives $ $ 2g+n-1=\begin{cases} d+1 \textrm{ if } a_0\neq0, \d-1 \textrm{ if } a_0=0. \end{cases} $ $

As I said, it is the case when $ m=2$ . When $ m$ is arbitrary, what could I say?

How to determine the genus and the number of poles in a ring $ \mathbb{C}[t,t^{-1},u]/\langle u^m-p(t)\rangle$ ?

How to determine the cause of stuck `D` status processes?

enter image description here

I have several processes stuck on uninterruptible sleep statuses, all seemingly stemming from auplink /var/lib/docker/aufs/mnt. It’s something docker related and it’s waiting on an I/O that will never complete — I get that, but how do I determine the exact cause? How can I know what I/O it is waiting on? Also, is there really no way of making these stuck processes go away without a hard reboot?

Determine if the original path of an alias is local or remote

I have a folder full of thousands of aliases and need to isolate the ones referencing a remote path on another computer on an AFP network. I can iterate all of the alias files over a terminal command with Automator but can’t find the right command to determine the original path of an alias.

I’d be grateful for any help. Thanks.

SQL Server Query Notification : How to determine the query that a subscription is for?

Using SqlDependency+SqlConnection+SqlCommand mechanism, a client application can create a notification mechanism. I want to figure out the query that clients submit as part of a subscription using this mechanism. I want to do so by examining the system tables. I can use the SQL Profiler to do so but I am hoping that there is a more efficient way to do so by using the sys. tables. I see the sys.dm_qn_subscriptions but have been unable to figure out which table holds the query (or the hash representing the query).