GithubHelp home page GithubHelp logo

silky / lambda-ccc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conal/lambda-ccc

0.0 0.0 0.0 1.23 MB

Convert lambda expressions to CCC combinators

License: Other

Makefile 0.22% Haskell 99.58% Shell 0.20%

lambda-ccc's Introduction

Convert lambda expressions to CCC combinators and then to circuits.

Additional info:

Dependencies:

To use these versions of KURE and HERMIT, clone the repos (or pull if already cloned), and use "git checkout [commit-id]".

To try out:

  • cabal install circat and lambda-ccc (in that order)

  • In a shell, cd to lambda-ccc/test, and type make. If all works, you'll see something like the following output:

    bash-3.2$ ./test
    [starting HERMIT v0.5.0.1 on TreeTest.hs]
    % ghc TreeTest.hs -fforce-recomp -O2 -dcore-lint -fsimple-list-literals -fexpose-all-unfoldings -fplugin=LambdaCCC.Monomorphize -fplugin-opt=LambdaCCC.Monomorphize:-v0 -fplugin-opt=LambdaCCC.Monomorphize:DoTree.hss -fplugin-opt=LambdaCCC.Monomorphize:resume -fplugin-opt=LambdaCCC.Monomorphize:*: -v0
    
    real	0m6.098s
    user	0m5.968s
    sys	0m0.245s
    let f = \ ds -> abst (repr ds) in let f0 = \ ds -> let (a1,a'1) = repr (repr ds) in abst (repr (f a1) + repr (f a'1)) in let f1 = \ ds -> let (a1,a'1) = repr (repr ds) in abst (repr (f0 a1) + repr (f0 a'1)) in let f2 = \ eta -> let a = repr eta in abst (a * a) in let f3 = \ eta -> abst (let (a1,a'1) = repr (repr eta) in abst (f2 a1,f2 a'1)) in let f4 = \ eta -> abst (let (a1,a'1) = repr (repr eta) in abst (f3 a1,f3 a'1)) in \ x -> let (a1,a'1) = repr (let (a1,a'1) = repr (repr x) in abst (f4 a1,f4 a'1)) in repr (f1 a1) + repr (f1 a'1)
    Wrote out/sumSquare-t3.pdf
    Wrote out/sumSquare-t3.v.txt
    

The .v.txt file is Verilog code. Additionally the PDF will be displayed if the display code figures out how to on your system.

There are many other examples in test/TreeTest.hs. At any time, all examples but one are commented out.

lambda-ccc's People

Contributors

capn-freako avatar conal avatar

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.