Git Product home page Git Product logo

lambda-calculus-telegram-bot's Issues

Find limits

There're graph image limit, as well sometimes there's a time limit exception

Beta-reduction not working

When input is
N2≡λs.λz.s(s(z))
N3≡λs.λz.s(s(s(z)))
N2 N3
it outputs
(λz.(λz.(((z(z(zz)))((z(z(zz)))((z(z(zz)))(z(z(zz))))))(((z(z(zz)))((z(z(zz)))((z(z(zz)))(z(z(zz))))))(((z(z(zz)))((z(z(zz)))((z(z(zz)))(z(z(zz))))))((z(z(zz)))((z(z(zz)))((z(z(zz)))(z(z(zz)))))))))))

but it should output

λz.λz1.z(z(z(z(z(z(z(z(zz1))))))))

TO DO: Tasca 5 macros amb notació infixa

En aquesta tasca heu de permetre la definició de macros amb notació infixa. En aquests cas els noms seran símbols no alfabètics i la seva implementació serà similar a les macros amb notació prefixa. Veieu l’exemple següent:
`
? N2≡λs.λz.s(s(z))
N2 ≡ (λs.(λz.(s(sz))))
? N3≡λs.λz.s(s(s(z)))
N2 ≡ (λs.(λz.(s(sz))))
N3 ≡ (λs.(λz.(s(s(sz)))))
? +≡λp.λq.λx.λy.(px(qxy))
N2 ≡ (λs.(λz.(s(sz))))
N3 ≡ (λs.(λz.(s(s(sz)))))

  • ≡ (λp.(λq.(λx.(λy.((px)((qx)y))))))
    ? N2+N3
    Arbre:
    (((λp.(λq.(λx.(λy.((px)((qx)y))))))(λs.(λz.(s(sz)))))(λs.(λz.(s(s(sz))))))
    β-reducció:
    ((λp.(λq.(λx.(λy.((px)((qx)y))))))(λs.(λz.(s(sz))))) → (λq.(λx.(λy.(((λs.(λz.(s(sz))))x)((qx)y)))))
    β-reducció:
    ((λq.(λx.(λy.(((λs.(λz.(s(sz))))x)((qx)y)))))(λs.(λz.(s(s(sz)))))) → (λx.(λy.(((λs.(λz.(s(sz))))x)(((λs.(λz.(s(s(sz)))))x)y))))
    β-reducció:
    ((λs.(λz.(s(sz))))x) → (λz.(x(xz)))
    β-reducció:
    ((λz.(x(xz)))(((λs.(λz.(s(s(sz)))))x)y)) → (x(x(((λs.(λz.(s(s(sz)))))x)y)))
    β-reducció:
    ((λs.(λz.(s(s(sz)))))x) → (λz.(x(x(xz))))
    β-reducció:
    ((λz.(x(x(xz))))y) → (x(x(xy)))
    Resultat:
    (λx.(λy.(x(x(x(x(xy)))))))
    `

Reduct macro

Give an option to reduct a macro.
For example:
N18≡ (((λp.(λq.(λx.(λy.((px)((qx)y))))))(((λp.(λq.(λx.(λy.((px)((qx)y))))))(((λp.(λq.(λx.(λy.((px)((qx)y))))))(λs.(λz.(s(s(sz))))))(λs.(λz.(s(s(sz)))))))(((λp.(λq.(λx.(λy.((px)((qx)y))))))(λs.(λz.(s(s(sz))))))(λs.(λz.(s(s(sz))))))))(((λp.(λq.(λx.(λy.((px)((qx)y))))))(λs.(λz.(s(s(sz))))))(λs.(λz.(s(s(sz)))))))
/reduct N18
N18=(λu.(λo.(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(uo))))))))))))))))))))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.