Skip to content

Commit

Permalink
Fixed Issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
iwashita-hiroaki committed Mar 9, 2023
1 parent cb07fc9 commit 67b2e94
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 25 deletions.
124 changes: 100 additions & 24 deletions apps/test/depend.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
testRandomDd.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
example1.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -16,8 +16,8 @@ testRandomDd.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testRandomDd-debug.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/op/Unreduction.hpp
example1-debug.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -35,8 +35,8 @@ testRandomDd-debug.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testRandomDd-11.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/op/Unreduction.hpp
example1-11.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -54,8 +54,8 @@ testRandomDd-11.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testRandomDd-11-debug.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/op/Unreduction.hpp
example1-11-debug.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -73,8 +73,8 @@ testRandomDd-11-debug.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
example1.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/op/Unreduction.hpp
example2.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -93,7 +93,7 @@ example1.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example1-debug.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
example2-debug.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -112,7 +112,7 @@ example1-debug.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example1-11.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
example2-11.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -131,7 +131,7 @@ example1-11.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example1-11-debug.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
example2-11-debug.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -150,8 +150,7 @@ example1-11-debug.o: example1.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example2.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
issue007.o: issue007.cpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
Expand All @@ -164,13 +163,32 @@ example2.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/DdStructure.hpp ../../include/tdzdd/DdEval.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example2-debug.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
issue007-debug.o: issue007.cpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
../../include/tdzdd/dd/DataTable.hpp \
../../include/tdzdd/dd/../util/MyVector.hpp \
../../include/tdzdd/dd/../util/MessageHandler.hpp \
../../include/tdzdd/dd/../util/ResourceUsage.hpp \
../../include/tdzdd/dd/../util/MemoryPool.hpp \
../../include/tdzdd/dd/../util/MyHashTable.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/DdStructure.hpp ../../include/tdzdd/DdEval.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
issue007-11.o: issue007.cpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
Expand All @@ -183,13 +201,13 @@ example2-debug.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/DdStructure.hpp ../../include/tdzdd/DdEval.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example2-11.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
issue007-11-debug.o: issue007.cpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
Expand All @@ -202,12 +220,17 @@ example2-11.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/DdStructure.hpp ../../include/tdzdd/DdEval.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
example2-11-debug.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
test.o: test.cpp
test-debug.o: test.cpp
test-11.o: test.cpp
test-11-debug.o: test.cpp
testRandomDd.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
Expand All @@ -225,7 +248,64 @@ example2-11-debug.o: example2.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testRandomDd-debug.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
../../include/tdzdd/dd/DataTable.hpp \
../../include/tdzdd/dd/../util/MyVector.hpp \
../../include/tdzdd/dd/../util/MessageHandler.hpp \
../../include/tdzdd/dd/../util/ResourceUsage.hpp \
../../include/tdzdd/dd/../util/MemoryPool.hpp \
../../include/tdzdd/dd/../util/MyHashTable.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testRandomDd-11.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
../../include/tdzdd/dd/DataTable.hpp \
../../include/tdzdd/dd/../util/MyVector.hpp \
../../include/tdzdd/dd/../util/MessageHandler.hpp \
../../include/tdzdd/dd/../util/ResourceUsage.hpp \
../../include/tdzdd/dd/../util/MemoryPool.hpp \
../../include/tdzdd/dd/../util/MyHashTable.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testRandomDd-11-debug.o: testRandomDd.cpp ../../include/tdzdd/DdStructure.hpp \
../../include/tdzdd/DdEval.hpp ../../include/tdzdd/DdSpec.hpp \
../../include/tdzdd/dd/DdBuilder.hpp \
../../include/tdzdd/dd/DdSweeper.hpp ../../include/tdzdd/dd/Node.hpp \
../../include/tdzdd/dd/NodeTable.hpp \
../../include/tdzdd/dd/DataTable.hpp \
../../include/tdzdd/dd/../util/MyVector.hpp \
../../include/tdzdd/dd/../util/MessageHandler.hpp \
../../include/tdzdd/dd/../util/ResourceUsage.hpp \
../../include/tdzdd/dd/../util/MemoryPool.hpp \
../../include/tdzdd/dd/../util/MyHashTable.hpp \
../../include/tdzdd/dd/../util/MyList.hpp \
../../include/tdzdd/dd/DepthFirstSearcher.hpp \
../../include/tdzdd/util/demangle.hpp \
../../include/tdzdd/dd/DdReducer.hpp \
../../include/tdzdd/eval/Cardinality.hpp \
../../include/tdzdd/eval/../util/BigNumber.hpp \
../../include/tdzdd/op/Lookahead.hpp \
../../include/tdzdd/op/Unreduction.hpp RandomDd.hpp
testSizeConstraint.o: testSizeConstraint.cpp \
../../include/tdzdd/DdStructure.hpp ../../include/tdzdd/DdEval.hpp \
../../include/tdzdd/DdSpec.hpp ../../include/tdzdd/dd/DdBuilder.hpp \
Expand Down Expand Up @@ -314,7 +394,3 @@ testSizeConstraint-11-debug.o: testSizeConstraint.cpp \
../../include/tdzdd/op/BinaryOperation.hpp \
../../include/tdzdd/spec/SizeConstraint.hpp \
../../include/tdzdd/spec/../util/IntSubset.hpp
test.o: test.cpp
test-debug.o: test.cpp
test-11.o: test.cpp
test-11-debug.o: test.cpp
20 changes: 20 additions & 0 deletions apps/test/issue007.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* https://github.com/kunisura/TdZdd/issues/7
*/

#include <gtest/gtest.h>

#include "tdzdd/DdSpec.hpp"
#include "tdzdd/DdStructure.hpp"

constexpr int ARITY = 2; // or 3, 4, ...

struct Spec : tdzdd::StatelessDdSpec<Spec, ARITY> {
int getRoot() const { return 1; }
int getChild(int, int) const { return 0; }
};

TEST(Issue007, Main) {
ASSERT_EQ(tdzdd::DdStructure<ARITY>{Spec{}},
tdzdd::DdStructure<ARITY>{Spec{}});
}
6 changes: 5 additions & 1 deletion include/tdzdd/dd/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ class NodeId {

NodeId(uint64_t row, uint64_t col) :
code_((row << NODE_ROW_OFFSET) | col) {
assert(row <= NODE_ROW_MAX);
assert(col <= NODE_COL_MAX);
}

NodeId(uint64_t row, uint64_t col, bool attr) :
code_((row << NODE_ROW_OFFSET) | col) {
assert(row <= NODE_ROW_MAX);
assert(col <= NODE_COL_MAX);
setAttr(attr);
}

Expand Down Expand Up @@ -195,7 +199,7 @@ struct Node {
template<int ARITY>
struct InitializedNode: Node<ARITY> {
InitializedNode() :
Node<ARITY>(0, 0) {
Node<ARITY>(NodeId(0, NODE_COL_MAX), NodeId(0, NODE_COL_MAX)) {
}

InitializedNode(NodeId f0, NodeId f1) :
Expand Down

0 comments on commit 67b2e94

Please sign in to comment.