Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Lambda calculus: fold & Y

  1. Dec 15, 2008 #1
    1. The problem statement, all variables and given/known data

    I have two lambda expressions. Triblelist should trible every element in a list eg 1234 to 111222333444. N_th_list should do it n times. The problem is to give some value of n to n_th_list to receive triblelist. How can you do it? Help is really appreciated!

    2. Relevant equations

    triblelist = \list. ((fold F) nil ) list,
    where F = \a b . cell a (cell a (cell a b))

    n_th_list = \n list. ((fold (F n)) nil ) list,
    where F = Y (\i .\n a b. n b (\p. cell a (i p a b)))

    3. The attempt at a solution

    It may be that my equations are wrong. I am not sure of n_th_list. The Y combinator confuses me. I have a bad habit of expanding everything, the calculations really get messy. How should I proceed?
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted