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.

51 lines
886 B

  1. /**
  2. * Just a small test file to ensure that Sylvan can compile in C++
  3. */
  4. #include <assert.h>
  5. #include <sylvan.h>
  6. #include <sylvan_obj.hpp>
  7. #include "test_assert.h"
  8. using namespace sylvan;
  9. int runtest()
  10. {
  11. Bdd one = Bdd::bddOne();
  12. Bdd zero = Bdd::bddZero();
  13. test_assert(one != zero);
  14. test_assert(one == !zero);
  15. Bdd v1 = Bdd::bddVar(1);
  16. Bdd v2 = Bdd::bddVar(2);
  17. Bdd t = v1 + v2;
  18. BddMap map;
  19. map.put(2, t);
  20. test_assert(v2.Compose(map) == (v1 + v2));
  21. test_assert((t * v2) == v2);
  22. return 0;
  23. }
  24. int main()
  25. {
  26. // Standard Lace initialization with 1 worker
  27. lace_init(1, 0);
  28. lace_startup(0, NULL, NULL);
  29. // Simple Sylvan initialization, also initialize BDD support
  30. sylvan_init_package(1LL<<16, 1LL<<16, 1LL<<16, 1LL<<16);
  31. sylvan_init_bdd(1);
  32. int res = runtest();
  33. sylvan_quit();
  34. lace_exit();
  35. return res;
  36. }