Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: function arity > 2
Replies: 7   Last Post: Jan 17, 2013 1:37 AM

 Messages: [ Previous | Next ]
 Graham Cooper Posts: 4,417 Registered: 5/20/10
Re: function arity > 2
Posted: Jan 16, 2013 11:07 PM

On Jan 16, 7:55 pm, Butch Malahide <fred.gal...@gmail.com> wrote:
>
> Damned if I know. I've *heard* of lambda calculus, and that's about it.

It's a method to Run functions on the fly, that is how LISP works!

No need to define a function, just have nameless lambda expressions.

-\ x . x+1

this is succ(x)

( -\ x . x+1 ) 7
= 8

---------

f(x,y) = 2*x+y

-\ x,y . 2*x+y

( -\ x,y . 2*x+y ) 5 1
= 11

---------

or you can CURRY each argument one at a time..

-\ f . (-\ y . f+y)

This is a function that takes 1 parameter f
and returns a function f that also adds its parameter y

It does half the work!

----------

( -\ f . ( -\ y . f+y ) ) f*2 5 1
= 11

SOLVE THE OUTERMOST LAMBDA 1ST

[ (-\ f . (-\ y . f+y) ) y*2 ] 5 1

( -\ y . y*2 + y ) 5 1

...hmm nearly!

You can reduce any n parameter function down to a sequence of n high
order function applications of 1 parameter!

f (a,b)
<->
g(a) (b)

g is a high order function that inputs a,
and returns another function that inputs b

Herc
--
www.microPROLOG.com

Date Subject Author
1/16/13 JohnF
1/16/13 Butch Malahide
1/16/13 JohnF
1/16/13 Butch Malahide
1/16/13 JohnF
1/16/13 Butch Malahide
1/17/13 JohnF
1/16/13 Graham Cooper