Re: [问题] hw5

楼主: kalawang (Out)   2010-05-18 17:54:06
※ 引述《ric2k1 (Ric)》之铭言:
: ※ 引述《pokia (幻影成风)》之铭言:
: : 第一题附的updateWatch()里
: : isWatchedValue()指的是什么意思?
: Gate::isWatchedValue(newIdx)
: 就是去检查第 newIdx 个 watch pin (in _wCandidates) 的 value
: 是否 = watched value
: 比方说 3-input AND gate, 这个 gate 本身将会放在他的 _wCandidates 的第 0 个位置
: 而其他三个 fanins 会放在第 1 ~ 3 个位置.
: ==> isWatchedValue(0) 就会检查这个 gate 的 value 是否为 0
: ==> isWatchedValue(1 ~ 3) 会检查第 1 ~ 3 个 fanin 的 value 是否为 1
: : 还有最后一段的
: : if(!isWatchedValue(otherIdx))
: : return genIndexImp(otherIdx);
: : IMP_NEW? 这边也不太懂...
: : 我只知道newIdx在找新的index,不可以和另一个watch冲突...
: : 剩下的就不太明白了!?
: : 有人知道这个function大概的意思吗?
: 会到这里表示要 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)
: 所以传入的 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)
: ==> return IMP_DONE (i.e. no new implication is generated)
: otherwise (e.g. x for AND's fanin)
: ==> return IMP_NEW (i.e. new implication is generated on this watch pin)
: 相反的,如果另一个 watch pin 也是 watch value 的话,
: 则所有的 pins 都是 watch value
: (i.e. AND gate has value 0 and all its fanins have value 1's)
: ==> return IMP_CONFLICT
: : 顺便问一下,OR gate b 为什么也要把自己放在watching-1??
: : 我忘记了...
: 因为 OR gate 的 output 是 watch 1,
: 所以如果 output 也是个 watched pin 的话,
: 自己 value 变成 1 的时候也要通知自己去 update watch pin
: 所以自己会在自己的 watching-1 list 上面
updateWatch()是为了做indirect implication吧(吗)?
如果现在有个direct implication
(for eg. AND gate output 1 => all fanin's are ones)
会不会trigger updateWatch()这个function
是不是要看AND的每个fanin 是否有被它自己的gate
放在watching-1 (for eg. OR) or (watching-known for XOR) 里呢?
再请问如果一个watched pin得到non Watch value(也就是有direct implication)
(for eg 0 for AND gate fanin) 是不是不用update这个pin的watch pointer
to a new index?

Links booklink

Contact Us: admin [ a t ] ucptt.com