Code Monkey home page Code Monkey logo

hascacbdd's Introduction

hascacbdd's People

Contributors

m4lvin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hascacbdd's Issues

sizeOf is inefficient

Problematic lines around here:

-- | List all the sub-BDDs of a given BDD.
subsOf :: Bdd -> [Bdd]
subsOf b
| b == bot = []
| b == top = []
| otherwise = nub $ b : (subsOf (thenOf b) ++ subsOf (elseOf b))
-- | Size of the BDD, should be the number of non-terminal nodes.
sizeOf :: Bdd -> Int
sizeOf = length.subsOf

It seems that the original CacBdd does not provide a function to count the nodes of a BDD.

Ugly workaround which does not improve performance: Provide an Ord instance and use nubOrd instead of nub.

segmenation fault on mac M1

This is coming from jrclogic/SMCDEL#35, but is not specific to SMCDEL.

On a Mac M1 stack test fails with a segmentation fault.

We can run it with lldb as follows

  • stack test
  • find the tests executable somewhere in .stack-work/...
  • run lldb .stack-work/whatever/the/path/is/tests
  • inside (lldb) now run

We then get:

Examples
  Creating BDDs
    top == Top [ ]Declaring One and Zero
Done with One and Zero
Process 84341 stopped
* thread #5, name = 'ghc_worker', stop reason = EXC_BAD_ACCESS (code=1, address=0x68)
    frame #0: 0x000000010102b9fc tests`XBDDManager::BddOne(this=0x0000000102306ca0) at BDDNode.h:99:41
   96       ~XBDDManager(){ delete mgr; }
   97       void Clear(int varCnt){ mgr->Clear(varCnt); }
   98
-> 99       BDD  BddOne(){ return BDD(mgr, mgr->One);}
   100      BDD  BddZero(){ return BDD(mgr, mgr->Zero);}
   101      BDD  BddVar(int varIndex){ return BDD(mgr, varIndex); }
   102      BDD  Ite(const BDD &f, const BDD &g, const BDD &h){ return BDD(mgr, mgr->ite(f.node, g.node, h.node)); };
(lldb)

where "One" is underlined in line 99.

Moving mgr from private to public (which should not be necessary) delays the problem into the body of BDD(mgr, mgr->One) at BDDNode.cpp:48 and then there gives a EXC_BAD_ACCESS error too.

Notably, the C++ example cd cpp && make -f OriginalMakefile && ./t does work fine and not have these problems.

Ideas for further debugging:

  • can we trigger the bug when only using C-to-C++ and not Haskell-to-C-to-C++ ?

Further information to collect:

  • compiler versions used on mac os

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.