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.

56 lines
976 B

2 months ago
  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. Bdd u = v1;
  19. u += v2;
  20. test_assert(t == u);
  21. BddMap map;
  22. map.put(2, t);
  23. test_assert(v2.Compose(map) == (v1 + v2));
  24. test_assert((t * v2) == v2);
  25. return 0;
  26. }
  27. int main()
  28. {
  29. // Standard Lace initialization with 1 worker
  30. lace_init(1, 0);
  31. lace_startup(0, NULL, NULL);
  32. // Simple Sylvan initialization, also initialize BDD support
  33. sylvan_set_sizes(1LL<<16, 1LL<<16, 1LL<<16, 1LL<<16);
  34. sylvan_init_package();
  35. sylvan_init_bdd();
  36. int res = runtest();
  37. sylvan_quit();
  38. lace_exit();
  39. return res;
  40. }