※ 引述《ric2k1 (Ric)》之銘言:
Q: 在ite()裡面 bddNode要檢查complement parameter
是不是該用BddNode::isNegEdge()呢? 但是它是private 可以把它改成public嗎??
A: 嗯 是應該改成 public
不過不建議將 BddNode 宣告成 BddNodeInt 或是 BddManager 的 friend class
Q: BddManager::ite(...)
{
...
// check unique table
BddNodeInt* ni = uniquify(t(), e(), v);
ret = size_t(ni); <== what does this mean?
...
}
A: The type of "ret" is BddNode.
However, the line "ret = size_t(ni)" is NOT clear, and will make the later
line "ret = ~ret" ambiguous...
PLEASE CHANGE IT TO ---
ret = BddNode(size_t(ni));
This will make it easier to read.
Q: void forceInsert(size_t b, const BddHashNode& n) {
_buckets[b].push_back(n); }
void forceInsert(const BddHashKey& k, BddNodeInt* const n) {
_buckets[bucketNum(k)].push_back(BddHashNode(k, n)); }
我想問一下這兩個有差嗎?
既然知道 BddHashKey& k 就一定可以由 bucketNum(k) 得到 size_t b吧
還是有些地方會只知道size_t b 而不知道 BddHashKey& k??
如果不用紀錄b的話_uniqueTable.check(k, b, n)似乎可以少傳一個變數?
A: 我想原因有二:
(1) forceInsert(b, n) is called after check(), in which the bucket index
is computed. I just don't want to call the hash function again.
(2) Actually I don't want to expose "bucketNumber()" as a public function
because it seems to be some detailed information about the hash
implementation. Somehow it was left as a public one...
Anyway, I didn't update/improve "bddHash.cpp" this year --- it is the old
code from last semester. I think there's definitely room for improve.
You are welcome to modify it as the way you like.
Q: 請問什麼是canonical form??
A: canonical 的意思是 "標準的" "單一的".
就 BDD 的 canonical 的性質來說, 就是不管原來 function 的表示方法為何,
只要其 functionality 相同, 轉換成 BDD 之後就一定一模一樣.
而一個資料結構 T 具有 canonical form 的性質的意思就說,
若兩筆資料 A, B 有 A = B 的性質, 則 T(A) = T(B)
也就是說若 T(A) != T(B) 則 A != B
※ 編輯: ric2k1 來自: 59.121.129.244 (01/08 00:01)
※ 編輯: ric2k1 來自: 59.121.129.244 (01/08 00:02)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.121.128.79