You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
825 B

  1. /**
  2. * Just a small test file to ensure that Sylvan can compile in C++
  3. * Suggested by Shota Soga <shota.soga@gmail.com> for testing C++ compatibility
  4. */
  5. #include <assert.h>
  6. #include <sylvan.h>
  7. #include <sylvan_obj.hpp>
  8. using namespace sylvan;
  9. void test()
  10. {
  11. Bdd one = Bdd::bddOne();
  12. Bdd zero = Bdd::bddZero();
  13. Bdd v1 = Bdd::bddVar(1);
  14. Bdd v2 = Bdd::bddVar(2);
  15. Bdd t = v1 + v2;
  16. BddMap map;
  17. map.put(2, t);
  18. assert(v2.Compose(map) == v1+v2);
  19. t *= v2;
  20. assert(t == v2);
  21. }
  22. int main()
  23. {
  24. // Standard Lace initialization
  25. lace_init(0, 1000000);
  26. lace_startup(0, NULL, NULL);
  27. // Simple Sylvan initialization, also initialize BDD and LDD support
  28. sylvan_init_package(1LL<<16, 1LL<<16, 1LL<<16, 1LL<<16);
  29. sylvan_init_bdd(1);
  30. test();
  31. sylvan_quit();
  32. lace_exit();
  33. }