Skip to content

Lambdas are being evaluated incorrectly #143

Open
@printfn

Description

@printfn

Input: ((λa.(λb.(λc.(λd.(λe.(λf.(((a (λg.(λh.((b (g (d h))) (g (e h)))))) (λg.(c g))) f))))))) (λa.(λb.(a (a (a b))))))

Expected: (λb.(λc.(λd.(λe.(λf.((b ((b ((b (c (d (d (d f))))) (c (e (d (d f)))))) ((b (c (d (e (d f))))) (c (e (e (d f))))))) ((b ((b (c (d (d (e f))))) (c (e (d (e f)))))) ((b (c (d (e (e f))))) (c (e (e (e f))))))))))))

Actual: \b.(\c.(\d.(\e.(\f.((((((a ((\g.(\h.((((b (((g (((d (h))))))))) (((g (((e (h)))))))))))))) ((\g.((c (g))))))) (f)))))))

The issue is probably that fend’s associativity is wrong (lambdas are supposed to be left-assoc while application is meant to be right-assoc).

Probably relates to #76

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghardWill take a long time to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions