Skip to content

Equality definition in your blog post #1

@cyli

Description

@cyli

Apologies, I know this is the wrong venue for this, but http://blog.errstr.com/2012/01/15/more-church-encoding/ does not seem to have comments enabled, and this seemed less rude than randomly emailing you at addresses that popped up on Google.

The definition of equal in this repo is λm. λn. and (iszro (m prd n))(iszro (n prd m)), which was your second definition in your blog post. The first definition was equal = λm. λn. iszro (sub m n), which you say that the second definition has fewer evaluations than yours. I can see how it wouldn't handle a negative church numeral, but I did not understand why it had fewer evaluations.

sub is defined as λm. λn. n prd m, so wouldn't your first definition be:

equal = λm. λn. iszro (sub m n)
      = λm. λn. iszro ((λm. λn. n prd m) m n) 
      = λm. λn. iszro (n prd m)

? That seems to be just part of the definition than Pierce's definition - does it reduce down to a simpler expression? (I'm pretty new to lambda calculus, so I could not figure it out).

Is it just that if m < n, it can bail out at O(m) because (iszro (m prd n)) evaluates to false?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions