/bandidoFSharp

a smart data structure to evaluate logical formulas in FSharp

Primary LanguageF#

Bandido for FSharp

Bandido is a library that partially implements Binary Decition Diagrams in FSharp based on what we currently know about the subject [0,1,2,3,4]. Graph based algorithms for boolean manipulation can be used to solve and efficiently represent boolean formulas. Bandido in FSharp is an attempt to implement the algorithms in a functional style. Use bandido library for FSharp at your own logical risk. Happy satisfiability!

What is implemented

Make, Build, Apply and Restrict algorithms are currently implemented. A rudimentary visualisation capability is also available. Given a table t : u -> (i,l,h) [3], the function Plot.t2dot t will translate the table into a dot graph that can be compiled into a picture. Several cases of use are showed in Script.fsx and a set of tests are implemented in the Test folder.

Build

The project requires dotnet core 2.0.

To compile, ensure to be placed into the src/ROBDD folder and type into the console:

dotnet build

to test, go to the Test folder and execute:

dotnet test

TODO

Algorithms

  • Mk
  • Build
  • Apply
  • Restrict (exponential running time)
  • Restrict (linear running time)
  • SatCount
  • Apply Dynamic Programming to SatCount
  • AnySat

Nice to have

  • function t2svg : T -> Bdd.svg
  • AllSat algorithm [3]
  • Simplify algorithm [3]

References

[0] Bryant, "Graph-Based Algorithms for Boolean Function Manipulation" in IEEE Transactions on Computers, vol. C-35, no. 8, pp. 677-691, Aug. 1986.

[1] Brace, K.S., Rudell, R.L., Bryant, R.E.: Efficient implementation of a BDD package. In: Proc. of the 27th ACM/IEEE Design Automation Conf. (DAC), pp. 40–45. ACM/IEEE, New York/Piscataway (1990)

[2] Bryant, Randal E. Symbolic Boolean Manipulation with Ordered Binary Decition Diagrams. 1992. ACM Comput. Surv. 24, 3 (September 1992)

[3] Reif Andersen, Henrik. An Introduction to Binary Decition Diagrams. 1999

[4] Bryant, Randal E. Binary Decision Diagrams in Handbook of Model Checking. Springer International Publishing. pp 191-217, 2018