Re: [問題] hw5

作者: ric2k1 (Ric)   2010-05-19 11:20:47
※ 引述《kalawang ()》之銘言:
: ※ 引述《ric2k1 (Ric)》之銘言:
: : Gate::isWatchedValue(newIdx)
: : 就是去檢查第 newIdx 個 watch pin (in _wCandidates) 的 value
: : 是否 = watched value
: : 比方說 3-input AND gate, 這個 gate 本身將會放在他的 _wCandidates 的第 0 個位置
: : 而其他三個 fanins 會放在第 1 ~ 3 個位置.
: : 會到這裡表示要 update watch pin 但是找不到
: : (沒有其他非 watch 的 pin 都是非 watch value)
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 這邊是指所有非watched(!=otherPin Idx)
: 的其他pin都是watch value嗎?
: eg. (For OR gate, all fanins are 0 and fanout is 1)
Yes, 除了那兩個 watched pins 之外, 其他的都是 watch value
: : 所以傳入的 newIdx 必須 restore 回原來的值
: : 同時去檢查另一個 watch pin,
: : 如果它不是 watch value (e.g. 0 or x for AND's fanin),
: : 那麼就是著去 generate new implication (genIndexImp(otherIdx)),
: : 如果 other watch pin 的值是 known (e.g. 0 for AND's fanin)
: : otherwise (e.g. x for AND's fanin)
: : 相反的,如果另一個 watch pin 也是 watch value 的話,
: : 則所有的 pins 都是 watch value
: : (i.e. AND gate has value 0 and all its fanins have value 1's)
: : 因為 OR gate 的 output 是 watch 1,
: : 所以如果 output 也是個 watched pin 的話,
: : 自己 value 變成 1 的時候也要通知自己去 update watch pin
: : 所以自己會在自己的 watching-1 list 上面
: updateWatch()是為了做indirect implication吧(嗎)?
Yes.
: 如果現在有個direct implication
: (for eg. AND gate output 1 => all fanin's are ones)
: 會不會trigger updateWatch()這個function
會, 只要一個 gate 的 value 從 unknown 變成 known,
就必須將它的 watching list 裏頭所有的 gates 呼叫 updateWatch()
: 是不是要看AND的每個fanin 是否有被它自己的gate
: 放在watching-1 (for eg. OR) or (watching-known for XOR) 裡呢?
不用檢查吧!
就直接對所有的 fanins 將他們的 _watching_1 list 裏頭的所有 gates
呼叫 updateWatch()
: 再請問如果一個watched pin得到non Watch value(也就是有direct implication)
: (for eg 0 for AND gate fanin) 是不是不用update這個pin的watch pointer
: to a new index?
是的, 不用 update.
作者: kalawang (Out)   2010-05-19 14:07:00
謝謝回應

Links booklink

Contact Us: admin [ a t ] ucptt.com