Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » sci.math.* » sci.math.independent

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Graham Cooper

Posts: 4,255
Registered: 5/20/10
Re: function arity > 2
Posted: Jan 16, 2013 11:07 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.