Can't solve this task:
Let there be a mutually recursive definition of the terms ${foo}$ and ${bar}$. In general, it can be written as $$ {foo} = P {foo} {bar} $$ $$ {bar} = Q {foo} {bar} $$ Here $P$ and $Q$ are some terms that contain neither ${foo}$ nor ${bar}$. Using the $Y$-combinator, find nonrecursive definitions for ${foo}$ and ${bar}$. Try to find the most "compact" solution, with the smallest number of $Y$-combinators possible
My attempts
- I tried to explicitly write $foobar = PfoobarQfoobar$, but it didn't work.
- I tried to start an auxiliary $bar'=\lambda f.Qf(bar'f)$, and through it get a nonrecursive form with $Y$ combinator.
- I tried to find the dependence by explicitly describing $foo=Pfoobar=PPfoobarbar=...=P...Pfoobar...bar$.