bugGNU Octave - Bugs: bug #31371, Factorial using Y combinator does...

 
 

bug #31371: Factorial using Y combinator does not work (MATLAB incompatibility)

Submitted by:  None
Submitted on:  Tue 19 Oct 2010 12:44:09 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: nandhpOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 05 Feb 2012 07:33:47 PM UTC, comment #1:

I checked in the following changesets. This change appears to fix the problem for me, so I'm closing this report.

http://hg.savannah.gnu.org/hgweb/octave/rev/19078011cdc3
http://hg.savannah.gnu.org/hgweb/octave/rev/23782766da08

John W. Eaton <jwe>
Project Administrator
Tue 19 Oct 2010 12:44:09 PM UTC, original submission:

Lambda Calculus is a system of computation using only anonymous functions. Church Numerals implement nonnegative integers in terms of function composition. The Y combinator is a device in Lambda Calculus to implement recursion:

Y = @(f) C(@(g) f(@(x) C(g(g), x)), @(g) f(@(x) C(g(g), x)));

An implementation factorial over Church Numerals does not work past two. It appears that Octave starts losing function parameter values when computing Three Factorial and above.

Code that reproduces the bug is attached. I'll understand if this is too complicated and esoteric to be fixed. :)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21720:  church-octave-bug.m added by None (1KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 05 Feb 2012 07:33:47 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 19 Oct 2010 12:44:10 PM UTCNoneAttached File-=>Added church-octave-bug.m, #21720

    Back to the top


    Powered by Savane 3.1-cleanup1