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

 
 

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

Submitter:  None
Submitted:  Tue 19 Oct 2010 12:44:09 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  nandhp Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-02-05 jwe StatusNone Fixed
        Open/ClosedOpen Closed
    2010-10-19 None Attached File- Added church-octave-bug.m, #21720

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code